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: <CALCETrWW15tK8eYr74OhKfWTxWn3xj4C5moyLP_TFxN3DaVcng@mail.gmail.com>
Date:	Wed, 4 Jun 2014 07:58:52 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Mike Galbraith <umgwanakikbuti@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>, nicolas.pitre@...aro.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/6] sched,idle: Clarify where TIF_NRFLAG_POLLING is set

On Wed, Jun 4, 2014 at 6:03 AM, Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
> On 06/04/2014 02:29 AM, Andy Lutomirski wrote:
>>
>> This doesn't change functionality at all, but I've misread this code
>> so many times that I want to make it a bit more obvious.
>>
>> Signed-off-by: Andy Lutomirski <luto@...capital.net>
>> ---
>>   kernel/sched/idle.c | 12 +++++++++++-
>>   1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
>> index 25b9423..2ec9f47 100644
>> --- a/kernel/sched/idle.c
>> +++ b/kernel/sched/idle.c
>> @@ -67,6 +67,10 @@ void __weak arch_cpu_idle(void)
>>    * cpuidle_idle_call - the main idle function
>>    *
>>    * NOTE: no locks or semaphores should be used here
>> + *
>> + * On archs that support TIF_POLLING_NRFLAG, is called with polling
>> + * set, and it returns with polling set.  If it ever stops polling, it
>> + * must clear the polling bit.
>>    */
>>   static void cpuidle_idle_call(void)
>>   {
>> @@ -178,7 +182,14 @@ exit_idle:
>>    */
>>   static void cpu_idle_loop(void)
>>   {
>> +       __current_set_polling();
>> +
>>         while (1) {
>> +               /*
>> +                * Invariant: polling is set here (assuming that the arch
>> +                * has a polling bit.
>> +                */
>> +
>
>
> nit : extra line
>

It was intentional: the comment is about this point in the loop, not
about the tick_nohz_idle_enter call.  I'm not attached to it, though.

>
>>                 tick_nohz_idle_enter();
>>
>>                 while (!need_resched()) {
>> @@ -239,7 +250,6 @@ void cpu_startup_entry(enum cpuhp_state state)
>>          */
>>         boot_init_stack_canary();
>>   #endif
>> -       __current_set_polling();
>
>
> I don't get the connection with the patch description.
>

In retrospect, I think I can just fold this patch with the one after
it.  I wrote this because I could never remember who is responsible
for setting polling in the first place.

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