lkml.org 
[lkml]   [2023]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] mm/hugetlb: Use a folio in hugetlb_wp()
From
On 2023/6/3 4:17, Matthew Wilcox wrote:

> On Fri, Jun 02, 2023 at 09:54:08AM +0800, Peng Zhang wrote:
>> From: ZhangPeng <zhangpeng362@huawei.com>
>>
>> We can replace nine implict calls to compound_head() with one by using
>> old_folio. However, we still need to keep old_page because we need to
>> know which page in the folio we are copying.
> Do we? It's my understanding (and I am far from an expert here ...)
> that the 'pte_t *' we are passed *inside hugetlbfs* is not in fact a pte
> pointer at all but actually a pmd or pud pointer. See how we do this:
>
> pte_t pte = huge_ptep_get(ptep);
>
> and so the page we get back is always a head page, and we can go
> directly to a folio. ie this is different from the THP cases.

Yes, I'll remove ptepage and old_page in a v2. Thanks.

Best Regards,
Peng

\
 
 \ /
  Last update: 2023-06-05 13:15    [W:0.077 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site