kernel-ark/kernel
David Howells 65f27f3844 WorkStruct: Pass the work_struct pointer instead of context data
Pass the work_struct pointer to the work function rather than context data.
The work function can use container_of() to work out the data.

For the cases where the container of the work_struct may go away the moment the
pending bit is cleared, it is made possible to defer the release of the
structure by deferring the clearing of the pending bit.

To make this work, an extra flag is introduced into the management side of the
work_struct.  This governs auto-release of the structure upon execution.

Ordinarily, the work queue executor would release the work_struct for further
scheduling or deallocation by clearing the pending bit prior to jumping to the
work function.  This means that, unless the driver makes some guarantee itself
that the work_struct won't go away, the work function may not access anything
else in the work_struct or its container lest they be deallocated..  This is a
problem if the auxiliary data is taken away (as done by the last patch).

However, if the pending bit is *not* cleared before jumping to the work
function, then the work function *may* access the work_struct and its container
with no problems.  But then the work function must itself release the
work_struct by calling work_release().

In most cases, automatic release is fine, so this is the default.  Special
initiators exist for the non-auto-release case (ending in _NAR).


Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-22 14:55:48 +00:00
..
irq [PATCH] some irq_chip variables point to NULL 2006-11-16 11:43:37 -08:00
power WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
time [PATCH] time_adjust cleared before use 2006-10-28 11:30:55 -07:00
.gitignore
acct.c [PATCH] csa: convert CONFIG tag for extended accounting routines 2006-10-01 00:39:29 -07:00
audit.c [PATCH] kauditd_thread warning fix 2006-10-06 08:53:39 -07:00
audit.h
auditfilter.c [PATCH] arch filter lists with < or > should not be accepted 2006-10-04 08:31:16 -04:00
auditsc.c [PATCH] name_count array overrun 2006-10-04 08:31:21 -04:00
capability.c
compat.c [PATCH] Create compat_sys_migrate_pages 2006-11-03 12:27:59 -08:00
configs.c
cpu.c [PATCH] Fix the spurious unlock_cpu_hotplug false warnings 2006-11-06 01:46:22 -08:00
cpuset.c [PATCH] cpuset ANSI prototype 2006-10-10 15:37:23 -07:00
delayacct.c [PATCH] lockdep: fix delayacct locking bug 2006-11-06 01:46:23 -08:00
dma.c
exec_domain.c
exit.c [PATCH] taskstats_tgid_free: fix usage 2006-10-28 11:30:54 -07:00
extable.c
fork.c Revert "[PATCH] fix Data Acess error in dup_fd" 2006-11-14 15:20:51 -08:00
futex_compat.c [PATCH] __user annotations: futex 2006-10-10 15:37:22 -07:00
futex.c [PATCH] schedule removal of FUTEX_FD 2006-11-03 12:27:58 -08:00
hrtimer.c
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kmod.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
kprobes.c [PATCH] kretprobe spinlock deadlock patch 2006-10-02 07:57:16 -07:00
ksysfs.c
kthread.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
latency.c
lockdep_internals.h
lockdep_proc.c
lockdep.c [PATCH] lockdep: fix static keys in module-allocated percpu areas 2006-11-17 11:10:37 -08:00
Makefile [PATCH] srcu-3: RCU variant permitting read-side blocking 2006-10-04 07:55:30 -07:00
module.c [PATCH] ndiswrapper: don't set the module->taints flags 2006-10-30 12:08:40 -08:00
mutex-debug.c Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass() 2006-10-11 01:45:14 -04:00
mutex-debug.h
mutex.c
mutex.h
nsproxy.c [PATCH] kernel/nsproxy.c: use kmemdup() 2006-10-20 10:26:44 -07:00
panic.c
params.c
pid.c
posix-cpu-timers.c [PATCH] posix-cpu-timers: prevent signal delivery starvation 2006-10-17 08:18:43 -07:00
posix-timers.c
printk.c [PATCH] Add printk_timed_ratelimit() 2006-11-03 12:27:58 -08:00
profile.c [PATCH] bitmap: parse input from kernel and user buffers 2006-10-11 11:14:22 -07:00
ptrace.c
rcupdate.c [PATCH] rcu: simplify/improve batch tuning 2006-10-04 07:55:31 -07:00
rcutorture.c [PATCH] rcu: add sched torture type to rcutorture 2006-10-04 07:55:31 -07:00
relay.c [PATCH] make kernel/relay.c __user-clean 2006-10-10 15:37:22 -07:00
resource.c
rtmutex_common.h
rtmutex-debug.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
rtmutex-debug.h
rtmutex-tester.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
rtmutex.c
rtmutex.h [PATCH] lockdep: better lock debugging 2006-07-03 15:27:01 -07:00
rwsem.c
sched.c [PATCH] readjust comments of task_timeslice for kernel doc 2006-10-20 10:26:37 -07:00
seccomp.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.c Make sure "user->sigpending" count is in sync 2006-11-04 13:03:00 -08:00
softirq.c
softlockup.c
spinlock.c
srcu.c [PATCH] SRCU: report out-of-memory errors 2006-10-04 07:55:30 -07:00
stacktrace.c
stop_machine.c
sys_ni.c [PATCH] Create compat_sys_migrate_pages 2006-11-03 12:27:59 -08:00
sys.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
sysctl.c [PATCH] sysctl: allow a zero ctl_name in the middle of a sysctl table 2006-11-06 01:46:23 -08:00
taskstats.c [PATCH] taskstats: fix sub-threads accounting 2006-10-31 08:07:00 -08:00
time.c
timer.c
tsacct.c [PATCH] xacct_add_tsk: fix pure theoretical ->mm use-after-free 2006-10-30 12:08:41 -08:00
uid16.c
unwind.c [PATCH] x86-64: Speed up dwarf2 unwinder 2006-10-21 18:37:01 +02:00
user.c Fix unlikely (but possible) race condition on task->user access 2006-11-04 10:06:02 -08:00
utsname.c
wait.c
workqueue.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00