* [PATCH] cpuset - fix return without releasing semaphore
@ 2005-11-12 2:20 bob.picco
2005-11-12 18:17 ` Paul Jackson
2005-11-12 19:26 ` Paul Jackson
0 siblings, 2 replies; 3+ messages in thread
From: bob.picco @ 2005-11-12 2:20 UTC (permalink / raw)
To: akpm; +Cc: pj, simon.derr, linux-kernel, bob.picco
It seems wrong to acquire the semaphore and then return from
cpuset_zone_allowed without releasing it. This was only compile tested.
bob
Signed-off-by: Bob Picco <bob.picco@hp.com>
kernel/cpuset.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6.14-mm1/kernel/cpuset.c
===================================================================
--- linux-2.6.14-mm1.orig/kernel/cpuset.c 2005-11-07 07:00:13.000000000 -0500
+++ linux-2.6.14-mm1/kernel/cpuset.c 2005-11-09 17:56:28.000000000 -0500
@@ -2036,11 +2036,12 @@ int cpuset_zone_allowed(struct zone *z,
if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */
return 0;
+ if (current->flags & PF_EXITING) /* Let dying task have memory */
+ return 1;
+
/* Not hardwall and node outside mems_allowed: scan up cpusets */
down(&callback_sem);
- if (current->flags & PF_EXITING) /* Let dying task have memory */
- return 1;
task_lock(current);
cs = nearest_exclusive_ancestor(current->cpuset);
task_unlock(current);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpuset - fix return without releasing semaphore
2005-11-12 2:20 [PATCH] cpuset - fix return without releasing semaphore bob.picco
@ 2005-11-12 18:17 ` Paul Jackson
2005-11-12 19:26 ` Paul Jackson
1 sibling, 0 replies; 3+ messages in thread
From: Paul Jackson @ 2005-11-12 18:17 UTC (permalink / raw)
To: bob.picco; +Cc: akpm, simon.derr, linux-kernel, bob.picco
Bob wrote:
> It seems wrong to acquire the semaphore and then return from
> cpuset_zone_allowed without releasing it. This was only compile tested.
Acked-by: Paul Jackson <pj@sgi.com>
Nice catch, Bob. Thanks.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpuset - fix return without releasing semaphore
2005-11-12 2:20 [PATCH] cpuset - fix return without releasing semaphore bob.picco
2005-11-12 18:17 ` Paul Jackson
@ 2005-11-12 19:26 ` Paul Jackson
1 sibling, 0 replies; 3+ messages in thread
From: Paul Jackson @ 2005-11-12 19:26 UTC (permalink / raw)
To: bob.picco; +Cc: akpm, simon.derr, linux-kernel, bob.picco
> This was only compile tested.
I boot, function and stress tested it on an ia64 SN2 system.
As expected, works fine, just as it did before.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-12 19:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-12 2:20 [PATCH] cpuset - fix return without releasing semaphore bob.picco
2005-11-12 18:17 ` Paul Jackson
2005-11-12 19:26 ` Paul Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox