From: Johannes Weiner <hannes@cmpxchg.org>
To: Rik van Riel <riel@surriel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] mm: memcontrol: add file_thp, shmem_thp to memory.stat
Date: Thu, 22 Oct 2020 14:29:34 -0400 [thread overview]
Message-ID: <20201022182934.GA494712@cmpxchg.org> (raw)
In-Reply-To: <004fe66ee1d111ec006dd065b9bed5fdcfdaad01.camel@surriel.com>
On Thu, Oct 22, 2020 at 12:57:55PM -0400, Rik van Riel wrote:
> On Thu, 2020-10-22 at 12:49 -0400, Rik van Riel wrote:
> > On Thu, 2020-10-22 at 11:18 -0400, Johannes Weiner wrote:
> >
> > > index e80aa9d2db68..334ce608735c 100644
> > > --- a/mm/filemap.c
> > > +++ b/mm/filemap.c
> > > @@ -204,9 +204,9 @@ static void unaccount_page_cache_page(struct
> > > address_space *mapping,
> > > if (PageSwapBacked(page)) {
> > > __mod_lruvec_page_state(page, NR_SHMEM, -nr);
> > > if (PageTransHuge(page))
> > > - __dec_node_page_state(page, NR_SHMEM_THPS);
> > > + __dec_lruvec_page_state(page, NR_SHMEM_THPS);
> > > } else if (PageTransHuge(page)) {
> > > - __dec_node_page_state(page, NR_FILE_THPS);
> > > + __dec_lruvec_page_state(page, NR_FILE_THPS);
> > > filemap_nr_thps_dec(mapping);
> > > }
> >
> > This may be a dumb question, but does that mean the
> > NR_FILE_THPS number will no longer be visible in
> > /proc/vmstat or is there some magic I overlooked in
> > a cursory look of the code?
>
> Never mind, I found it a few levels deep in
> __dec_lruvec_page_state.
No worries, it's a legit question.
lruvec is at the intersection of node and memcg, so I'm just moving
the accounting to a higher-granularity function that updates all
layers, including the node.
> Reviewed-by: Rik van Riel <riel@surriel.com>
Thanks!
next prev parent reply other threads:[~2020-10-22 18:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 15:18 Johannes Weiner
2020-10-22 16:49 ` Rik van Riel
2020-10-22 16:57 ` Rik van Riel
2020-10-22 18:29 ` Johannes Weiner [this message]
2020-10-22 16:51 ` Shakeel Butt
2020-10-22 18:00 ` David Rientjes
2020-10-23 7:42 ` Michal Hocko
2020-10-25 18:37 ` Andrew Morton
2020-10-26 17:40 ` Johannes Weiner
2020-10-26 20:24 ` Song Liu
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=20201022182934.GA494712@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=riel@surriel.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