[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52E7BF6E.4000509@linux.vnet.ibm.com>
Date: Tue, 28 Jan 2014 20:02:14 +0530
From: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
CC: Paul Mackerras <paulus@...ba.org>, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...nel.org>, Tejun Heo <tj@...nel.org>,
Michel Lespinasse <walken@...gle.com>, ego@...ux.vnet.ibm.com,
"rusty@...tcorp.com.au" <rusty@...tcorp.com.au>,
Thomas Gleixner <tglx@...utronix.de>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: Deadlock between cpu_hotplug_begin and cpu_add_remove_lock
On 01/23/2014 10:32 PM, Oleg Nesterov wrote:
> On 01/23, Srivatsa S. Bhat wrote:
>>
>> On 01/23/2014 12:48 AM, Oleg Nesterov wrote:
>>> On 01/22, Srivatsa S. Bhat wrote:
>>>>
>>>> Wait a min, that _will_ actually work for all cases because I have provided
>>>> an option to invoke _any_ arbitrary function as the "setup" routine.
>>>
>>> And probably the generic solution makes sense. I am not sure I actually
>>> understand the semantics of register_allcpu_notifier(), but the problem
>>> it tries to solve looks clear/valid.
>>>
>>
>> Thank you. But I was wondering whether its usage is a bit unintuitive/
>> convoluted. So I was contemplating between going with that solution or the
>> below one, where the call-sites are expected to do:
>>
>> cpu_maps_update_begin();
>> for_each_online_cpu(cpu) {
>> ...
>> }
>> __register_cpu_notifier(); //use the __reg() variant, which doesn't take locks
>> cpu_maps_update_done();
>>
>> Of course, that requires exporting the functions cpu_maps_update_begin/done(),
>> but this latter form of callback registration might look more natural.
>
> Yes, I thought about this too ;)
>
>> But for some of the other call-sites, we might have to use one
>> of the solutions mentioned above.
>
> Yes, yes, sure, I agree.
>
> I suggested this change only for discussion, for the case we need
> an "urgent" fix without changes outside of drivers/md/. The generic
> solution is better.
>
Ok :) But your fix for drivers/md/ also makes the code look much neater.
So I'll include your patch in my series and convert the rest of the call-
sites using the generic solution.
Thank you!
Regards,
Srivatsa S. Bhat
--
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