lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48FFCF28.3070604@linux.intel.com>
Date:	Thu, 23 Oct 2008 03:11:04 +0200
From:	Andi Kleen <ak@...ux.intel.com>
To:	Venki Pallipadi <venkatesh.pallipadi@...el.com>
CC:	Len Brown <lenb@...nel.org>, Ingo Molnar <mingo@...e.hu>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"Henroid, Andrew D" <andrew.d.henroid@...el.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, paulmck@...ibm.com
Subject: Re: [PATCH 2/2] i7300_idle driver v1.55

Venki Pallipadi wrote:
> On Wed, Oct 22, 2008 at 12:19:22AM -0700, Andi Kleen wrote:
>> Pallipadi, Venkatesh wrote:
>>> udelay may be more power efficient than polling.
>> Isn't that function a one off anyways?
> 
> Which function is one off?

The one with the udelays, as in being init code. Or maybe I misread
the code.

>>>> ;
>>>>> +static void __exit i7300_idle_exit(void)
>>>>> +{
>>>>> +     idle_notifier_unregister(&i7300_idle_nb);
>>>> I still think this needs some kind of idle synchronization.
>>> This unregister uses atomic_notifier_chain_unregister() which
>>> uses RCU and handles the race conditions that way.
>> I didn't do a full analysis, but I didn't think RCU protects
>> against the idle handler itself.  At least not standard RCU.
>> You would need to go through at least two quiescent periods,
>> not one as standard code.
>>
>> There used to be an older
>> idle synchronization interface for this case (which was removed
>> at some point), perhaps it needs to be readded.
>>
>> Or just use stop_machine(). That protects against idle too
>> and while it's a big hammer for unloading it should be ok.
>>
> 
> stop_machine() for unregistering idle callback will deadlock due to RCU.
> 
> I am not sure why we need two cycles. RCU in the unregister makes
> sure that no CPU is executing the callback handler 
> and only then unregister
> returns. So, that will mean no one can be in the callback rountine and we are
> safe to remove the module. Correct?

Perhaps I'm confused, but I thought with noidlehz the RCU code
got changed to take out idle CPUs out of the rcu masks. This makes
normally sense because you don't want to delay the grace period
for potentially very long sleeping CPUs.

But it means it won't work for code inside the idle loop. Ok maybe
if you're very careful with the ordering, but I'm not sure that's
the case currently.

Yes two cycles won't work either, sorry was confused earlier,
because even the second cycle wouldn't force the CPU out of idle.

The old idle sync code was more a thread that just cycled through
all the CPus. That would work.

cc Paul

-Andi

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ