[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1392324808.17215.13.camel@misato.fc.hp.com>
Date: Thu, 13 Feb 2014 13:53:28 -0700
From: Toshi Kani <toshi.kani@...com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc: "ego@...ux.vnet.ibm.com" <ego@...ux.vnet.ibm.com>,
"paulus@...ba.org" <paulus@...ba.org>,
"oleg@...hat.com" <oleg@...hat.com>,
"rusty@...tcorp.com.au" <rusty@...tcorp.com.au>,
"peterz@...radead.org" <peterz@...radead.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"mingo@...nel.org" <mingo@...nel.org>,
"paulmck@...ux.vnet.ibm.com" <paulmck@...ux.vnet.ibm.com>,
"tj@...nel.org" <tj@...nel.org>,
"walken@...gle.com" <walken@...gle.com>,
"linux@....linux.org.uk" <linux@....linux.org.uk>,
"linux-kernel@...r.kernel.org" <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 Thu, 2014-02-13 at 10:56 +0000, Srivatsa S. Bhat wrote:
> On 02/12/2014 11:48 AM, Srivatsa S. Bhat wrote:
:
> >>> For example, something like the code snippet shown below looks pretty
> >>> neat to me:
> >>>
> >>> cpu_notifier_register_begin();
> >>>
> >>> for_each_online_cpu(cpu)
> >>> init_cpu(cpu);
> >>>
> >>> register_cpu_notifier(&foobar_cpu_notifier);
> >>>
> >>> cpu_notifier_register_done();
> >>>
> >>> What do you think?
> >>
> >> I agree that it is cleaner for the callers as long as people understand
> >> how to use them. Can you document them properly so that they know when
> >> they need to use them instead of the familiar get/put_online_cpus()?
> >>
> >
> > Sure.. I had updated the documentation with the semantics introduced in
> > this patchset, in patch 2:
> >
> > http://thread.gmane.org/gmane.linux.kernel/1641638/focus=1641695
> >
> > Similarly I'll keep the docs updated with these new APIs in v2 as well.
> >
>
> For now, however, let us not add the new rw-semaphore to the CPU hotplug
> core yet. Its very unlikely that we'll see any performance issue immediately,
> due to serialized initialization of cpu hotplug notifiers, since early boot
> is mostly sequential anyway.
>
> Some time in the future, if we start hitting bottlenecks in the cpu hotplug
> notifier registration phase (perhaps when we implement parallel CPU boot-up
> infrastructure), then we can directly use the rw-semaphore solution, since
> we have already worked it out. Besides, like Gautham said, we might want
> to be more careful and have a very good justification before adding more
> locks to the CPU hotplug core code. So we'll add the new rw-sempahore if
> and when it becomes necessary.
>
> I'll post the v2 with the earlier design itself, by adding the new symbols
> cpu_notifier_register_begin/done() (to enhance the readability) and map
> them to cpu_maps_update_begin/done().
Sounds reasonable to me. I was also concerned about exporting and
overloading cpu_maps_update_begin/done() for a different purpose (their
purpose is to update cpu_maps). So, I think adding the new interfaces
is good when we cannot use get/set_online_cpus() for this.
Thanks,
-Toshi
--
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