Skip to content

Commit b01af5c

Browse files
hygonitehcaster
authored andcommitted
mm/slob: Remove unnecessary page_mapcount_reset() function call
After commit 401fb12 ("mm/sl*b: Differentiate struct slab fields by sl*b implementations"), we can reorder fields of struct slab depending on slab allocator. For now, page_mapcount_reset() is called because page->_mapcount and slab->units have same offset. But this is not necessary for struct slab. Use unused field for units instead. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Link: https://lore.kernel.org/r/20211212065241.GA886691@odroid
1 parent c5e97ed commit b01af5c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

mm/slab.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct slab {
5050
struct list_head slab_list;
5151
void *__unused_1;
5252
void *freelist; /* first free block */
53-
void *__unused_2;
54-
int units;
53+
long units;
54+
unsigned int __unused_2;
5555

5656
#else
5757
#error "Unexpected slab allocator configured"

mm/slob.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ static void slob_free(void *block, int size)
404404
clear_slob_page_free(sp);
405405
spin_unlock_irqrestore(&slob_lock, flags);
406406
__folio_clear_slab(slab_folio(sp));
407-
page_mapcount_reset(slab_page(sp));
408407
slob_free_pages(b, 0);
409408
return;
410409
}

0 commit comments

Comments
 (0)