https://github.com/torvalds/linux
Revision ce96b5ac742801718ae86d2adf0500c5abef3782 authored by Dmitry Adamushko on 15 November 2007, 19:57:40 UTC, committed by Ingo Molnar on 15 November 2007, 19:57:40 UTC
Grant Wilson has reported rare SCHED_FAIR_USER crashes on his quad-core
system, which crashes can only be explained via runqueue corruption.

there is a narrow SMP race in __set_task_cpu(): after ->cpu is set up to
a new value, task_rq_lock(p, ...) can be successfuly executed on another
CPU. We must ensure that updates of per-task data have been completed by
this moment.

this bug has been hiding in the Linux scheduler for an eternity (we never
had any explicit barrier for task->cpu in set_task_cpu() - so the bug was
introduced in 2.5.1), but only became visible via set_task_cfs_rq() being
accidentally put after the task->cpu update. It also probably needs a
sufficiently out-of-order CPU to trigger.

Reported-by: Grant Wilson <grant.wilson@zen.co.uk>
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent dae51f5
History
Tip revision: ce96b5ac742801718ae86d2adf0500c5abef3782 authored by Dmitry Adamushko on 15 November 2007, 19:57:40 UTC
sched: fix __set_task_cpu() SMP race
Tip revision: ce96b5a
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
.gitignore -rw-r--r-- 628 bytes
.mailmap -rw-r--r-- 3.6 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 90.1 KB
Kbuild -rw-r--r-- 1.6 KB
MAINTAINERS -rw-r--r-- 93.2 KB
Makefile -rw-r--r-- 52.2 KB
README -rw-r--r-- 16.7 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top