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: <1292860700.5021.14.camel@laptop>
Date:	Mon, 20 Dec 2010 16:58:20 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Steven Rostedt <rostedt@...dmis.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Anton Blanchard <anton@....ibm.com>,
	Tim Pepper <lnxninja@...ux.vnet.ibm.com>
Subject: Re: [RFC PATCH 06/15] nohz_task: Keep the tick if rcu needs it

On Mon, 2010-12-20 at 16:24 +0100, Frederic Weisbecker wrote:

> @@ -1634,7 +1633,7 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
>   * by the current CPU, returning 1 if so.  This function is part of the
>   * RCU implementation; it is -not- an exported member of the RCU API.
>   */
> -static int rcu_pending(int cpu)
> +int rcu_pending(int cpu)

/me wonders about that comment.

>  {
>  	return __rcu_pending(&rcu_sched_state, &per_cpu(rcu_sched_data, cpu)) ||
>  	       __rcu_pending(&rcu_bh_state, &per_cpu(rcu_bh_data, cpu)) ||
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 6dbae46..45bd6e2 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -2470,10 +2470,16 @@ static void nohz_task_cpu_update(void *unused)
>  int nohz_task_can_stop_tick(void)
>  {
>  	struct rq *rq = this_rq();
> +	int cpu;
>  
>  	if (rq->nr_running > 1)
>  		return 0;
>  
> +	cpu = smp_processor_id();
> +
> +	if (rcu_pending(cpu) || rcu_needs_cpu(cpu))
> +		return 0;

Arguable, rcu_needs_cpu() should imply rcu_pending(), because if there's
work still to be done, it needs the cpu, hmm?

>  	return 1;
>  }
>  

This patch also implies you broke stuff with #4 because it would put the
machine to sleep while RCU still had bits to do, not very nice.
--
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