On Mon, Jun 20, 2005 at 09:31:26PM +0530, Suparna Bhattacharya wrote: > > (1) Updating AIO to use wait-bit based filtered wakeups (me/wli) > > Status: Updated to 2.6.12-rc6, needs review > Allocates space for the default io wait queue entry (actually a wait bit entry) in the task struct. Doing so simplifies the patches for AIO wait page allowing for cleaner and more efficient implementation, at the cost of 28 additional bytes in task struct vs allocation on demand on-stack. Signed-off-by: Suparna Bhattacharya Signed-off-by: Benjamin LaHaise diff -purN --exclude=description 73_wait_bit_key/include/linux/sched.h 74_default-io_wait/include/linux/sched.h --- 73_wait_bit_key/include/linux/sched.h 2005-07-13 11:26:12.000000000 -0400 +++ 74_default-io_wait/include/linux/sched.h 2005-07-31 16:12:32.000000000 -0400 @@ -746,11 +746,14 @@ struct task_struct { unsigned long ptrace_message; siginfo_t *last_siginfo; /* For ptrace use. */ + +/* Space for default IO wait bit entry used for synchronous IO waits */ + struct wait_bit_queue __wait; /* - * current io wait handle: wait queue entry to use for io waits - * If this thread is processing aio, this points at the waitqueue - * inside the currently handled kiocb. It may be NULL (i.e. default - * to a stack based synchronous wait) if its doing sync IO. + * Current IO wait handle: wait queue entry to use for IO waits + * If this thread is processing AIO, this points at the waitqueue + * inside the currently handled kiocb. Otherwise, points to the + * default IO wait field (i.e &__wait.wait above). */ wait_queue_t *io_wait; /* i/o counters(bytes read/written, #syscalls */ diff -purN --exclude=description 73_wait_bit_key/kernel/fork.c 74_default-io_wait/kernel/fork.c --- 73_wait_bit_key/kernel/fork.c 2005-07-13 11:26:14.000000000 -0400 +++ 74_default-io_wait/kernel/fork.c 2005-07-31 16:12:32.000000000 -0400 @@ -943,7 +943,8 @@ static task_t *copy_process(unsigned lon do_posix_clock_monotonic_gettime(&p->start_time); p->security = NULL; p->io_context = NULL; - p->io_wait = NULL; + init_wait_bit_task(&p->__wait, p); + p->io_wait = &p->__wait.wait; p->audit_context = NULL; #ifdef CONFIG_NUMA p->mempolicy = mpol_copy(p->mempolicy);