linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Borislav Petkov <bp@amd64.org>
Cc: Conny Seidel <conny.seidel@amd.com>, Jan Kara <jack@suse.cz>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Fengguang Wu <fengguang.wu@intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <jweiner@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] CPU hotplug, writeback: Don't call writeback_set_ratelimit() too often during hotplug
Date: Tue, 25 Sep 2012 02:18:20 +0530	[thread overview]
Message-ID: <5060C714.8030606@linux.vnet.ibm.com> (raw)
In-Reply-To: <5060AB0E.3070809@linux.vnet.ibm.com>


From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

The CPU hotplug callback related to writeback calls writeback_set_ratelimit()
during every state change in the hotplug sequence. This is unnecessary
since num_online_cpus() changes only once during the entire hotplug operation.

So invoke the function only once per hotplug, thereby avoiding the
unnecessary repetition of those costly calculations.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

 mm/page-writeback.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 5ad5ce2..830893b 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1602,10 +1602,18 @@ void writeback_set_ratelimit(void)
 }
 
 static int __cpuinit
-ratelimit_handler(struct notifier_block *self, unsigned long u, void *v)
+ratelimit_handler(struct notifier_block *self, unsigned long action,
+		  void *hcpu)
 {
-	writeback_set_ratelimit();
-	return NOTIFY_DONE;
+
+	switch (action & ~CPU_TASKS_FROZEN) {
+	case CPU_ONLINE:
+	case CPU_DEAD:
+		writeback_set_ratelimit();
+		return NOTIFY_OK;
+	default:
+		return NOTIFY_DONE;
+	}
 }
 
 static struct notifier_block __cpuinitdata ratelimit_nb = {


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-09-24 20:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 10:23 divide error: bdi_dirty_limit+0x5a/0x9e Borislav Petkov
2012-09-24 10:38 ` Srivatsa S. Bhat
2012-09-24 11:05   ` Borislav Petkov
2012-09-24 11:13     ` Srivatsa S. Bhat
2012-09-24 11:34       ` Fengguang Wu
2012-09-24 11:51         ` Srivatsa S. Bhat
2012-09-24 12:20         ` Borislav Petkov
2012-09-24 12:29           ` Fengguang Wu
2012-09-24 12:56             ` Borislav Petkov
2012-09-24 18:54               ` Srivatsa S. Bhat
2012-09-24 14:23 ` Jan Kara
2012-09-24 14:36   ` Borislav Petkov
2012-09-24 18:16     ` Conny Seidel
2012-09-24 18:19       ` Borislav Petkov
2012-09-24 18:48         ` Srivatsa S. Bhat
2012-09-24 19:31           ` Borislav Petkov
2012-09-24 20:07             ` Jan Kara
2012-09-24 20:17               ` Jan Kara
2012-09-24 21:21                 ` Andrew Morton
2012-09-24 22:27                   ` Jan Kara
2012-09-25  8:57                 ` Conny Seidel
2012-09-24 20:48           ` Srivatsa S. Bhat [this message]
2012-09-28 12:27             ` [PATCH] CPU hotplug, writeback: Don't call writeback_set_ratelimit() too often during hotplug Fengguang Wu
2012-09-28 14:46               ` Srivatsa S. Bhat
2012-10-03 23:11               ` Ni zhan Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5060C714.8030606@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=bp@amd64.org \
    --cc=conny.seidel@amd.com \
    --cc=fengguang.wu@intel.com \
    --cc=jack@suse.cz \
    --cc=jweiner@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).