diff mbox series

[v2,32/33] mm/slub: Simplify struct slab slabs field definition

Message ID 20211201181510.18784-33-vbabka@suse.cz (mailing list archive)
State New
Headers show
Series Separate struct slab from struct page | expand

Commit Message

Vlastimil Babka Dec. 1, 2021, 6:15 p.m. UTC
Before commit b47291ef02b0 ("mm, slub: change percpu partial accounting from
objects to pages") we had to fit two integer fields into a native word size, so
we used short int on 32-bit and int on 64-bit via #ifdef. After that commit
there is only one integer field, so we can simply define it as int everywhere.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 mm/slab.h | 4 ----
 1 file changed, 4 deletions(-)

Comments

Johannes Weiner Dec. 14, 2021, 3:06 p.m. UTC | #1
On Wed, Dec 01, 2021 at 07:15:09PM +0100, Vlastimil Babka wrote:
> Before commit b47291ef02b0 ("mm, slub: change percpu partial accounting from
> objects to pages") we had to fit two integer fields into a native word size, so
> we used short int on 32-bit and int on 64-bit via #ifdef. After that commit
> there is only one integer field, so we can simply define it as int everywhere.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
diff mbox series

Patch

diff --git a/mm/slab.h b/mm/slab.h
index 8c5a8c005896..ee4344a44987 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -27,11 +27,7 @@  struct slab {
 		struct rcu_head rcu_head;
 		struct {
 			struct slab *next;
-#ifdef CONFIG_64BIT
 			int slabs;	/* Nr of slabs left */
-#else
-			short int slabs;
-#endif
 		};
 	};
 	struct kmem_cache *slab_cache;