Skip to content

Commit

Permalink
Merge pull request #6326 from filecoin-project/chore/pick-6294
Browse files Browse the repository at this point in the history
chore: pick 6294 6313
  • Loading branch information
LinZexiao authored Apr 23, 2024
2 parents fb61376 + 030eb84 commit 9266f95
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ commands:
executors:
golang:
docker:
- image: cimg/go:1.20.11
- image: cimg/go:1.21.7

jobs:
test_all:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/baisc_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.21'
cache: true

- name: install deps
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
golangci-lint run --timeout 10m
- name: Compatible all
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/common_build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.21'
cache: true

- name: install deps
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.21'
cache: true

- name: install more deps
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/common_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.21'
cache: true

- name: vars
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
golangci-lint run --timeout 10m
- name: Detect changes
Expand All @@ -70,13 +70,13 @@ jobs:
export GOLOG_LOG_LEVEL=${{ inputs.log_level }}
go test -coverpkg=./... -race -coverprofile=coverage.txt -covermode=atomic ./... -v --timeout ${{ inputs.test_timeout }}m
# https://github.com/codecov/codecov-action/issues/557#issuecomment-1216749652
- name: Upload
uses: codecov/codecov-action@v3
with:
# https://github.com/codecov/codecov-action/issues/557#issuecomment-1216749652
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
flags: unittests
name: ${{steps.vars.outputs.repo_name}}
fail_ci_if_error: true
fail_ci_if_error: false
verbose: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.21'
cache: true

- name: install deps
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ linters:
- govet
- misspell
- goconst
- revive
- errcheck
- unconvert
- staticcheck
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/filecoin-project/venus

go 1.19
go 1.21

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
Expand Down
43 changes: 43 additions & 0 deletions go.sum

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions pkg/shardedmutex/shardedmutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import (
"sync"
)

const cacheline = 64

// padding a mutex to a cacheline improves performance as the cachelines are not contested
// name old time/op new time/op delta
// Locks-8 74.6ns ± 7% 12.3ns ± 2% -83.54% (p=0.000 n=20+18)
type paddedMutex struct {
mt sync.Mutex
pad [cacheline - 8]uint8 //nolint:unused
mt sync.Mutex
}

type ShardedMutex struct { //nolint:revive
Expand Down

0 comments on commit 9266f95

Please sign in to comment.