diff options
| author | Jens Axboe <axboe@kernel.dk> | 2024-09-11 10:42:40 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2024-09-11 10:42:40 -0600 |
| commit | 6d0f8dcb3a634bbee46fcb028c5984c463f47812 (patch) | |
| tree | e77e8999fa9d79363a9b11832a0d7795a0e8ef4f /io_uring/sqpoll.c | |
| parent | 318ad4283a6efea8ce5ec2b3c65b6cb19df6b07e (diff) | |
| parent | 84eacf177faa605853c58e5b1c0d9544b88c16fd (diff) | |
| download | linux-6d0f8dcb3a634bbee46fcb028c5984c463f47812.tar.gz linux-6d0f8dcb3a634bbee46fcb028c5984c463f47812.tar.bz2 linux-6d0f8dcb3a634bbee46fcb028c5984c463f47812.zip | |
Merge branch 'for-6.12/io_uring' into for-6.12/io_uring-discard
* for-6.12/io_uring: (31 commits)
io_uring/io-wq: inherit cpuset of cgroup in io worker
io_uring/io-wq: do not allow pinning outside of cpuset
io_uring/rw: drop -EOPNOTSUPP check in __io_complete_rw_common()
io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN
io_uring/sqpoll: do not allow pinning outside of cpuset
io_uring/eventfd: move refs to refcount_t
io_uring: remove unused rsrc_put_fn
io_uring: add new line after variable declaration
io_uring: add GCOV_PROFILE_URING Kconfig option
io_uring/kbuf: add support for incremental buffer consumption
io_uring/kbuf: pass in 'len' argument for buffer commit
Revert "io_uring: Require zeroed sqe->len on provided-buffers send"
io_uring/kbuf: move io_ring_head_to_buf() to kbuf.h
io_uring/kbuf: add io_kbuf_commit() helper
io_uring/kbuf: shrink nr_iovs/mode in struct buf_sel_arg
io_uring: wire up min batch wake timeout
io_uring: add support for batch wait timeout
io_uring: implement our own schedule timeout handling
io_uring: move schedule wait logic into helper
io_uring: encapsulate extraneous wait flags into a separate struct
...
Diffstat (limited to 'io_uring/sqpoll.c')
| -rw-r--r-- | io_uring/sqpoll.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index 3b50dc9586d1..272df9d00f45 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/audit.h> #include <linux/security.h> +#include <linux/cpuset.h> #include <linux/io_uring.h> #include <uapi/linux/io_uring.h> @@ -176,7 +177,7 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries) if (cap_entries && to_submit > IORING_SQPOLL_CAP_ENTRIES_VALUE) to_submit = IORING_SQPOLL_CAP_ENTRIES_VALUE; - if (!wq_list_empty(&ctx->iopoll_list) || to_submit) { + if (to_submit || !wq_list_empty(&ctx->iopoll_list)) { const struct cred *creds = NULL; if (ctx->sq_creds != current_cred()) @@ -460,10 +461,12 @@ __cold int io_sq_offload_create(struct io_ring_ctx *ctx, return 0; if (p->flags & IORING_SETUP_SQ_AFF) { + struct cpumask allowed_mask; int cpu = p->sq_thread_cpu; ret = -EINVAL; - if (cpu >= nr_cpu_ids || !cpu_online(cpu)) + cpuset_cpus_allowed(current, &allowed_mask); + if (!cpumask_test_cpu(cpu, &allowed_mask)) goto err_sqpoll; sqd->sq_cpu = cpu; } else { |
