linux/arch
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
..
alpha Update for the srm_env driver. 2006-11-07 23:50:37 +01:00
arm [ARM] Remove OP_MAX_COUNTER 2006-11-14 15:15:40 +00:00
arm26 [PATCH] remove bogus arch-specific syscall exports 2006-10-11 11:17:07 -07:00
avr32 AVR32: Add missing return instruction in __raw_writesb 2006-11-06 14:07:16 +01:00
cris [PATCH] cryptocop: double spin_lock_irqsave() 2006-10-30 12:08:41 -08:00
frv [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
h8300 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
i386 x86: be more careful when walking back the frame pointer chain 2006-11-17 11:14:56 -08:00
ia64 [IA64] a fix towards allmodconfig build 2006-11-16 11:25:12 -08:00
m32r [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
m68k [PATCH] m68k: consolidate initcall sections 2006-10-29 12:07:41 -08:00
m68knommu [PATCH] m68knommu: fix up for the irq_handler_t changes 2006-11-20 10:16:49 -08:00
mips [MIPS] Fix EV64120 and Ocelot builds by providing a plat_timer_setup(). 2006-11-06 20:55:39 +00:00
parisc [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
powerpc [POWERPC] Fix ucc_geth of_device discovery on mpc832x 2006-11-22 13:28:21 +11:00
ppc [POWERPC] Make alignment exception always check exception table 2006-11-01 15:16:04 +11:00
s390 [S390] IRQs too early enabled. 2006-11-06 10:49:02 +01:00
sh sh: Titan defconfig update. 2006-10-31 12:53:29 +09:00
sh64 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
sparc [SPARC]: Fix robust futex syscalls and wire up migrate_pages. 2006-11-05 16:51:03 -08:00
sparc64 [SPARC]: Fix robust futex syscalls and wire up migrate_pages. 2006-11-05 16:51:03 -08:00
um [PATCH] uml: include tidying 2006-11-03 12:27:59 -08:00
v850 [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
x86_64 WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
xtensa [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00