[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140211171553.GA26036@redhat.com>
Date: Tue, 11 Feb 2014 18:15:53 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc: Toshi Kani <toshi.kani@...com>, paulus@...ba.org,
rusty@...tcorp.com.au, peterz@...radead.org, tglx@...utronix.de,
akpm@...ux-foundation.org, mingo@...nel.org,
paulmck@...ux.vnet.ibm.com, tj@...nel.org, walken@...gle.com,
ego@...ux.vnet.ibm.com, linux@....linux.org.uk,
linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Subject: Re: [PATCH 01/51] CPU hotplug: Provide lockless versions of
callback registration functions
On 02/11, Srivatsa S. Bhat wrote:
>
> +static DECLARE_RWSEM(cpu_hotplug_rwsem);
> +
> +void cpu_notifier_register_begin(void)
> +{
> + down_read(&cpu_hotplug_rwsem);
> +}
> +
> +void cpu_notifier_register_end(void)
> +{
> + up_read(&cpu_hotplug_rwsem);
> +}
> +
> /* Serializes the updates to cpu_online_mask, cpu_present_mask */
> static DEFINE_MUTEX(cpu_add_remove_lock);
>
> @@ -32,12 +45,14 @@ static DEFINE_MUTEX(cpu_add_remove_lock);
> */
> void cpu_maps_update_begin(void)
> {
> + down_write(&cpu_hotplug_rwsem);
> mutex_lock(&cpu_add_remove_lock);
> }
>
> void cpu_maps_update_done(void)
> {
> mutex_unlock(&cpu_add_remove_lock);
> + up_write(&cpu_hotplug_rwsem);
> }
I am a bit confused... If we do this, why we can't simply turn
cpu_add_remove_lock into rw_semaphore?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists