From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934801AbcIFPXB (ORCPT ); Tue, 6 Sep 2016 11:23:01 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42822 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935195AbcIFPW4 (ORCPT ); Tue, 6 Sep 2016 11:22:56 -0400 Date: Tue, 6 Sep 2016 08:22:14 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: peterz@infradead.org, axboe@fb.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, tj@kernel.org, bigeasy@linutronix.de, linux-kernel@vger.kernel.org Reply-To: peterz@infradead.org, axboe@fb.com, tglx@linutronix.de, hpa@zytor.com, tj@kernel.org, mingo@kernel.org, bigeasy@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <20160818125731.27256-6-bigeasy@linutronix.de> References: <20160818125731.27256-6-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] mm/writeback: Convert to hotplug state machine Git-Commit-ID: 9505a0689c12e1a1304d822befbec67797de5544 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9505a0689c12e1a1304d822befbec67797de5544 Gitweb: http://git.kernel.org/tip/9505a0689c12e1a1304d822befbec67797de5544 Author: Sebastian Andrzej Siewior AuthorDate: Thu, 18 Aug 2016 14:57:20 +0200 Committer: Thomas Gleixner CommitDate: Tue, 6 Sep 2016 16:20:29 +0200 mm/writeback: Convert to hotplug state machine Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Sebastian Andrzej Siewior Cc: Peter Zijlstra Cc: Jens Axboe Cc: linux-mm@kvack.org Cc: rt@linutronix.de Cc: Tejun Heo Link: http://lkml.kernel.org/r/20160818125731.27256-6-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner --- include/linux/cpuhotplug.h | 1 + mm/page-writeback.c | 26 +++++++------------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index b6c2ef7..e417a05 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -16,6 +16,7 @@ enum cpuhp_state { CPUHP_X86_APB_DEAD, CPUHP_VIRT_NET_DEAD, CPUHP_SLUB_DEAD, + CPUHP_MM_WRITEBACK_DEAD, CPUHP_WORKQUEUE_PREP, CPUHP_POWER_NUMA_PREPARE, CPUHP_HRTIMERS_PREPARE, diff --git a/mm/page-writeback.c b/mm/page-writeback.c index f4cd7d8..28d6f36 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2080,26 +2080,12 @@ void writeback_set_ratelimit(void) ratelimit_pages = 16; } -static int -ratelimit_handler(struct notifier_block *self, unsigned long action, - void *hcpu) +static int page_writeback_cpu_online(unsigned int cpu) { - - switch (action & ~CPU_TASKS_FROZEN) { - case CPU_ONLINE: - case CPU_DEAD: - writeback_set_ratelimit(); - return NOTIFY_OK; - default: - return NOTIFY_DONE; - } + writeback_set_ratelimit(); + return 0; } -static struct notifier_block ratelimit_nb = { - .notifier_call = ratelimit_handler, - .next = NULL, -}; - /* * Called early on to tune the page writeback dirty limits. * @@ -2122,8 +2108,10 @@ void __init page_writeback_init(void) { BUG_ON(wb_domain_init(&global_wb_domain, GFP_KERNEL)); - writeback_set_ratelimit(); - register_cpu_notifier(&ratelimit_nb); + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "mm/writeback:online", + page_writeback_cpu_online, NULL); + cpuhp_setup_state(CPUHP_MM_WRITEBACK_DEAD, "mm/writeback:dead", NULL, + page_writeback_cpu_online); } /**