lkml.org 
[lkml]   [2024]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: huge_memory: convert __do_huge_pmd_anonymous_page() to use folios
On Mon, Apr 22, 2024 at 11:12:16AM -0700, Jianfeng Wang wrote:
> Change __do_huge_pmd_anonymous_page() to take folio as input, as its
> caller has used folio. Save one unnecessary call to compound_head().

I don't like this patch. It makes the assumption that folios will never
be larger than PMD size, and I don't think that's an assumption that's
going to last another five years. Look where you had to
do &folio->page:

> + clear_huge_page(&folio->page, vmf->address, HPAGE_PMD_NR);

> + entry = mk_huge_pmd(&folio->page, vma->vm_page_prot);

For mk_huge_pmd() in particular, you need to know the precise page, and
not just use the first page of the folio.

\
 
 \ /
  Last update: 2024-05-27 17:56    [W:0.028 / U:3.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site