[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61751d01-2ba4-efc0-9cb8-eeeb3d70908d@nvidia.com>
Date: Thu, 8 Dec 2022 13:54:27 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Peter Xu <peterx@...hat.com>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
Jann Horn <jannh@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
James Houghton <jthoughton@...gle.com>,
Rik van Riel <riel@...riel.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Nadav Amit <nadav.amit@...il.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
David Hildenbrand <david@...hat.com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
Muchun Song <songmuchun@...edance.com>
Subject: Re: [PATCH v2 10/10] mm/hugetlb: Document why page_vma_mapped_walk()
is safe to walk
On 12/8/22 13:05, Peter Xu wrote:
>>> + /*
>>> + * NOTE: we don't need explicit lock here to walk the
>>> + * hugetlb pgtable because either (1) potential callers of
>>> + * hugetlb pvmw currently holds i_mmap_rwsem, or (2) the
>>> + * caller will not walk a hugetlb vma (e.g. ksm or uprobe).
>>> + * When one day this rule breaks, one will get a warning
>>> + * in hugetlb_walk(), and then we'll figure out what to do.
>>> + */
>>
>> Confused. Is this documentation actually intended to refer to hugetlb_walk()
>> itself, or just this call site? If the former, then let's move it over
>> to be right before hugetlb_walk().
>
> It is for this specific code path not hugetlb_walk().
>
> The "holds i_mmap_rwsem" here is a true statement (not requirement) because
> PVMW rmap walkers always have that. That satisfies with hugetlb_walk()
> requirements already even without holding the vma lock.
>
It's really hard to understand. Do you have a few extra words to explain it?
I can help with actual comment wording perhaps, but I am still a bit in
the dark as to the actual meaning. :)
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists