• Peter Xu's avatar
    mm/gup: cache *pudp in follow_pud_mask() · caf8cab7
    Peter Xu authored
    Introduce "pud_t pud" in the function, so the code won't dereference *pudp
    multiple time.  Not only because that looks less straightforward, but also
    because if the dereference really happened, it's not clear whether there
    can be race to see different *pudp values if it's being modified at the
    same time.
    
    Link: https://lkml.kernel.org/r/20240327152332.950956-10-peterx@redhat.comSigned-off-by: default avatarPeter Xu <peterx@redhat.com>
    Acked-by: default avatarJames Houghton <jthoughton@google.com>
    Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    Tested-by: default avatarRyan Roberts <ryan.roberts@arm.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Andrew Jones <andrew.jones@linux.dev>
    Cc: Aneesh Kumar K.V (IBM) <aneesh.kumar@kernel.org>
    Cc: Axel Rasmussen <axelrasmussen@google.com>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Lorenzo Stoakes <lstoakes@gmail.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: "Mike Rapoport (IBM)" <rppt@kernel.org>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Yang Shi <shy828301@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    caf8cab7
gup.c 97.5 KB