mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mm/slob: Remove unnecessary page_mapcount_reset() function call
After commit 401fb12c68
("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
This commit is contained in:
parent
c5e97ed154
commit
b01af5c0b0
2 changed files with 2 additions and 3 deletions
|
@ -50,8 +50,8 @@ struct slab {
|
||||||
struct list_head slab_list;
|
struct list_head slab_list;
|
||||||
void *__unused_1;
|
void *__unused_1;
|
||||||
void *freelist; /* first free block */
|
void *freelist; /* first free block */
|
||||||
void *__unused_2;
|
long units;
|
||||||
int units;
|
unsigned int __unused_2;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error "Unexpected slab allocator configured"
|
#error "Unexpected slab allocator configured"
|
||||||
|
|
|
@ -404,7 +404,6 @@ static void slob_free(void *block, int size)
|
||||||
clear_slob_page_free(sp);
|
clear_slob_page_free(sp);
|
||||||
spin_unlock_irqrestore(&slob_lock, flags);
|
spin_unlock_irqrestore(&slob_lock, flags);
|
||||||
__folio_clear_slab(slab_folio(sp));
|
__folio_clear_slab(slab_folio(sp));
|
||||||
page_mapcount_reset(slab_page(sp));
|
|
||||||
slob_free_pages(b, 0);
|
slob_free_pages(b, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue