@@ -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);
This argument was unused. Fix up some comments and rename a parameter. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- mm/slub.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)