[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZU52ifwZcNhmz0rA@casper.infradead.org>
Date: Fri, 10 Nov 2023 18:29:29 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Kefeng Wang <wangkefeng.wang@...wei.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
David Hildenbrand <david@...hat.com>,
Gregory Price <gregory.price@...verge.com>
Subject: Re: [PATCH v2 5/7] mm: task_mmu: use a folio in smaps_account()
On Fri, Nov 10, 2023 at 11:33:22AM +0800, Kefeng Wang wrote:
> Replace seven implicit calls to compound_head() with one page_folio().
You're so focused on trying to accomplish your goal (killing off the
page_idle and page_young functions) that you're doing a poor job thinkig
about the conversions you're doing along the way.
> +++ b/fs/proc/task_mmu.c
> @@ -445,23 +445,25 @@ static void smaps_account(struct mem_size_stats *mss, struct page *page,
> {
> int i, nr = compound ? compound_nr(page) : 1;
> unsigned long size = nr * PAGE_SIZE;
> + struct folio *folio = page_folio(page);
Stop right here. The use of compound_nr() should give you pause.
After looking at how smaps_account() is used, it seems to me that the
two callers should each pass in PAGE_SIZE or PMD_SIZE instead of doing
this calculation.
More generally, step back from this series. Do a good job of
transforming fs/proc/task_mmu.c to use folios. Once you've done
that, you can approach the young/idle work again.
Powered by blists - more mailing lists