Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbbDEQrs (ORCPT ); Sun, 5 Apr 2015 12:47:48 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:49658 "EHLO mx5-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbDEQrq (ORCPT ); Sun, 5 Apr 2015 12:47:46 -0400 Date: Sun, 5 Apr 2015 12:46:47 -0400 (EDT) From: Ulrich Obergfell To: cmetcalf@ezchip.com Cc: Frederic Weisbecker , Don Zickus , Ingo Molnar , Andrew Morton , Andrew Jones , chai wen , Fabian Frederick , Aaron Tomlin , Ben Zhang , Christoph Lameter , Gilad Ben-Yossef , Steven Rostedt , linux-kernel@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Thomas Gleixner , Peter Zijlstra Message-ID: <1258649504.12464273.1428252407339.JavaMail.zimbra@redhat.com> In-Reply-To: <1428077335-4314-2-git-send-email-cmetcalf@ezchip.com> References: <1428077335-4314-1-git-send-email-cmetcalf@ezchip.com> <1428077335-4314-2-git-send-email-cmetcalf@ezchip.com> Subject: Re: [PATCH v4 2/2] watchdog: add watchdog_exclude sysctl to assist nohz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.36.4.48] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF22 (Linux)/8.0.6_GA_5922) Thread-Topic: watchdog: add watchdog_exclude sysctl to assist nohz Thread-Index: 8Fnzi23nAfKS291Uain5jB/nnojARA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1908 Lines: 54 Chris, I'd like to comment on the following proposed change: +int proc_dowatchdog_exclude(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 && watchdog_user_enabled) { + watchdog_disable_all_cpus(); + watchdog_enable_all_cpus(false); + } + mutex_unlock(&watchdog_proc_mutex); + return err; +} The watchdog mechanism is enabled if watchdog_user_enabled and watchdog_thresh are both non-zero. Hence, I think the if-statement in the above snippet of code should look like this: if (!err && write && watchdog_user_enabled && watchdog_thresh) Please see proc_dowatchdog() which checks the content of both variables before it calls watchdog_enable_all_cpus(): https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/watchdog.c?id=refs/tags/v4.0-rc6#n682 For completeness, I'd also like to point out that if the patch series at https://lkml.org/lkml/2015/2/5/626 gets accepted upstream, the if-statement will have to be adjusted. I think it should then look like this: if (!err && write && watchdog_enabled && watchdog_thresh) { watchdog_disable_all_cpus(); watchdog_enable_all_cpus(); } Please see proc_watchdog_update() here which is similar to the above. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/kernel/watchdog.c?id=refs/tags/next-20150402#n710 Regards, Uli -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/