Skip to content

Commit 6212e3a

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
Remove struct task_struct::io_wait
Hell knows what happened in commit 63b0520 during 2.6.9 development. Commit introduced io_wait field which remained write-only than and still remains write-only. Also garbage collect macros which "use" io_wait. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9cd9a00 commit 6212e3a

4 files changed

Lines changed: 2 additions & 34 deletions

File tree

‎fs/aio.c‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -710,18 +710,9 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
710710

711711
/*
712712
* Now we are all set to call the retry method in async
713-
* context. By setting this thread's io_wait context
714-
* to point to the wait queue entry inside the currently
715-
* running iocb for the duration of the retry, we ensure
716-
* that async notification wakeups are queued by the
717-
* operation instead of blocking waits, and when notified,
718-
* cause the iocb to be kicked for continuation (through
719-
* the aio_wake_function callback).
713+
* context.
720714
*/
721-
BUG_ON(current->io_wait != NULL);
722-
current->io_wait = &iocb->ki_wait;
723715
ret = retry(iocb);
724-
current->io_wait = NULL;
725716

726717
if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
727718
BUG_ON(!list_empty(&iocb->ki_wait.task_list));
@@ -1508,10 +1499,7 @@ static ssize_t aio_setup_iocb(struct kiocb *kiocb)
15081499
* Simply triggers a retry of the operation via kick_iocb.
15091500
*
15101501
* This callback is specified in the wait queue entry in
1511-
* a kiocb (current->io_wait points to this wait queue
1512-
* entry when an aio operation executes; it is used
1513-
* instead of a synchronous wait when an i/o blocking
1514-
* condition is encountered during aio).
1502+
* a kiocb.
15151503
*
15161504
* Note:
15171505
* This routine is executed with the wait queue lock held.

‎include/linux/aio.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,6 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
232232
__put_ioctx(kioctx); \
233233
} while (0)
234234

235-
#define in_aio() (unlikely(!is_sync_wait(current->io_wait)))
236-
237-
/* may be used for debugging */
238-
#define warn_if_async() \
239-
do { \
240-
if (in_aio()) { \
241-
printk(KERN_ERR "%s(%s:%d) called in async context!\n", \
242-
__FUNCTION__, __FILE__, __LINE__); \
243-
dump_stack(); \
244-
} \
245-
} while (0)
246-
247235
#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
248236

249237
#include <linux/aio_abi.h>

‎include/linux/sched.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,13 +1110,6 @@ struct task_struct {
11101110

11111111
unsigned long ptrace_message;
11121112
siginfo_t *last_siginfo; /* For ptrace use. */
1113-
/*
1114-
* current io wait handle: wait queue entry to use for io waits
1115-
* If this thread is processing aio, this points at the waitqueue
1116-
* inside the currently handled kiocb. It may be NULL (i.e. default
1117-
* to a stack based synchronous wait) if its doing sync IO.
1118-
*/
1119-
wait_queue_t *io_wait;
11201113
#ifdef CONFIG_TASK_XACCT
11211114
/* i/o counters(bytes read/written, #syscalls */
11221115
u64 rchar, wchar, syscr, syscw;

‎kernel/fork.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
10841084
p->security = NULL;
10851085
#endif
10861086
p->io_context = NULL;
1087-
p->io_wait = NULL;
10881087
p->audit_context = NULL;
10891088
cpuset_fork(p);
10901089
#ifdef CONFIG_NUMA

0 commit comments

Comments
 (0)