]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/slub: Remove pfmemalloc_match_unsafe()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 2 Oct 2021 03:22:58 +0000 (23:22 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:18:01 +0000 (09:18 -0400)
slab_test_pfmemalloc() doesn't need to check PageSlab() (unlike
PageSlabPfmemalloc()), so we don't need a pfmemalloc_match_unsafe()
variant any more.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/slub.c

index 7e2c5342196a52d35ec946661942891259dfbca9..229fc56809c26646507294bc2220275495fd2f61 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2796,19 +2796,6 @@ static inline bool pfmemalloc_match(struct slab *slab, gfp_t gfpflags)
        return true;
 }
 
-/*
- * A variant of pfmemalloc_match() that tests page flags without asserting
- * PageSlab. Intended for opportunistic checks before taking a lock and
- * rechecking that nobody else freed the page under us.
- */
-static inline bool pfmemalloc_match_unsafe(struct page *page, gfp_t gfpflags)
-{
-       if (unlikely(__PageSlabPfmemalloc(page)))
-               return gfp_pfmemalloc_allowed(gfpflags);
-
-       return true;
-}
-
 /*
  * Check the freelist of a slab and either transfer the freelist to the
  * per cpu freelist or deactivate the slab
@@ -2905,7 +2892,7 @@ redo:
         * PFMEMALLOC but right now, we lose the pfmemalloc
         * information when the page leaves the per-cpu allocator
         */
-       if (unlikely(!pfmemalloc_match_unsafe(slab_page(slab), gfpflags)))
+       if (unlikely(!pfmemalloc_match(slab, gfpflags)))
                goto deactivate_slab;
 
        /* must check again c->slab in case we got preempted and it changed */