diff options
author | Paul Jackson <pj@sgi.com> | 2006-05-20 18:00:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-21 15:59:18 -0400 |
commit | 92d1dbd27417c54c23aac6a84c285e256f6118b6 (patch) | |
tree | bab665935a47bb6889ddc3c92a9bee68f1f6f532 /kernel/cpuset.c | |
parent | 36be57ffe39e03aab9fbe857f70c7a6a15bd9e08 (diff) |
[PATCH] cpuset: might_sleep_if check in cpuset_zones_allowed
It's too easy to incorrectly call cpuset_zone_allowed() in an atomic
context without __GFP_HARDWALL set, and when done, it is not noticed until
a tight memory situation forces allocations to be tried outside the current
cpuset.
Add a 'might_sleep_if()' check, to catch this earlier on, instead of
waiting for a similar check in the mutex_lock() code, which is only rarely
invoked.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 57fd88237afc..ab81fdd4572b 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -2261,6 +2261,7 @@ int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) | |||
2261 | if (in_interrupt()) | 2261 | if (in_interrupt()) |
2262 | return 1; | 2262 | return 1; |
2263 | node = z->zone_pgdat->node_id; | 2263 | node = z->zone_pgdat->node_id; |
2264 | might_sleep_if(!(gfp_mask & __GFP_HARDWALL)); | ||
2264 | if (node_isset(node, current->mems_allowed)) | 2265 | if (node_isset(node, current->mems_allowed)) |
2265 | return 1; | 2266 | return 1; |
2266 | if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ | 2267 | if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ |