Skip to content

Commit 45c831c

Browse files
remove numa dependency and flag (#13)
1 parent 6ca64c3 commit 45c831c

File tree

5 files changed

+71
-528
lines changed

5 files changed

+71
-528
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.17
19+
go-version: 1.22
2020

2121
- name: Build
2222
run: go build -v ./...

cmd/cmd.go

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of MinIO dperf
2-
// Copyright (c) 2021 MinIO, Inc.
2+
// Copyright (c) 2021-2024 MinIO, Inc.
33
//
44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU Affero General Public License as published by
@@ -22,12 +22,9 @@ import (
2222
"flag"
2323
"fmt"
2424
"os"
25-
"os/exec"
2625
"path/filepath"
27-
"syscall"
2826

2927
"github.com/dustin/go-humanize"
30-
"github.com/lrita/numa"
3128
"github.com/spf13/cobra"
3229
"github.com/spf13/viper"
3330

@@ -73,31 +70,6 @@ $ dperf /mnt/drive{1..6}
7370
$ dperf --serial /mnt/drive{1..6}
7471
`,
7572
RunE: func(c *cobra.Command, args []string) error {
76-
if cpuNode > -1 {
77-
cpumask, err := numa.NodeToCPUMask(cpuNode)
78-
if err != nil {
79-
return err
80-
}
81-
82-
if err = numa.SetSchedAffinity(0, cpumask); err != nil {
83-
return err
84-
}
85-
86-
if v := os.Getenv("_DPERF_AVOID_RESPAWN"); v == "" {
87-
// Use the original binary location. This works with symlinks such that if
88-
// the file it points to has been changed we will use the updated symlink.
89-
argv0, err := exec.LookPath(os.Args[0])
90-
if err != nil {
91-
return err
92-
}
93-
94-
// Invokes the execve system call.
95-
// Re-uses the same pid. This preserves the pid over multiple server-respawns.
96-
os.Setenv("_DPERF_AVOID_RESPAWN", "1")
97-
return syscall.Exec(argv0, os.Args, os.Environ())
98-
}
99-
}
100-
10173
bs, err := humanize.ParseBytes(blockSize)
10274
if err != nil {
10375
return fmt.Errorf("Invalid blocksize format: %v", err)
@@ -179,8 +151,6 @@ func init() {
179151
"blocksize", "b", blockSize, "read/write block size")
180152
dperfCmd.PersistentFlags().StringVarP(&fileSize,
181153
"filesize", "f", fileSize, "amount of data to read/write per drive")
182-
dperfCmd.PersistentFlags().IntVarP(&cpuNode,
183-
"cpunode", "c", -1, "execute on a specific CPU node, defaults to all CPU nodes")
184154
dperfCmd.PersistentFlags().IntVarP(&ioPerDrive,
185155
"ioperdrive", "i", ioPerDrive, "number of concurrent I/O per drive, default is 4")
186156

go.mod

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
module github.com/minio/dperf
22

3-
go 1.17
3+
go 1.22
44

55
require (
66
github.com/dustin/go-humanize v1.0.1
7-
github.com/fatih/color v1.15.0
8-
github.com/google/uuid v1.3.0
9-
github.com/lrita/numa v1.0.2
10-
github.com/minio/pkg/v2 v2.0.4
7+
github.com/fatih/color v1.17.0
8+
github.com/google/uuid v1.6.0
9+
github.com/minio/pkg/v3 v3.0.15
1110
github.com/ncw/directio v1.0.5
1211
github.com/secure-io/sio-go v0.3.1
13-
github.com/spf13/cobra v1.7.0
14-
github.com/spf13/viper v1.16.0
15-
golang.org/x/sys v0.9.0
12+
github.com/spf13/cobra v1.8.1
13+
github.com/spf13/viper v1.19.0
14+
golang.org/x/sys v0.25.0
1615
)
1716

1817
require (
19-
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
20-
github.com/fsnotify/fsnotify v1.6.0 // indirect
18+
github.com/fsnotify/fsnotify v1.7.0 // indirect
2119
github.com/hashicorp/hcl v1.0.0 // indirect
2220
github.com/inconshreveable/mousetrap v1.1.0 // indirect
23-
github.com/intel-go/cpuid v0.0.0-20220614022739-219e067757cb // indirect
2421
github.com/magiconair/properties v1.8.7 // indirect
2522
github.com/mattn/go-colorable v0.1.13 // indirect
26-
github.com/mattn/go-isatty v0.0.19 // indirect
23+
github.com/mattn/go-isatty v0.0.20 // indirect
2724
github.com/mitchellh/mapstructure v1.5.0 // indirect
28-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
29-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
25+
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
3026
github.com/rogpeppe/go-internal v1.9.1-0.20221123163938-fef05454be76 // indirect
31-
github.com/spf13/afero v1.9.5 // indirect
32-
github.com/spf13/cast v1.5.1 // indirect
33-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
27+
github.com/sagikazarmark/locafero v0.6.0 // indirect
28+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
29+
github.com/sourcegraph/conc v0.3.0 // indirect
30+
github.com/spf13/afero v1.11.0 // indirect
31+
github.com/spf13/cast v1.7.0 // indirect
3432
github.com/spf13/pflag v1.0.5 // indirect
35-
github.com/stretchr/testify v1.8.4 // indirect
36-
github.com/subosito/gotenv v1.4.2 // indirect
37-
golang.org/x/crypto v0.10.0 // indirect
38-
golang.org/x/text v0.10.0 // indirect
33+
github.com/subosito/gotenv v1.6.0 // indirect
34+
go.uber.org/multierr v1.11.0 // indirect
35+
golang.org/x/crypto v0.27.0 // indirect
36+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
37+
golang.org/x/text v0.18.0 // indirect
3938
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
4039
gopkg.in/ini.v1 v1.67.0 // indirect
4140
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)