]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/slub: Remove struct page argument to next_freelist_entry()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Oct 2021 22:00:07 +0000 (18:00 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:17:59 +0000 (09:17 -0400)
This argument was unused.  Fix up some comments and rename a parameter.

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

index 9a67dda37951b46ec4b91bdbfaa0d15bc2caed52..14a4232506112b46c99cf89087584581c44e0668 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1809,23 +1809,23 @@ static void __init init_freelist_randomization(void)
 }
 
 /* Get the next entry on the pre-computed freelist randomized */
-static void *next_freelist_entry(struct kmem_cache *s, struct page *page,
+static void *next_freelist_entry(struct kmem_cache *s,
                                unsigned long *pos, void *start,
-                               unsigned long page_limit,
+                               unsigned long slab_limit,
                                unsigned long freelist_count)
 {
        unsigned int idx;
 
        /*
-        * If the target page allocation failed, the number of objects on the
-        * page might be smaller than the usual size defined by the cache.
+        * If the target slab allocation failed, the number of objects in the
+        * slab might be smaller than the usual size defined by the cache.
         */
        do {
                idx = s->random_seq[*pos];
                *pos += 1;
                if (*pos >= freelist_count)
                        *pos = 0;
-       } while (unlikely(idx >= page_limit));
+       } while (unlikely(idx >= slab_limit));
 
        return (char *)start + idx;
 }
@@ -1848,13 +1848,12 @@ static bool shuffle_freelist(struct kmem_cache *s, struct slab *slab)
        start = fixup_red_left(s, slab_address(slab));
 
        /* First entry is used as the base of the freelist */
-       cur = next_freelist_entry(s, slab_page(slab), &pos, start, slab_limit,
-                               freelist_count);
+       cur = next_freelist_entry(s, &pos, start, slab_limit, freelist_count);
        cur = setup_object(s, slab_page(slab), cur);
        slab->freelist = cur;
 
        for (idx = 1; idx < slab->objects; idx++) {
-               next = next_freelist_entry(s, slab_page(slab), &pos, start, slab_limit,
+               next = next_freelist_entry(s, &pos, start, slab_limit,
                        freelist_count);
                next = setup_object(s, slab_page(slab), next);
                set_freepointer(s, cur, next);