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]
Date:   Thu, 9 Sep 2021 11:16:25 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Stephane Eranian <eranian@...gle.com>
Cc:     linux-kernel@...r.kernel.org, acme@...hat.com, jolsa@...hat.com,
        kim.phillips@....com, namhyung@...nel.org, irogers@...gle.com
Subject: Re: [PATCH v1 08/13] perf/x86/core: add idle hooks

On Thu, Sep 09, 2021 at 12:56:55AM -0700, Stephane Eranian wrote:

> diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
> index 14ce130aee1b..c0ddc3c32a33 100644
> --- a/kernel/sched/idle.c
> +++ b/kernel/sched/idle.c
> @@ -179,7 +179,6 @@ static void cpuidle_idle_call(void)
>  	 */
>  	if (need_resched()) {
>  		local_irq_enable();
> -		perf_lopwr_cb(false);
>  		return;
>  	}
>  
> @@ -230,6 +229,9 @@ static void cpuidle_idle_call(void)
>  		tick_nohz_idle_stop_tick();
>  
>  		next_state = cpuidle_find_deepest_state(drv, dev, max_latency_ns);
> +		if (!cpu_idle_force_poll)
> +			perf_lopwr_cb(true);
> +
>  		call_cpuidle(drv, dev, next_state);
>  	} else {
>  		bool stop_tick = true;
> @@ -244,12 +246,17 @@ static void cpuidle_idle_call(void)
>  		else
>  			tick_nohz_idle_retain_tick();
>  
> +		if (!cpu_idle_force_poll)
> +			perf_lopwr_cb(true);
> +
>  		entered_state = call_cpuidle(drv, dev, next_state);
>  		/*
>  		 * Give the governor an opportunity to reflect on the outcome
>  		 */
>  		cpuidle_reflect(dev, entered_state);
>  	}
> +	if (!cpu_idle_force_poll)
> +		perf_lopwr_cb(false);
>  
>  exit_idle:
>  	__current_set_polling();
> @@ -259,7 +266,6 @@ static void cpuidle_idle_call(void)
>  	 */
>  	if (WARN_ON_ONCE(irqs_disabled())) {
>  		local_irq_enable();
> -		perf_lopwr_cb(false);
>  	}
>  }
>  
> @@ -293,8 +299,6 @@ static void do_idle(void)
>  	while (!need_resched()) {
>  		rmb();
>  
> -		perf_lopwr_cb(true);
> -
>  		local_irq_disable();
>  
>  		if (cpu_is_offline(cpu)) {

Why are you sendimg me a patch that undoes most of what the previous
patch does? That's just bad form.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ