Re: [RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Gautham R Shenoy <ego@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, Srivatsa Vaddagiri <vatsa@...>, Rusty Russel <rusty@...>, Dipankar Sarma <dipankar@...>, Oleg Nesterov <oleg@...>, Ingo Molnar <mingo@...>, Paul E McKenney <paulmck@...>
Date: Sunday, October 21, 2007 - 8:43 pm

Gautham R Shenoy wrote:

Other arch code e.g. ia64 changes it for add/remove also.  But I fail
to see how it matters.



That would be needless complexity.



cpu_present_map isn't a "local data structure" any more than
cpu_online_map, and it is quite relevant to cpu hotplug.  We have to
maintain the invariant that the set of cpus online is a subset of cpus
present.


I don't feel like I'm getting through here.  Let me restate.

If I'm reading them correctly, these patches are changing the behavior
of lock_cpu_hotplug() from mutex-style locking to a kind of read-write
locking.  I think that's fine, but the naming of the new API poorly
reflects its real behavior.  Conversion of lock_cpu_hotplug() users
should be done with care.  Most of them - those that need one of the
cpu maps to remain unchanged during a critical section - can be
considered readers.  But a few (such as pseries_add_processor() and
pseries_remove_processor()) are writers, because they modify one of
the maps.

So, why not:

get_cpus_online   -> cpumaps_read_lock
put_cpus_online   -> cpumaps_read_unlock
cpu_hotplug_begin -> cpumaps_write_lock
cpu_hotplug_end   -> cpumaps_write_unlock

Or something similar?
-
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, 6:33 am)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Linus Torvalds, (Tue Oct 16, 1:20 pm)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Dipankar Sarma, (Tue Oct 16, 10:11 pm)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Linus Torvalds, (Tue Oct 16, 10:23 pm)
Re: [RFC PATCH 0/4] Refcount Based Cpu-Hotplug Revisit., Gautham R Shenoy, (Wed Oct 17, 12:17 am)
Re: [RFC PATCH 3/4] Replace per-subsystem mutexes with get_o..., Gautham R Shenoy, (Mon Oct 22, 12:58 am)
[RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Gautham R Shenoy, (Tue Oct 16, 6:35 am)
Re: [RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Nathan Lynch, (Sun Oct 21, 8:43 pm)
Re: [RFC PATCH 2/4] Rename lock_cpu_hotplug to get_online_cpus, Gautham R Shenoy, (Mon Oct 22, 12:51 am)
[RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Tue Oct 16, 6:34 am)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Wed Oct 17, 7:50 am)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Wed Oct 17, 1:37 am)
Re: [RFC PATCH 1/4] Refcount Based Cpu-Hotplug Implementation, Gautham R Shenoy, (Thu Oct 18, 2:29 am)