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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Apr 2015 16:00:36 -0400
From:	Don Zickus <dzickus@...hat.com>
To:	Chris Metcalf <cmetcalf@...hip.com>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrew Jones <drjones@...hat.com>,
	chai wen <chaiw.fnst@...fujitsu.com>,
	Ulrich Obergfell <uobergfe@...hat.com>,
	Fabian Frederick <fabf@...net.be>,
	Aaron Tomlin <atomlin@...hat.com>,
	Ben Zhang <benzh@...omium.org>,
	Christoph Lameter <cl@...ux.com>,
	Gilad Ben-Yossef <gilad@...yossef.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-kernel@...r.kernel.org, Jonathan Corbet <corbet@....net>,
	linux-doc@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v10 2/3] watchdog: add watchdog_cpumask sysctl to assist
 nohz

On Thu, Apr 30, 2015 at 03:39:25PM -0400, Chris Metcalf wrote:
> Change the default behavior of watchdog so it only runs on the
> housekeeping cores when nohz_full is enabled at build and boot time.
> Allow modifying the set of cores the watchdog is currently running
> on with a new kernel.watchdog_cpumask sysctl.
> 
> In the current system, the watchdog subsystem runs a periodic timer
> that schedules the watchdog kthread to run.  However, nohz_full cores
> are designed to allow userspace application code running on those cores
> to have 100% access to the CPU.  So the watchdog system prevents the
> nohz_full application code from being able to run the way it wants to,
> thus the motivation to suppress the watchdog on nohz_full cores,
> which this patchset provides by default.
> 
> However, if we disable the watchdog globally, then the housekeeping
> cores can't benefit from the watchdog functionality.  So we allow
> disabling it only on some cores.  See Documentation/lockup-watchdogs.txt
> for more information.
> 
> Acked-by: Don Zickus <dzickus@...hat.com>
> Signed-off-by: Chris Metcalf <cmetcalf@...hip.com>
> ---
>  Documentation/lockup-watchdogs.txt | 18 +++++++++++
>  Documentation/sysctl/kernel.txt    | 21 +++++++++++++
>  include/linux/nmi.h                |  3 ++
>  kernel/sysctl.c                    |  7 +++++
>  kernel/watchdog.c                  | 64 +++++++++++++++++++++++++++++++++++---
>  5 files changed, 108 insertions(+), 5 deletions(-)
>

<snip>
 
> @@ -697,8 +704,12 @@ static int watchdog_enable_all_cpus(void)
>  		err = smpboot_register_percpu_thread(&watchdog_threads);
>  		if (err)
>  			pr_err("Failed to create watchdog threads, disabled\n");
> -		else
> +		else {
> +			if (smpboot_update_cpumask_percpu_thread(
> +				    &watchdog_threads, &watchdog_cpumask))
> +				pr_err("Failed to set cpumask for watchdog threads\n");

Stupid nitpick, this error message tells us the 'watchdog' threads caused
the cpumask failure, but ....

>  			watchdog_running = 1;
> +		}
>  	} else {
>  		/*
>  		 * Enable/disable the lockup detectors or
> @@ -869,12 +880,55 @@ out:
>  	mutex_unlock(&watchdog_proc_mutex);
>  	return err;
>  }
> +
> +/*
> + * The cpumask is the mask of possible cpus that the watchdog can run
> + * on, not the mask of cpus it is actually running on.  This allows the
> + * user to specify a mask that will include cpus that have not yet
> + * been brought online, if desired.
> + */
> +int proc_watchdog_cpumask(struct ctl_table *table, int write,
> +			  void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> +	int err;
> +
> +	mutex_lock(&watchdog_proc_mutex);
> +	err = proc_do_large_bitmap(table, write, buffer, lenp, ppos);
> +	if (!err && write) {
> +		/* Remove impossible cpus to keep sysctl output cleaner. */
> +		cpumask_and(&watchdog_cpumask, &watchdog_cpumask,
> +			    cpu_possible_mask);
> +
> +		if (watchdog_enabled && watchdog_thresh) {
> +			/*
> +			 * Failure would be due to being unable to allocate
> +			 * a temporary cpumask, so we are likely not in a
> +			 * position to do much else to make things better.
> +			 */
> +			if (smpboot_update_cpumask_percpu_thread(
> +				    &watchdog_threads, &watchdog_cpumask) != 0)
> +				pr_err("cpumask update failed\n");

This one does not. :-(  If there is a respin, I would suggest copying the
above message down here. 


Cheers,
Don
--
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