summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorHyeonggon Yoo <42.hyeyoo@gmail.com>2021-12-12 09:52:41 +0300
committerVlastimil Babka <vbabka@suse.cz>2022-01-06 14:27:28 +0300
commitb01af5c0b0414f96e6c3891e704d1c40faa18813 (patch)
tree0ca12daa8bfedb0f814c63a647aac4a0498a74e9 /mm
parentc5e97ed154589524a1df4ae2be55c4cfdb0d0573 (diff)
downloadlinux-b01af5c0b0414f96e6c3891e704d1c40faa18813.tar.xz
mm/slob: Remove unnecessary page_mapcount_reset() function call
After commit 401fb12c68c2 ("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
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.h4
-rw-r--r--mm/slob.c1
2 files changed, 2 insertions, 3 deletions
diff --git a/mm/slab.h b/mm/slab.h
index f14e723b9e3c..95b9a74a2d51 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -50,8 +50,8 @@ struct slab {
struct list_head slab_list;
void *__unused_1;
void *freelist; /* first free block */
- void *__unused_2;
- int units;
+ long units;
+ unsigned int __unused_2;
#else
#error "Unexpected slab allocator configured"
diff --git a/mm/slob.c b/mm/slob.c
index 3c6cadbbc238..60c5842215f1 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -404,7 +404,6 @@ static void slob_free(void *block, int size)
clear_slob_page_free(sp);
spin_unlock_irqrestore(&slob_lock, flags);
__folio_clear_slab(slab_folio(sp));
- page_mapcount_reset(slab_page(sp));
slob_free_pages(b, 0);
return;
}