[PATCH v2] E500 Make steal_context SMP-safe.

Kumar Gala galak at kernel.crashing.org
Fri Apr 11 01:31:08 EST 2008


On Apr 3, 2008, at 11:46 AM, Randy Vinson wrote:
> When steal_context is used on SMP systems, it can steal a context in
> use by one of the other processors. This patch adds context tracking  
> to
> prevent this as suggested by BenH.

Can we be more descriptive in the problem/bug symptom in the  
description.

otherwise this looks ok to me.  I'd like BenH to ack as well since  
he's been look at this code recently.

>
> Signed-off-by: Randy Vinson <rvinson at mvista.com>
> ---
> The previous version of this patch had some unnecessary code which  
> has been
> removed in this version.
>
> Note: This is a proof-of-concept patch. This isn't my area of  
> expertise,
> so I'd greatly appreciate any guidance I can get. I'm considering the
> use of for_each_online_cpu() instead of for_each_possible_cpu() and
> possibly putting the changes under a CONFIG_SMP switch to prevent  
> unnecessary
> overhead in the non-SMP case.

for_each_online_cpu() is probably better.  I'm guessing this optimizes  
pretty well in the !CONFIG_SMP case.

- k



More information about the Linuxppc-dev mailing list