summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/preempt.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-09-23 19:04:26 +0200
committerIngo Molnar <mingo@kernel.org>2013-09-25 14:07:55 +0200
commita233f1120c37724938f7201fe2353b2577adaaf9 (patch)
tree9d7b0887b3398a1fc699ea557822c891bf9c450d /include/asm-generic/preempt.h
parentbdb43806589096ac4272fe1307e789846ac08d7c (diff)
sched: Prepare for per-cpu preempt_count
When using per-cpu preempt_count variables we need to save/restore the preempt_count on context switch (into per task storage; for instance the old thread_info::preempt_count variable) because of PREEMPT_ACTIVE. However, this means that on fork() the preempt_count value of the last context switch gets copied and if we had a PREEMPT_ACTIVE switch right before cloning a child task the child task will now too have PREEMPT_ACTIVE set and start its life with an extra PREEMPT_ACTIVE count. Therefore we need to make init_task_preempt_count() unconditional; this resets whatever preempt_count we inherited from our parent process. Doing so for !per-cpu implementations is harmless. For !PREEMPT_COUNT kernels we need to be careful not to start life with an increased preempt_count. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-4k0b7oy1rcdyzochwiixuwi9@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/asm-generic/preempt.h')
0 files changed, 0 insertions, 0 deletions