lkml.org 
[lkml]   [2021]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v5 24/26] mm/pagemap: Recognize uffd-wp bit for shmem/hugetlbfs
    Date

    Hello Peter,

    > On 15 Jul 2021, at 21:16, Peter Xu <peterx@redhat.com> wrote:
    >
    > This requires the pagemap code to be able to recognize the newly introduced
    > swap special pte for uffd-wp, meanwhile the general case for hugetlb that we
    > recently start to support. It should make pagemap uffd-wp support complete.
    >
    > Signed-off-by: Peter Xu <peterx@redhat.com>
    > ---
    > fs/proc/task_mmu.c | 7 +++++++
    > 1 file changed, 7 insertions(+)
    >
    > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
    > index 9c5af77b5290..988e29fa1f00 100644
    > --- a/fs/proc/task_mmu.c
    > +++ b/fs/proc/task_mmu.c
    > @@ -1389,6 +1389,8 @@ static pagemap_entry_t pte_to_pagemap_entry(struct pagemapread *pm,
    > flags |= PM_SWAP;
    > if (is_pfn_swap_entry(entry))
    > page = pfn_swap_entry_to_page(entry);
    > + } else if (pte_swp_uffd_wp_special(pte)) {
    > + flags |= PM_UFFD_WP;
    > }

    ^ Would it not be important to also add PM_SWAP to flags?

    Kind regards,
    Tibi

    \
     
     \ /
      Last update: 2021-07-19 11:56    [W:4.650 / U:0.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site