]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/slub: Convert node_match() to take a struct slab
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Oct 2021 19:44:45 +0000 (15:44 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:17:59 +0000 (09:17 -0400)
Removes a few calls to slab_page()

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

index 827196f0aee5ee08bb4db0c680ac5f160b8468fb..e6c363d8de227da4fa38093d3b48435d74b67059 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2720,10 +2720,10 @@ static int slub_cpu_dead(unsigned int cpu)
  * Check if the objects in a per cpu structure fit numa
  * locality expectations.
  */
-static inline int node_match(struct page *page, int node)
+static inline int node_match(struct slab *slab, int node)
 {
 #ifdef CONFIG_NUMA
-       if (node != NUMA_NO_NODE && page_to_nid(page) != node)
+       if (node != NUMA_NO_NODE && slab_nid(slab) != node)
                return 0;
 #endif
        return 1;
@@ -2892,7 +2892,7 @@ reread_slab:
        }
 redo:
 
-       if (unlikely(!node_match(slab_page(slab), node))) {
+       if (unlikely(!node_match(slab, node))) {
                /*
                 * same as above but node_match() being false already
                 * implies node != NUMA_NO_NODE
@@ -3168,7 +3168,7 @@ redo:
         * there is a suitable cpu freelist.
         */
        if (IS_ENABLED(CONFIG_PREEMPT_RT) ||
-           unlikely(!object || !slab || !node_match(slab_page(slab), node))) {
+           unlikely(!object || !slab || !node_match(slab, node))) {
                object = __slab_alloc(s, gfpflags, node, addr, c);
        } else {
                void *next_object = get_freepointer_safe(s, object);