kernel-ark/include
Andrew Morton 498d0c5711 [PATCH] set_current_state() commentary
Explain the mysteries of set_current_state().

Quoth Linus:

 The scheduler itself never needs the memory barrier at all.

 The barrier is needed only if the user itself ends up testing some other
 thing afterwards, ie if you have

 	set_process_state(TASK_INTERRUPTIBLE);
 	if (still_need_to_sleep())
 		schedule();

 then the "still_need_to_sleep()" thing may test flags and wakeup events,
 and then you _may_ want to (and often do) make sure that the write of
 TASK_INTERRUPTIBLE is serialized wrt the reads of any wakeup data (since
 the wakeup may have happened on another CPU).

 So the comment is somewhat wrong. We don't really _care_ whether the state
 propagates out to other CPU's since all of our actions are purely local,
 and there is nothing we do that is conditional on any other CPU: we're
 going to sleep unconditionally, and the scheduler only cares about _our_
 state, not about somebody elses state.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-13 08:22:29 -07:00
..
acpi
asm-alpha
asm-arm
asm-arm26
asm-cris
asm-frv
asm-generic
asm-h8300
asm-i386 [PATCH] x86-64: i386/x86-64: Fix time going twice as fast problem on ATI Xpress chipsets 2005-09-12 10:50:58 -07:00
asm-ia64
asm-m32r
asm-m68k
asm-m68knommu [PATCH] m68knommu: optimized local_irq_disable, and platform reboot code 2005-09-12 20:04:15 -07:00
asm-mips
asm-parisc
asm-powerpc
asm-ppc [PATCH] ppc32: remove use of asm/segment.h 2005-09-13 08:22:28 -07:00
asm-ppc64
asm-s390
asm-sh
asm-sh64
asm-sparc
asm-sparc64
asm-um
asm-v850
asm-x86_64 [PATCH] x86-64: clean up local_add/sub arguments 2005-09-12 10:50:59 -07:00
asm-xtensa
linux [PATCH] set_current_state() commentary 2005-09-13 08:22:29 -07:00
math-emu
media
mtd
net [NETROM]: Introduct stuct nr_private 2005-09-12 14:28:03 -07:00
pcmcia
rdma
rxrpc
scsi
sound
video