Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Sunday, October 21, 2007 - 5:47 am

On 10/17, Gautham R Shenoy wrote:

I don't understand why should we re-initialize the completion too,
but see below.


Why?


No, because we decrement the ->done count only once, but there is no
guarantee that ->done == 1 when we get CPU after wakeup. Another reader
can do lock_cpu_hotplug/unlock_cpu_hotplug in between, so we have a race.

But I disagree with "Yet once a completion is completed, it needs to be
re-initialized to be reused: it's "complete" and wait_for_completion
will return immediately thereafter".

Rusty, could you please clarify?

Side note, we don't block the new readers while cpu_hotplug_begin() waits
for the completion. I don't think this is a problem, but perhaps it makes
sense to document the possible livelock.

Oleg.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Gautham R Shenoy, (Tue Oct 16, 3:33 am)
[RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Tue Oct 16, 3:34 am)
[RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Gautham R Shenoy, (Tue Oct 16, 3:35 am)
[RFC PATCH 4/4] Remove CPU_DEAD/CPU_UP_CANCELLED handling ..., Gautham R Shenoy, (Tue Oct 16, 3:37 am)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Linus Torvalds, (Tue Oct 16, 10:20 am)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Dipankar Sarma, (Tue Oct 16, 7:11 pm)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Linus Torvalds, (Tue Oct 16, 7:23 pm)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Gautham R Shenoy, (Tue Oct 16, 9:17 pm)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Tue Oct 16, 10:37 pm)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Wed Oct 17, 4:50 am)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Wed Oct 17, 11:29 pm)
Re: [RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Gautham R Shenoy, (Thu Oct 18, 12:57 am)
Re: [RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Gautham R Shenoy, (Thu Oct 18, 10:04 pm)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Oleg Nesterov, (Sun Oct 21, 5:47 am)