[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2LfSjdJmgQHPTLA@x1n>
Date: Wed, 2 Nov 2022 17:21:14 -0400
From: Peter Xu <peterx@...hat.com>
To: Nadav Amit <nadav.amit@...il.com>
Cc: Linux-MM <linux-mm@...ck.org>,
kernel list <linux-kernel@...r.kernel.org>,
James Houghton <jthoughton@...gle.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
David Hildenbrand <david@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Rik van Riel <riel@...riel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Muchun Song <songmuchun@...edance.com>,
Miaohe Lin <linmiaohe@...wei.com>
Subject: Re: [PATCH RFC 10/10] mm/hugetlb: Comment at rest huge_pte_offset()
places
On Mon, Oct 31, 2022 at 10:39:33PM -0700, Nadav Amit wrote:
> On Oct 30, 2022, at 2:30 PM, Peter Xu <peterx@...hat.com> wrote:
>
> > + /* With vma lock held, safe without RCU */
> > src_pte = huge_pte_offset(src, addr, sz);
>
> Just another option to consider: you can create an inline function
> huge_pte_offset_locked_mm(), which would do the lockdep_assert_held_*().
>
> I personally would prefer it, since it would clarify exactly the lock you
> care about and "make the code document itself”.
That's a great suggestion, I'll give it a shot in the next version.
Thanks!
--
Peter Xu
Powered by blists - more mailing lists