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: <CAFTL4hw-yawRUO-8ePsonvh1o2P7T5yb+GFPVop5OHzH6HTobw@mail.gmail.com>
Date:	Wed, 2 Oct 2013 17:57:17 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Stephen Boyd <sboyd@...eaurora.org>,
	LKML <linux-kernel@...r.kernel.org>, patches@...aro.org,
	"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>
Subject: Re: [PATCH V2] tick: Make sleep length calculation more accurate

2013/10/2 Daniel Lezcano <daniel.lezcano@...aro.org>:
> The sleep_length is computed in the tick_nohz_stop_sched_tick function but it
> is used later in the code with in between the local irq enabled.
>
> cpu_idle_loop
>   tick_nohz_idle_enter         [ exits with local irq enabled ]
>    __tick_nohz_idle_enter
>      tick_nohz_stop_sched_tick
>   ...
>
>   arch_cpu_idle
>      menu_select               [ uses here 'sleep_length' ]
>   ...
>
> Between the computation of the sleep length and its usage, some interrupts
> may occur, making the sleep length shorter than actually it is because of the
> interrupt processing

So, do you mean that the ts->sleep_length would return a value that is too long
given that the CPU already spent some time to service the irqs since we computed
the sleep length in tick_nohz_idle_enter()?

But then tick_nohz_irq_exit() should take care of that as it calls
again tick_nohz_stop_sched_tick().
So I'm a bit confused.

> or different if the timer itself expired.

Same here, if the timer expired, it triggers an interrupt which can do
two things:

1) reprogram a new timer and this recompute sleep_length
2) set_need_resched() and then exit the idle loop, so arch_cpu_idle() won't even
be called. Or the timer interrupts hlt, but then menu_select() was
called before.

So I probably missed something here.

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