[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZKfFoHAhCJC4/75@casper.infradead.org>
Date: Mon, 15 Nov 2021 17:55:34 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Alistair Popple <apopple@...dia.com>
Cc: akpm@...ux-foundation.org, dhowells@...hat.com, hughd@...gle.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
jglisse@...hat.com, jgg@...dia.com, rcampbell@...dia.com,
jhubbard@...dia.com
Subject: Re: [PATCH v3] mm/migrate.c: Rework migration_entry_wait() to not
take a pageref
On Mon, Nov 15, 2021 at 09:52:22PM +1100, Alistair Popple wrote:
> +#ifdef CONFIG_MIGRATION
> +/**
> + * migration_entry_wait_on_locked - Wait for a migration entry to be removed
> + * @page: page referenced by the migration entry.
This should be @folio (you can test by running 'make htmldocs', or even
'make W=1'
> + * @ptep: mapped pte pointer. This function will return with the ptep unmapped.
> + * @ptl: already locked ptl. This function will drop the lock.
> + *
> + * Wait for a migration entry referencing the given page to be removed. This is
> + * equivalent to put_and_wait_on_page_locked(page, TASK_UNINTERRUPTIBLE) except
> + * this can be called without taking a reference on the page. Instead this
> + * should be called while holding the ptl for the migration entry referencing
> + * the page.
The tool won't tell you to update these page references to be folio
references ... so I will ;-)
> +++ b/mm/migrate.c
> @@ -305,15 +305,7 @@ void __migration_entry_wait(struct mm_struct *mm, pte_t *ptep,
> page = pfn_swap_entry_to_page(entry);
> page = compound_head(page);
I think this whole function should be folio-based. That is:
- struct page *page;
+ struct folio *folio;
and
folio = page_folio(pfn_swap_entry_to_page(entry));
Powered by blists - more mailing lists