[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2EY9zK0phgfQYE1@casper.infradead.org>
Date: Tue, 1 Nov 2022 13:02:47 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Huang Ying <ying.huang@...el.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Zi Yan <ziy@...dia.com>, Yang Shi <shy828301@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Oscar Salvador <osalvador@...e.de>
Subject: Re: [RFC 2/2] migrate: convert migrate_pages() to use folios
On Tue, Nov 01, 2022 at 02:21:37PM +0800, Huang Ying wrote:
> - is_thp = PageTransHuge(page) && !PageHuge(page);
> - nr_subpages = compound_nr(page);
> + is_large = folio_test_large(folio) && !PageHuge(&folio->page);
We have folio_test_hugetlb() to replace PageHuge().
> count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded);
> count_vm_events(PGMIGRATE_FAIL, nr_failed_pages);
> - count_vm_events(THP_MIGRATION_SUCCESS, nr_thp_succeeded);
> - count_vm_events(THP_MIGRATION_FAIL, nr_thp_failed);
> - count_vm_events(THP_MIGRATION_SPLIT, nr_thp_split);
> - trace_mm_migrate_pages(nr_succeeded, nr_failed_pages, nr_thp_succeeded,
> - nr_thp_failed, nr_thp_split, mode, reason);
> + count_vm_events(THP_MIGRATION_SUCCESS, nr_large_succeeded);
> + count_vm_events(THP_MIGRATION_FAIL, nr_large_failed);
> + count_vm_events(THP_MIGRATION_SPLIT, nr_split);
> + trace_mm_migrate_pages(nr_succeeded, nr_failed_pages, nr_large_succeeded,
> + nr_large_failed, nr_split, mode, reason);
I think this is the biggest question with this patch -- how (or whether)
to account folios in size between PMD and PTE size. Since it's
_called_ THP, I've tended to make the statistics conditional on
folio_test_pmd_mappable() rather than simply being folio_test_large().
Powered by blists - more mailing lists