From: Christoph Lameter <cl@linux.com>
To: akpm@linux-foundation.org
Cc: Michal Hocko <mhocko@kernel.org>, Tejun Heo <htejun@gmail.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org, hannes@cmpxchg.org,
mgorman@suse.de
Subject: [patch 1/3] vmstat: Make pageset processing optional in refresh_cpu_vm_stats
Date: Tue, 27 Oct 2015 21:41:15 -0500 [thread overview]
Message-ID: <20151028024131.512101613@linux.com> (raw)
In-Reply-To: 20151028024114.370693277@linux.com
[-- Attachment #1: vmstat_do_pageset_parameter --]
[-- Type: text/plain, Size: 2579 bytes --]
Add a parameter to refresh_cpu_vm_stats() to make pageset expiration
optional. Flushing the pagesets is performed by the page allocator
and thus processing of pagesets may not be wanted when just intending
to fold the differentials.
Signed-of-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -460,7 +460,7 @@ static int fold_diff(int *diff)
*
* The function returns the number of global counters updated.
*/
-static int refresh_cpu_vm_stats(void)
+static int refresh_cpu_vm_stats(bool do_pagesets)
{
struct zone *zone;
int i;
@@ -484,33 +484,35 @@ static int refresh_cpu_vm_stats(void)
#endif
}
}
- cond_resched();
#ifdef CONFIG_NUMA
- /*
- * Deal with draining the remote pageset of this
- * processor
- *
- * Check if there are pages remaining in this pageset
- * if not then there is nothing to expire.
- */
- if (!__this_cpu_read(p->expire) ||
+ if (do_pagesets) {
+ cond_resched();
+ /*
+ * Deal with draining the remote pageset of this
+ * processor
+ *
+ * Check if there are pages remaining in this pageset
+ * if not then there is nothing to expire.
+ */
+ if (!__this_cpu_read(p->expire) ||
!__this_cpu_read(p->pcp.count))
- continue;
+ continue;
- /*
- * We never drain zones local to this processor.
- */
- if (zone_to_nid(zone) == numa_node_id()) {
- __this_cpu_write(p->expire, 0);
- continue;
- }
+ /*
+ * We never drain zones local to this processor.
+ */
+ if (zone_to_nid(zone) == numa_node_id()) {
+ __this_cpu_write(p->expire, 0);
+ continue;
+ }
- if (__this_cpu_dec_return(p->expire))
- continue;
+ if (__this_cpu_dec_return(p->expire))
+ continue;
- if (__this_cpu_read(p->pcp.count)) {
- drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
- changes++;
+ if (__this_cpu_read(p->pcp.count)) {
+ drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
+ changes++;
+ }
}
#endif
}
@@ -1363,7 +1365,7 @@ static cpumask_var_t cpu_stat_off;
static void vmstat_update(struct work_struct *w)
{
- if (refresh_cpu_vm_stats()) {
+ if (refresh_cpu_vm_stats(true)) {
/*
* Counters were updated so we expect more updates
* to occur in the future. Keep on running the
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Lameter <cl@linux.com>
To: akpm@linux-foundation.org
Cc: Michal Hocko <mhocko@kernel.org>, Tejun Heo <htejun@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org
Cc: hannes@cmpxchg.org, mgorman@suse.de
Subject: [patch 1/3] vmstat: Make pageset processing optional in refresh_cpu_vm_stats
Date: Tue, 27 Oct 2015 21:41:15 -0500 [thread overview]
Message-ID: <20151028024131.512101613@linux.com> (raw)
In-Reply-To: 20151028024114.370693277@linux.com
[-- Attachment #1: vmstat_do_pageset_parameter --]
[-- Type: text/plain, Size: 2354 bytes --]
Add a parameter to refresh_cpu_vm_stats() to make pageset expiration
optional. Flushing the pagesets is performed by the page allocator
and thus processing of pagesets may not be wanted when just intending
to fold the differentials.
Signed-of-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -460,7 +460,7 @@ static int fold_diff(int *diff)
*
* The function returns the number of global counters updated.
*/
-static int refresh_cpu_vm_stats(void)
+static int refresh_cpu_vm_stats(bool do_pagesets)
{
struct zone *zone;
int i;
@@ -484,33 +484,35 @@ static int refresh_cpu_vm_stats(void)
#endif
}
}
- cond_resched();
#ifdef CONFIG_NUMA
- /*
- * Deal with draining the remote pageset of this
- * processor
- *
- * Check if there are pages remaining in this pageset
- * if not then there is nothing to expire.
- */
- if (!__this_cpu_read(p->expire) ||
+ if (do_pagesets) {
+ cond_resched();
+ /*
+ * Deal with draining the remote pageset of this
+ * processor
+ *
+ * Check if there are pages remaining in this pageset
+ * if not then there is nothing to expire.
+ */
+ if (!__this_cpu_read(p->expire) ||
!__this_cpu_read(p->pcp.count))
- continue;
+ continue;
- /*
- * We never drain zones local to this processor.
- */
- if (zone_to_nid(zone) == numa_node_id()) {
- __this_cpu_write(p->expire, 0);
- continue;
- }
+ /*
+ * We never drain zones local to this processor.
+ */
+ if (zone_to_nid(zone) == numa_node_id()) {
+ __this_cpu_write(p->expire, 0);
+ continue;
+ }
- if (__this_cpu_dec_return(p->expire))
- continue;
+ if (__this_cpu_dec_return(p->expire))
+ continue;
- if (__this_cpu_read(p->pcp.count)) {
- drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
- changes++;
+ if (__this_cpu_read(p->pcp.count)) {
+ drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
+ changes++;
+ }
}
#endif
}
@@ -1363,7 +1365,7 @@ static cpumask_var_t cpu_stat_off;
static void vmstat_update(struct work_struct *w)
{
- if (refresh_cpu_vm_stats()) {
+ if (refresh_cpu_vm_stats(true)) {
/*
* Counters were updated so we expect more updates
* to occur in the future. Keep on running the
next prev parent reply other threads:[~2015-10-28 2:41 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 2:41 [patch 0/3] vmstat: Various enhancements Christoph Lameter
2015-10-28 2:41 ` Christoph Lameter
2015-10-28 2:41 ` Christoph Lameter [this message]
2015-10-28 2:41 ` [patch 1/3] vmstat: Make pageset processing optional in refresh_cpu_vm_stats Christoph Lameter
2015-10-28 2:41 ` [patch 2/3] vmstat: make vmstat_updater deferrable again and shut down on idle Christoph Lameter
2015-10-28 2:41 ` Christoph Lameter
2015-10-28 2:41 ` [patch 3/3] vmstat: Create our own workqueue Christoph Lameter
2015-10-28 2:41 ` Christoph Lameter
2015-10-28 2:43 ` Tejun Heo
2015-10-28 2:43 ` Tejun Heo
2015-10-28 3:04 ` Christoph Lameter
2015-10-28 3:04 ` Christoph Lameter
2015-10-28 11:57 ` Tetsuo Handa
2015-10-28 11:57 ` Tetsuo Handa
2015-10-28 22:32 ` Christoph Lameter
2015-10-28 22:32 ` Christoph Lameter
2015-10-29 2:24 ` Tejun Heo
2015-10-29 2:24 ` Tejun Heo
2015-10-29 3:08 ` Tejun Heo
2015-10-29 3:08 ` Tejun Heo
2015-10-30 1:01 ` Christoph Lameter
2015-10-30 1:01 ` Christoph Lameter
2015-10-31 1:15 ` Tejun Heo
2015-10-31 1:15 ` Tejun Heo
2015-10-31 2:43 ` Tetsuo Handa
2015-10-31 2:43 ` Tetsuo Handa
2015-11-02 16:12 ` Christoph Lameter
2015-11-02 16:12 ` Christoph Lameter
2015-11-02 16:52 ` Tetsuo Handa
2015-11-02 16:52 ` Tetsuo Handa
2015-11-02 18:10 ` Christoph Lameter
2015-11-02 18:10 ` Christoph Lameter
2015-11-02 19:11 ` Tejun Heo
2015-11-02 19:11 ` Tejun Heo
2015-11-06 11:28 ` Tetsuo Handa
2015-11-06 11:28 ` Tetsuo Handa
2015-11-06 12:56 ` Christoph Lameter
2015-11-06 12:56 ` Christoph Lameter
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=20151028024131.512101613@linux.com \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=torvalds@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.