aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-10-16 15:03:14 -0700
committerBen Hutchings <ben@decadent.org.uk>2013-01-03 03:32:56 +0000
commit26e5f795726ed11feff7125d727377a3eb231403 (patch)
tree7bb02f0743bdb348904ddb4de934b38af4e1a3b8 /mm
parentbd8320996b15f292e80501b4cf5de133546d1cbf (diff)
freezer: add missing mb's to freezer_count() and freezer_should_skip()
commit dd67d32dbc5de299d70cc9e10c6c1e29ffa56b92 upstream. A task is considered frozen enough between freezer_do_not_count() and freezer_count() and freezers use freezer_should_skip() to test this condition. This supposedly works because freezer_count() always calls try_to_freezer() after clearing %PF_FREEZER_SKIP. However, there currently is nothing which guarantees that freezer_count() sees %true freezing() after clearing %PF_FREEZER_SKIP when freezing is in progress, and vice-versa. A task can escape the freezing condition in effect by freezer_count() seeing !freezing() and freezer_should_skip() seeing %PF_FREEZER_SKIP. This patch adds smp_mb()'s to freezer_count() and freezer_should_skip() such that either %true freezing() is visible to freezer_count() or !PF_FREEZER_SKIP is visible to freezer_should_skip(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Rafael J. Wysocki <rjw@sisk.pl> [bwh: Backported to 3.2: - Adjust context and indentation - freezer_do_not_count() and freezer_count() are no-ops for kernel tasks] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions