On 9/7/21 10:10 PM, Andrzej Jakowski wrote: > This patch allows to flexibly assign IO threads to fileset. When > you specify: > > t/io_uring -n 5 /dev/dev1 dev/dev2 > > First file/device will get 3 IO threads and second file/device > remaining 2 IO threads. When there is more files then IO threads, > IO thread may get assigned multiple files/devices. > > Signed-off-by: Andrzej Jakowski <andrzej.jakowski@xxxxxxxxx> > --- > t/io_uring.c | 51 ++++++++++++++++++++++++++++++++++----------------- > 1 file changed, 34 insertions(+), 17 deletions(-) > > diff --git a/t/io_uring.c b/t/io_uring.c > index 28c76b0..6a06799 100644 > --- a/t/io_uring.c > +++ b/t/io_uring.c > @@ -556,7 +556,8 @@ int main(int argc, char *argv[]) > { > struct submitter *s; > unsigned long done, calls, reap; > - int err, i, j, flags, fd, opt; > + int err, i, j, flags, fd, opt, threads_per_f, threads_rem = 0, nfiles; > + struct file f; > char *fdepths; > void *ret; > > @@ -613,37 +614,53 @@ int main(int argc, char *argv[]) > > j = 0; > i = optind; > + nfiles = argc - i; > + threads_per_f = nthreads / nfiles; Can nfiles be zero? -- Jens Axboe