public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: jane.chu@oracle.com
To: David Hildenbrand <david@redhat.com>,
	harry.yoo@oracle.com, osalvador@suse.de, liushixin2@huawei.com,
	muchun.song@linux.dev, akpm@linux-foundation.org,
	jannh@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/hugetlb: fix copy_hugetlb_page_range() to use ->pt_share_count
Date: Mon, 15 Sep 2025 09:52:51 -0700	[thread overview]
Message-ID: <baf2edec-f3fa-444d-8365-4adecef99e72@oracle.com> (raw)
In-Reply-To: <b5bba27f-e26f-4efc-a7e0-92a6d82b9bbb@redhat.com>



On 9/12/2025 12:32 AM, David Hildenbrand wrote:
> On 11.09.25 21:58, jane.chu@oracle.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.

Agreed, will add ptdesc_pmd_is_shared().

thanks a lot!

-jane>




      reply	other threads:[~2025-09-15 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 19:27 [PATCH v2] mm/hugetlb: fix copy_hugetlb_page_range() to use ->pt_share_count Jane Chu
2025-09-11  8:17 ` David Hildenbrand
2025-09-11 19:58   ` jane.chu
2025-09-12  7:32     ` David Hildenbrand
2025-09-15 16:52       ` jane.chu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baf2edec-f3fa-444d-8365-4adecef99e72@oracle.com \
    --to=jane.chu@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=harry.yoo@oracle.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liushixin2@huawei.com \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox