[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b5bba27f-e26f-4efc-a7e0-92a6d82b9bbb@redhat.com>
Date: Fri, 12 Sep 2025 09:32:23 +0200
From: David Hildenbrand <david@...hat.com>
To: jane.chu@...cle.com, harry.yoo@...cle.com, osalvador@...e.de,
liushixin2@...wei.com, muchun.song@...ux.dev, akpm@...ux-foundation.org,
jannh@...gle.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm/hugetlb: fix copy_hugetlb_page_range() to use
->pt_share_count
On 11.09.25 21:58, jane.chu@...cle.com wrote:
>
>
> On 9/11/2025 1:17 AM, David Hildenbrand wrote:
> [..]
>>>
>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>>> index 753f99b4c718..8ca5b4f7805f 100644
>>> --- a/mm/hugetlb.c
>>> +++ b/mm/hugetlb.c
>>> @@ -5594,18 +5594,13 @@ int copy_hugetlb_page_range(struct mm_struct
>>> *dst, struct mm_struct *src,
>>> break;
>>> }
>>> - /*
>>> - * If the pagetables are shared don't copy or take references.
>>> - *
>>> - * dst_pte == src_pte is the common case of src/dest sharing.
>>> - * However, src could have 'unshared' and dst shares with
>>> - * another vma. So page_count of ptep page is checked instead
>>> - * to reliably determine whether pte is shared.
>>> - */
>>
>> I think you ignored my question to v1 regarding the change of comment.
>>
>
> Sorry David, didn't mean disrespect, I missed your earlier comments.
No worries. Replied there about possibly simplifying the comment further.
BTW, I think the code would be even clearer if we would have
ptdesc_pmd_is_shared()
that is simply a wrapper around the ptdesc_pmd_pts_count() check.
--
Cheers
David / dhildenb
Powered by blists - more mailing lists