riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE
[platform/kernel/linux-starfive.git] / io_uring / sqpoll.c
index 6ffa5cf..7b6facf 100644 (file)
@@ -423,3 +423,20 @@ err:
        io_sq_thread_finish(ctx);
        return ret;
 }
+
+__cold int io_sqpoll_wq_cpu_affinity(struct io_ring_ctx *ctx,
+                                    cpumask_var_t mask)
+{
+       struct io_sq_data *sqd = ctx->sq_data;
+       int ret = -EINVAL;
+
+       if (sqd) {
+               io_sq_thread_park(sqd);
+               /* Don't set affinity for a dying thread */
+               if (sqd->thread)
+                       ret = io_wq_cpu_affinity(sqd->thread->io_uring, mask);
+               io_sq_thread_unpark(sqd);
+       }
+
+       return ret;
+}