]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/gup: use gup_can_follow_protnone() also in GUP-fast
authorDavid Hildenbrand <david@redhat.com>
Thu, 25 Aug 2022 16:46:58 +0000 (18:46 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:03:30 +0000 (22:03 -0700)
commit228a3acc5b154daa33a52b44a66fb5fdea6cfdbd
treeb18fdada6299b5164c34b93766a7452426b3ee19
parentda462269baba8d9caa9895da6aeb2524f7efe6f6
mm/gup: use gup_can_follow_protnone() also in GUP-fast

There seems to be no reason why FOLL_FORCE during GUP-fast would have to
fallback to the slow path when stumbling over a PROT_NONE mapped page.  We
only have to trigger hinting faults in case FOLL_FORCE is not set, and any
kind of fault handling naturally happens from the slow path -- where NUMA
hinting accounting/handling would be performed.

Note that the comment regarding THP migration is outdated: commit
2b4847e73004 ("mm: numa: serialise parallel get_user_page against THP
migration") described that this was required for THP due to lack of PMD
migration entries.  Nowadays, we do have proper PMD migration entries in
place -- see set_pmd_migration_entry(), which does a proper
pmdp_invalidate() when placing the migration entry.

So let's just reuse gup_can_follow_protnone() here to make it consistent
and drop the somewhat outdated comments.

Link: https://lkml.kernel.org/r/20220825164659.89824-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/gup.c