linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>, Mel Gorman <mel@csn.ul.ie>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>, Hillf Danton <dhillf@gmail.com>,
	Hugh Dickins <hughd@google.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: fix up the vmscan stat in vmstat
Date: Thu, 12 Apr 2012 12:24:49 -0700	[thread overview]
Message-ID: <CALWz4izqWMa9JueuCE8oHuoyBRXu1Qs=wL7F8NcO=J1wquucuA@mail.gmail.com> (raw)
In-Reply-To: <20120412190507.GO1787@cmpxchg.org>

On Thu, Apr 12, 2012 at 12:05 PM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Thu, Apr 12, 2012 at 11:03:02AM -0700, Ying Han wrote:
>> It is always confusing on stat "pgsteal" where it counts both direct
>> reclaim as well as background reclaim. However, we have "kswapd_steal"
>> which also counts background reclaim value.
>>
>> This patch fixes it and also makes it match the existng "pgscan_" stats.
>>
>> Test:
>> pgsteal_kswapd_dma32 447623
>> pgsteal_kswapd_normal 42272677
>> pgsteal_kswapd_movable 0
>> pgsteal_direct_dma32 2801
>> pgsteal_direct_normal 44353270
>> pgsteal_direct_movable 0
>>
>> Signed-off-by: Ying Han <yinghan@google.com>
>> ---
>>  include/linux/vm_event_item.h |    5 +++--
>>  mm/vmscan.c                   |   11 ++++++++---
>>  mm/vmstat.c                   |    4 ++--
>>  3 files changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
>> index 03b90cdc..06f8e38 100644
>> --- a/include/linux/vm_event_item.h
>> +++ b/include/linux/vm_event_item.h
>> @@ -26,13 +26,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
>>               PGFREE, PGACTIVATE, PGDEACTIVATE,
>>               PGFAULT, PGMAJFAULT,
>>               FOR_ALL_ZONES(PGREFILL),
>> -             FOR_ALL_ZONES(PGSTEAL),
>> +             FOR_ALL_ZONES(PGSTEAL_KSWAPD),
>> +             FOR_ALL_ZONES(PGSTEAL_DIRECT),
>>               FOR_ALL_ZONES(PGSCAN_KSWAPD),
>>               FOR_ALL_ZONES(PGSCAN_DIRECT),
>>  #ifdef CONFIG_NUMA
>>               PGSCAN_ZONE_RECLAIM_FAILED,
>>  #endif
>> -             PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
>> +             PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
>>               KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
>>               KSWAPD_SKIP_CONGESTION_WAIT,
>>               PAGEOUTRUN, ALLOCSTALL, PGROTATED,
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 33c332b..078c9fd 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1568,9 +1568,14 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz,
>>       reclaim_stat->recent_scanned[0] += nr_anon;
>>       reclaim_stat->recent_scanned[1] += nr_file;
>>
>> -     if (current_is_kswapd())
>> -             __count_vm_events(KSWAPD_STEAL, nr_reclaimed);
>> -     __count_zone_vm_events(PGSTEAL, zone, nr_reclaimed);
>> +     if (global_reclaim(sc)) {
>> +             if (current_is_kswapd())
>> +                     __count_zone_vm_events(PGSTEAL_KSWAPD, zone,
>> +                                            nr_reclaimed);
>> +             else
>> +                     __count_zone_vm_events(PGSTEAL_DIRECT, zone,
>> +                                            nr_reclaimed);
>> +     }
>
> Hey, you changed more than the changelog said!  Why no longer count
> memcg hard limit-triggered activity?

To make it consistent with "PGSCAN_*" stats, as in the commit log..
Although i could be more specific. :(

I think it is good to keep those stats to be global reclaim, and memcg
hardlimit-triggered should go to memory.vmscan_stat as you presented.

--Ying
>
> Agreed with everything else, though.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-04-12 19:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 18:03 Ying Han
2012-04-12 18:08 ` Rik van Riel
2012-04-12 18:52 ` Christoph Lameter
2012-04-12 19:05 ` Johannes Weiner
2012-04-12 19:24   ` Ying Han [this message]
2012-04-12 19:32     ` Johannes Weiner
2012-04-12 22:36 ` Andrew Morton
2012-04-13  0:52   ` Ying Han
2012-04-13 14:26   ` Rik van Riel
2012-04-13  0:45 ` Minchan Kim
2012-04-13  1:04 ` KAMEZAWA Hiroyuki
2012-04-13 22:25 Ying Han
2012-04-13 22:26 ` Ying Han

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='CALWz4izqWMa9JueuCE8oHuoyBRXu1Qs=wL7F8NcO=J1wquucuA@mail.gmail.com' \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=dhillf@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mhocko@suse.cz \
    --cc=riel@redhat.com \
    /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