Re: [PATCH] stopmachine: add stopmachine_timeout

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rusty Russell
Date: Tuesday, July 15, 2008 - 12:50 am

On Tuesday 15 July 2008 11:11:34 Hidetoshi Seto wrote:

Hi Hidetoshi,


OK, if you are worried about that race, I think we can still fix it...


What if we use:
	if (i != smp_processor_id() && !cpu_test_and_set(i, prepared_cpus)) {

instead of cpu_isset?  That means that if a CPU restarts during that window, 
either the thread will exit (because we set the bit here), or this will 
detect it.

Hmm, there's still the vague possibility that the thread doesn't schedule 
until we start a new stop_machine (and clear prepared_cpus).  We could simply 
loop in the main thread if any threads are alive, before freeing them (inside 
the lock).  A counter and notifier is the other way, but it seems like 
overkill for a very unlikely event.

Thanks for the analysis!
Rusty.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] stopmachine: add stopmachine_timeout, Hidetoshi Seto, (Mon Jul 14, 12:52 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Hidetoshi Seto, (Mon Jul 14, 1:19 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Mon Jul 14, 3:43 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Christian Borntraeger, (Mon Jul 14, 4:51 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Mon Jul 14, 5:34 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Jeremy Fitzhardinge, (Mon Jul 14, 11:56 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Heiko Carstens, (Mon Jul 14, 2:20 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Hidetoshi Seto, (Mon Jul 14, 6:11 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Mon Jul 14, 6:14 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Hidetoshi Seto, (Mon Jul 14, 7:24 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Max Krasnyansky, (Mon Jul 14, 7:24 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Max Krasnyansky, (Mon Jul 14, 7:37 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Heiko Carstens, (Mon Jul 14, 11:09 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Tue Jul 15, 12:50 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Tue Jul 15, 1:09 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Heiko Carstens, (Tue Jul 15, 1:39 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Max Krasnyansky, (Tue Jul 15, 1:51 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Hidetoshi Seto, (Tue Jul 15, 9:05 pm)
[PATCH] stopmachine: add stopmachine_timeout v2, Hidetoshi Seto, (Tue Jul 15, 9:27 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Max Krasnyansky, (Tue Jul 15, 11:23 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Hidetoshi Seto, (Tue Jul 15, 11:35 pm)
[PATCH] stopmachine: add stopmachine_timeout v3, Hidetoshi Seto, (Tue Jul 15, 11:51 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout v3, Peter Zijlstra, (Wed Jul 16, 12:33 am)
Re: [PATCH] stopmachine: add stopmachine_timeout v3, Hidetoshi Seto, (Wed Jul 16, 1:12 am)
Re: [PATCH] stopmachine: add stopmachine_timeout, Christian Borntraeger, (Wed Jul 16, 2:15 am)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Jeremy Fitzhardinge, (Wed Jul 16, 3:11 am)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Hidetoshi Seto, (Wed Jul 16, 8:40 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Jeremy Fitzhardinge, (Wed Jul 16, 10:37 pm)
[PATCH] stopmachine: add stopmachine_timeout v4, Hidetoshi Seto, (Wed Jul 16, 11:12 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout v4, Max Krasnyansky, (Thu Jul 17, 12:09 am)
Re: [PATCH] stopmachine: add stopmachine_timeout v2, Rusty Russell, (Thu Jul 17, 9:18 pm)
Re: [PATCH] stopmachine: add stopmachine_timeout, Rusty Russell, (Sun Jul 20, 2:45 am)
[PATCH] stopmachine: allow force progress on timeout, Hidetoshi Seto, (Mon Jul 21, 8:28 pm)