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, 18 Aug 2016 09:20:31 -0700
From:   "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, rt@...utronix.de,
        Josh Triplett <josh@...htriplett.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: [PATCH 07/16] rcu: rcutorture: Convert to hotplug state machine

On Thu, Aug 18, 2016 at 02:57:22PM +0200, Sebastian Andrzej Siewior wrote:
> Install the callbacks via the state machine and let the core invoke
> the callbacks on the already online CPUs.
> 
> Cc: Josh Triplett <josh@...htriplett.org>
> Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> Cc: Lai Jiangshan <jiangshanlai@...il.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>

Queued for testing and review, thank you!

							Thanx, Paul

> ---
>  kernel/rcu/rcutorture.c | 52 +++++++++++++------------------------------------
>  1 file changed, 14 insertions(+), 38 deletions(-)
> 
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index ac29017623e5..bf08fee53dc7 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -1366,12 +1366,12 @@ rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag)
>  		 onoff_interval, onoff_holdoff);
>  }
> 
> -static void rcutorture_booster_cleanup(int cpu)
> +static int rcutorture_booster_cleanup(unsigned int cpu)
>  {
>  	struct task_struct *t;
> 
>  	if (boost_tasks[cpu] == NULL)
> -		return;
> +		return 0;
>  	mutex_lock(&boost_mutex);
>  	t = boost_tasks[cpu];
>  	boost_tasks[cpu] = NULL;
> @@ -1379,9 +1379,10 @@ static void rcutorture_booster_cleanup(int cpu)
> 
>  	/* This must be outside of the mutex, otherwise deadlock! */
>  	torture_stop_kthread(rcu_torture_boost, t);
> +	return 0;
>  }
> 
> -static int rcutorture_booster_init(int cpu)
> +static int rcutorture_booster_init(unsigned int cpu)
>  {
>  	int retval;
> 
> @@ -1581,28 +1582,7 @@ static void rcu_torture_barrier_cleanup(void)
>  	}
>  }
> 
> -static int rcutorture_cpu_notify(struct notifier_block *self,
> -				 unsigned long action, void *hcpu)
> -{
> -	long cpu = (long)hcpu;
> -
> -	switch (action & ~CPU_TASKS_FROZEN) {
> -	case CPU_ONLINE:
> -	case CPU_DOWN_FAILED:
> -		(void)rcutorture_booster_init(cpu);
> -		break;
> -	case CPU_DOWN_PREPARE:
> -		rcutorture_booster_cleanup(cpu);
> -		break;
> -	default:
> -		break;
> -	}
> -	return NOTIFY_OK;
> -}
> -
> -static struct notifier_block rcutorture_cpu_nb = {
> -	.notifier_call = rcutorture_cpu_notify,
> -};
> +static enum cpuhp_state rcutor_hp;
> 
>  static void
>  rcu_torture_cleanup(void)
> @@ -1642,11 +1622,8 @@ rcu_torture_cleanup(void)
>  	for (i = 0; i < ncbflooders; i++)
>  		torture_stop_kthread(rcu_torture_cbflood, cbflood_task[i]);
>  	if ((test_boost == 1 && cur_ops->can_boost) ||
> -	    test_boost == 2) {
> -		unregister_cpu_notifier(&rcutorture_cpu_nb);
> -		for_each_possible_cpu(i)
> -			rcutorture_booster_cleanup(i);
> -	}
> +	    test_boost == 2)
> +		cpuhp_remove_state(rcutor_hp);
> 
>  	/*
>  	 * Wait for all RCU callbacks to fire, then do flavor-specific
> @@ -1873,14 +1850,13 @@ rcu_torture_init(void)
>  	    test_boost == 2) {
> 
>  		boost_starttime = jiffies + test_boost_interval * HZ;
> -		register_cpu_notifier(&rcutorture_cpu_nb);
> -		for_each_possible_cpu(i) {
> -			if (cpu_is_offline(i))
> -				continue;  /* Heuristic: CPU can go offline. */
> -			firsterr = rcutorture_booster_init(i);
> -			if (firsterr)
> -				goto unwind;
> -		}
> +
> +		firsterr = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "RCU_TORTURE",
> +					     rcutorture_booster_init,
> +					     rcutorture_booster_cleanup);
> +		if (firsterr < 0)
> +			goto unwind;
> +		rcutor_hp = firsterr;
>  	}
>  	firsterr = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup);
>  	if (firsterr)
> -- 
> 2.9.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ