[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201211135737.GA2443@casper.infradead.org>
Date: Fri, 11 Dec 2020 13:57:37 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Muchun Song <songmuchun@...edance.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, adobriyan@...il.com,
akpm@...ux-foundation.org, hannes@...xchg.org, mhocko@...nel.org,
vdavydov.dev@...il.com, hughd@...gle.com, shakeelb@...gle.com,
guro@...com, samitolvanen@...gle.com, feng.tang@...el.com,
neilb@...e.de, iamjoonsoo.kim@....com, rdunlap@...radead.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v4 3/7] mm: memcontrol: convert NR_FILE_THPS account to
pages
On Fri, Dec 11, 2020 at 12:19:50PM +0800, Muchun Song wrote:
> +++ b/mm/filemap.c
> @@ -207,7 +207,7 @@ static void unaccount_page_cache_page(struct address_space *mapping,
> if (PageTransHuge(page))
> __dec_lruvec_page_state(page, NR_SHMEM_THPS);
> } else if (PageTransHuge(page)) {
> - __dec_lruvec_page_state(page, NR_FILE_THPS);
> + __mod_lruvec_page_state(page, NR_FILE_THPS, -HPAGE_PMD_NR);
+ __mod_lruvec_page_state(page, NR_FILE_THPS, -nr);
> +++ b/mm/huge_memory.c
> @@ -2748,7 +2748,8 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
> if (PageSwapBacked(head))
> __dec_lruvec_page_state(head, NR_SHMEM_THPS);
> else
> - __dec_lruvec_page_state(head, NR_FILE_THPS);
> + __mod_lruvec_page_state(head, NR_FILE_THPS,
> + -HPAGE_PMD_NR);
+ __mod_lruvec_page_state(head, NR_FILE_THPS,
+ -thp_nr_pages(head));
Powered by blists - more mailing lists