From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"mm-commits@vger.kernel.org" <mm-commits@vger.kernel.org>,
"jens.axboe@oracle.com" <jens.axboe@oracle.com>,
"mingo@elte.hu" <mingo@elte.hu>,
"nickpiggin@yahoo.com.au" <nickpiggin@yahoo.com.au>,
"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: + generic-ipi-fix-the-race-between-generic_smp_call_function_-and-hotplug_cfd.patch added to -mm tree
Date: Tue, 22 Sep 2009 14:52:47 +0800 [thread overview]
Message-ID: <4AB8743F.5080309@cn.fujitsu.com> (raw)
In-Reply-To: <1253597553.2519.8.camel@sbs-t61>
Suresh Siddha wrote:
> On Sun, 2009-09-20 at 21:04 -0700, Xiao Guangrong wrote:
>> Suresh Siddha wrote:
>>> I am referring to the missing csd_lock_wait() here that you had in the
>>> first version of your patch. Let's say, if cpu X is going offline, we
>>> need to ensure that the smp_call_function() initiated by cpu X (i.e.,
>>> smp_call_function IPI sent to some other cpu's from cpu X) got serviced
>>> before cpu X goes offline. We can't do csd_lock_wait() here, as that
>>> might deadlock (as all the other cpu's are already in stop machine with
>>> interrupts disabled).
>>>
>> It not happen because the preemption is disabled while send IPI request and
>> can't schedule to stop machine path, it also stop cpu down.
>
> Xiao, I am getting confused. I am referring to case '1' mentioned by you
> here http://marc.info/?l=linux-kernel&m=125265516529139&w=2
>
Ah, your meaning is that we can't do csd_lock_wait() in the CPU_DEAD
notification path in my first version patch? like below:
+static int
+hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
...
+
+#ifdef CONFIG_HOTPLUG_CPU
+ case CPU_UP_CANCELED:
+ case CPU_UP_CANCELED_FROZEN:
+
+ case CPU_DEAD:
+ case CPU_DEAD_FROZEN:
+ local_irq_save(flags);
+ __generic_smp_call_function_interrupt(cpu, 0);
+ __generic_smp_call_function_single_interrupt(cpu, 0);
+ local_irq_restore(flags);
+
/* Do you mean we can't do csd_lock_wait() here??? */
+ csd_lock_wait(&cfd->csd);
+ free_cpumask_var(cfd->cpumask);
+ break;
+#endif
+ };
+
+ return NOTIFY_OK;
+}
The CPU_DEAD notification is not sent in stop machine path, you can
see _cpu_down() function in kernel/cpu.c
Suresh, If I misunderstand your words again, could your elaborate it?
My first version patch is not clean and not complete that you point out in
previous mail:
" I am referring to this latest patch only. We are calling the interrupt
handler manually and not doing the callbacks in that context. In future,
we might see other side affects if we miss some of these smp ipi's."
How about the second patch?
Thanks,
Xiao
next prev parent reply other threads:[~2009-09-22 6:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-31 0:30 + generic-ipi-fix-the-race-between-generic_smp_call_function_-and-hotplug_cfd.patch added to -mm tree akpm
[not found] ` <1252616988.7205.102.camel@laptop>
2009-09-11 7:45 ` Xiao Guangrong
2009-09-11 7:50 ` Peter Zijlstra
2009-09-11 19:08 ` Suresh Siddha
2009-09-14 7:22 ` Xiao Guangrong
2009-09-15 0:16 ` Suresh Siddha
2009-09-15 2:03 ` Xiao Guangrong
2009-09-16 2:20 ` Suresh Siddha
2009-09-17 3:00 ` Xiao Guangrong
2009-09-17 7:45 ` Peter Zijlstra
2009-09-19 2:16 ` Suresh Siddha
2009-09-21 2:55 ` Xiao Guangrong
2009-09-21 3:11 ` Suresh Siddha
2009-09-21 4:04 ` Xiao Guangrong
2009-09-22 5:32 ` Suresh Siddha
2009-09-22 6:52 ` Xiao Guangrong [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-07-29 23:31 akpm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AB8743F.5080309@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mm-commits@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=suresh.b.siddha@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.