lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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));

\
 
 \ /
  Last update: 2021-11-16 02:40    [W:0.046 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site