Subject: + watchdog-update-watchdog-attributes-atomically.patch added to -mm tree To: mhocko@xxxxxxx,dzickus@xxxxxxxxxx,fweisbec@xxxxxxxxx,mingo@xxxxxxxxxx,tglx@xxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Mon, 29 Jul 2013 14:04:28 -0700 The patch titled Subject: watchdog: update watchdog attributes atomically has been added to the -mm tree. Its filename is watchdog-update-watchdog-attributes-atomically.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/watchdog-update-watchdog-attributes-atomically.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/watchdog-update-watchdog-attributes-atomically.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Michal Hocko <mhocko@xxxxxxx> Subject: watchdog: update watchdog attributes atomically proc_dowatchdog doesn't synchronize multiple callers which might lead to confusion when two parallel callers might confuse watchdog_enable_all_cpus resp. watchdog_disable_all_cpus (e.g. watchdog gets enabled even if watchdog_thresh was set to 0 already). This patch adds a local mutex which synchronizes callers to the sysctl handler. Signed-off-by: Michal Hocko <mhocko@xxxxxxx> Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx> Acked-by: Don Zickus <dzickus@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/watchdog.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff -puN kernel/watchdog.c~watchdog-update-watchdog-attributes-atomically kernel/watchdog.c --- a/kernel/watchdog.c~watchdog-update-watchdog-attributes-atomically +++ a/kernel/watchdog.c @@ -520,13 +520,15 @@ int proc_dowatchdog(struct ctl_table *ta void __user *buffer, size_t *lenp, loff_t *ppos) { int err, old_thresh, old_enabled; + static DEFINE_MUTEX(watchdog_proc_mutex); + mutex_lock(&watchdog_proc_mutex); old_thresh = ACCESS_ONCE(watchdog_thresh); old_enabled = ACCESS_ONCE(watchdog_user_enabled); err = proc_dointvec_minmax(table, write, buffer, lenp, ppos); if (err || !write) - return err; + goto out; set_sample_period(); /* @@ -544,7 +546,8 @@ int proc_dowatchdog(struct ctl_table *ta watchdog_thresh = old_thresh; watchdog_user_enabled = old_enabled; } - +out: + mutex_unlock(&watchdog_proc_mutex); return err; } #endif /* CONFIG_SYSCTL */ _ Patches currently in -mm which might be from mhocko@xxxxxxx are vmpressure-change-vmpressure-sr_lock-to-spinlock.patch vmpressure-do-not-check-for-pending-work-to-prevent-from-new-work.patch vmpressure-make-sure-there-are-no-events-queued-after-memcg-is-offlined.patch vmpressure-make-sure-there-are-no-events-queued-after-memcg-is-offlined-checkpatch-fixes.patch include-linux-schedh-dont-use-task-pid-tgid-in-same_thread_group-has_group_leader_pid.patch watchdog-update-watchdog-attributes-atomically.patch watchdog-update-watchdog_tresh-properly.patch mm-fix-potential-null-pointer-dereference.patch inode-convert-inode-lru-list-to-generic-lru-list-code-inode-move-inode-to-a-different-list-inside-lock.patch list_lru-per-node-list-infrastructure-fix-broken-lru_retry-behaviour.patch list_lru-remove-special-case-function-list_lru_dispose_all.patch xfs-convert-dquot-cache-lru-to-list_lru-fix-dquot-isolation-hang.patch list_lru-dynamically-adjust-node-arrays-super-fix-for-destroy-lrus.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html