Skip to content

Commit 74dea5d

Browse files
committed
Merge tag 'io_uring-5.6-2020-02-28' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe: - Fix for a race with IOPOLL used with SQPOLL (Xiaoguang) - Only show ->fdinfo if procfs is enabled (Tobias) - Fix for a chain with multiple personalities in the SQEs - Fix for a missing free of personality idr on exit - Removal of the spin-for-work optimization - Fix for next work lookup on request completion - Fix for non-vec read/write result progation in case of links - Fix for a fileset references on switch - Fix for a recvmsg/sendmsg 32-bit compatability mode * tag 'io_uring-5.6-2020-02-28' of git://git.kernel.dk/linux-block: io_uring: fix 32-bit compatability with sendmsg/recvmsg io_uring: define and set show_fdinfo only if procfs is enabled io_uring: drop file set ref put/get on switch io_uring: import_single_range() returns 0/-ERROR io_uring: pick up link work on submit reference drop io-wq: ensure work->task_pid is cleared on init io-wq: remove spin-for-work optimization io_uring: fix poll_list race for SETUP_IOPOLL|SETUP_SQPOLL io_uring: fix personality idr leak io_uring: handle multiple personalities in link chains
2 parents c60c040 + d876836 commit 74dea5d

File tree

3 files changed

+74
-91
lines changed

3 files changed

+74
-91
lines changed

fs/io-wq.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -535,42 +535,23 @@ static void io_worker_handle_work(struct io_worker *worker)
535535
} while (1);
536536
}
537537

538-
static inline void io_worker_spin_for_work(struct io_wqe *wqe)
539-
{
540-
int i = 0;
541-
542-
while (++i < 1000) {
543-
if (io_wqe_run_queue(wqe))
544-
break;
545-
if (need_resched())
546-
break;
547-
cpu_relax();
548-
}
549-
}
550-
551538
static int io_wqe_worker(void *data)
552539
{
553540
struct io_worker *worker = data;
554541
struct io_wqe *wqe = worker->wqe;
555542
struct io_wq *wq = wqe->wq;
556-
bool did_work;
557543

558544
io_worker_start(wqe, worker);
559545

560-
did_work = false;
561546
while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) {
562547
set_current_state(TASK_INTERRUPTIBLE);
563548
loop:
564-
if (did_work)
565-
io_worker_spin_for_work(wqe);
566549
spin_lock_irq(&wqe->lock);
567550
if (io_wqe_run_queue(wqe)) {
568551
__set_current_state(TASK_RUNNING);
569552
io_worker_handle_work(worker);
570-
did_work = true;
571553
goto loop;
572554
}
573-
did_work = false;
574555
/* drops the lock on success, retry */
575556
if (__io_worker_idle(wqe, worker)) {
576557
__release(&wqe->lock);

fs/io-wq.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,10 @@ struct io_wq_work {
7979
pid_t task_pid;
8080
};
8181

82-
#define INIT_IO_WORK(work, _func) \
83-
do { \
84-
(work)->list.next = NULL; \
85-
(work)->func = _func; \
86-
(work)->files = NULL; \
87-
(work)->mm = NULL; \
88-
(work)->creds = NULL; \
89-
(work)->fs = NULL; \
90-
(work)->flags = 0; \
91-
} while (0) \
82+
#define INIT_IO_WORK(work, _func) \
83+
do { \
84+
*(work) = (struct io_wq_work){ .func = _func }; \
85+
} while (0) \
9286

9387
typedef void (get_work_fn)(struct io_wq_work *);
9488
typedef void (put_work_fn)(struct io_wq_work *);

0 commit comments

Comments
 (0)