Re: race condition in schedule_on_each_cpu()

2013-06-08 Thread we...@kylinos.com.cn
Hello Tejun Heo, I've backported the schedule_on_each_cpu() "direct excution" patch on 3.0.30-rt50, and It fixed my problem. attachment is the effective patch. However, I do not understand why machine1 can expose problem, but machine2 not. I guess, because it's rt-kernel's preempt

Re: race condition in schedule_on_each_cpu()

2013-06-08 Thread we...@kylinos.com.cn
Hello Tejun Heo, I've backported the schedule_on_each_cpu() direct excution patch on 3.0.30-rt50, and It fixed my problem. attachment is the effective patch. However, I do not understand why machine1 can expose problem, but machine2 not. I guess, because it's rt-kernel's preempt

Re: race condition in schedule_on_each_cpu()

2013-06-07 Thread Tejun Heo
On Fri, Jun 07, 2013 at 10:24:50AM +0800, we...@kylinos.com.cn wrote: > >Before the commit you originally quoted, the calling thread could be > preempted and migrated to another CPU before get_online_cpus() thus > ending up executing the function twice on the new cpu but skipping the > old one. >

Re: race condition in schedule_on_each_cpu()

2013-06-07 Thread Tejun Heo
On Fri, Jun 07, 2013 at 10:24:50AM +0800, we...@kylinos.com.cn wrote: Before the commit you originally quoted, the calling thread could be preempted and migrated to another CPU before get_online_cpus() thus ending up executing the function twice on the new cpu but skipping the old one. does

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread we...@kylinos.com.cn
In the previous message,You mentioned: by the way, I'm wondering about what's the race condition before which doesn't exist now Before the commit you originally quoted, the calling thread could be preempted and migrated to another CPU before get_online_cpus() thus ending up executing

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread we...@kylinos.com.cn
it's preemption mode related , on the 3.0.30-rt50, only config kernel with highest preemption level (Fully Preemptible Kernel (RT)) in cpu preemption model will cause problem and even i use the "Preemptible Kernel" or "Preemptible Kernel (Low-Latency Desktop)" the problem would not

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread Tejun Heo
Hello, On Thu, Jun 06, 2013 at 06:14:46PM +0800, 韦奇 wrote: > Hello, Tejun Heo > thanks for your help, > 1) I've test the two kernel version on this problem: > latest > 3.10-rc3:(https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc3.tar.xz) > latest 3.0branch - >

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread Tejun Heo
Hello, On Thu, Jun 06, 2013 at 06:14:46PM +0800, 韦奇 wrote: Hello, Tejun Heo thanks for your help, 1) I've test the two kernel version on this problem: latest 3.10-rc3:(https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc3.tar.xz) latest 3.0branch -

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread we...@kylinos.com.cn
it's preemption mode related , on the 3.0.30-rt50, only config kernel with highest preemption level (Fully Preemptible Kernel (RT)) in cpu preemption model will cause problem and even i use the Preemptible Kernel or Preemptible Kernel (Low-Latency Desktop) the problem would not happen..

Re: race condition in schedule_on_each_cpu()

2013-06-06 Thread we...@kylinos.com.cn
In the previous message,You mentioned: by the way, I'm wondering about what's the race condition before which doesn't exist now Before the commit you originally quoted, the calling thread could be preempted and migrated to another CPU before get_online_cpus() thus ending up executing

Re: race condition in schedule_on_each_cpu()

2013-05-30 Thread Tejun Heo
On Fri, May 31, 2013 at 12:07:15PM +0800, we...@kylinos.com.cn wrote: > > >the only way for them to get stuck is if there aren't enough execution > >resources (ie. if a new thread can't be created) but OOM killers would > >have been activated if that were the case. > > The following is a

Re: race condition in schedule_on_each_cpu()

2013-05-30 Thread Tejun Heo
On Fri, May 31, 2013 at 12:07:15PM +0800, we...@kylinos.com.cn wrote: the only way for them to get stuck is if there aren't enough execution resources (ie. if a new thread can't be created) but OOM killers would have been activated if that were the case. The following is a detailed