Skip to content

Commit e3a8b6a

Browse files
committed
Merge tag 'slab-for-5.17-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull more slab updates from Vlastimil Babka: "Finish the conversion to struct slab by removing slab-specific fields from struct page. The first slab update (see merge commit ca1a46d) did most of the conversion, but there was also series in iommu tree removing the iommu's usage of struct page 'freelist' field, blocking the final struct page cleanup. Now that the iommu changes have been merged, we can finish the job" * tag 'slab-for-5.17-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm: Remove slab from struct page
2 parents 62b4888 + 07f910f commit e3a8b6a

File tree

3 files changed

+0
-71
lines changed

3 files changed

+0
-71
lines changed

include/linux/mm_types.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,6 @@ struct page {
119119
atomic_long_t pp_frag_count;
120120
};
121121
};
122-
struct { /* slab, slob and slub */
123-
union {
124-
struct list_head slab_list;
125-
struct { /* Partial pages */
126-
struct page *next;
127-
#ifdef CONFIG_64BIT
128-
int pages; /* Nr of pages left */
129-
#else
130-
short int pages;
131-
#endif
132-
};
133-
};
134-
struct kmem_cache *slab_cache; /* not slob */
135-
/* Double-word boundary */
136-
void *freelist; /* first free object */
137-
union {
138-
void *s_mem; /* slab: first object */
139-
unsigned long counters; /* SLUB */
140-
struct { /* SLUB */
141-
unsigned inuse:16;
142-
unsigned objects:15;
143-
unsigned frozen:1;
144-
};
145-
};
146-
};
147122
struct { /* Tail pages of compound page */
148123
unsigned long compound_head; /* Bit zero is set */
149124

@@ -207,9 +182,6 @@ struct page {
207182
* which are currently stored here.
208183
*/
209184
unsigned int page_type;
210-
211-
unsigned int active; /* SLAB */
212-
int units; /* SLOB */
213185
};
214186

215187
/* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */

include/linux/page-flags.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -920,43 +920,6 @@ extern bool is_free_buddy_page(struct page *page);
920920

921921
__PAGEFLAG(Isolated, isolated, PF_ANY);
922922

923-
/*
924-
* If network-based swap is enabled, sl*b must keep track of whether pages
925-
* were allocated from pfmemalloc reserves.
926-
*/
927-
static inline int PageSlabPfmemalloc(struct page *page)
928-
{
929-
VM_BUG_ON_PAGE(!PageSlab(page), page);
930-
return PageActive(page);
931-
}
932-
933-
/*
934-
* A version of PageSlabPfmemalloc() for opportunistic checks where the page
935-
* might have been freed under us and not be a PageSlab anymore.
936-
*/
937-
static inline int __PageSlabPfmemalloc(struct page *page)
938-
{
939-
return PageActive(page);
940-
}
941-
942-
static inline void SetPageSlabPfmemalloc(struct page *page)
943-
{
944-
VM_BUG_ON_PAGE(!PageSlab(page), page);
945-
SetPageActive(page);
946-
}
947-
948-
static inline void __ClearPageSlabPfmemalloc(struct page *page)
949-
{
950-
VM_BUG_ON_PAGE(!PageSlab(page), page);
951-
__ClearPageActive(page);
952-
}
953-
954-
static inline void ClearPageSlabPfmemalloc(struct page *page)
955-
{
956-
VM_BUG_ON_PAGE(!PageSlab(page), page);
957-
ClearPageActive(page);
958-
}
959-
960923
#ifdef CONFIG_MMU
961924
#define __PG_MLOCKED (1UL << PG_mlocked)
962925
#else

mm/slab.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,8 @@ struct slab {
6767
static_assert(offsetof(struct page, pg) == offsetof(struct slab, sl))
6868
SLAB_MATCH(flags, __page_flags);
6969
SLAB_MATCH(compound_head, slab_list); /* Ensure bit 0 is clear */
70-
SLAB_MATCH(slab_list, slab_list);
7170
#ifndef CONFIG_SLOB
7271
SLAB_MATCH(rcu_head, rcu_head);
73-
SLAB_MATCH(slab_cache, slab_cache);
74-
#endif
75-
#ifdef CONFIG_SLAB
76-
SLAB_MATCH(s_mem, s_mem);
77-
SLAB_MATCH(active, active);
7872
#endif
7973
SLAB_MATCH(_refcount, __page_refcount);
8074
#ifdef CONFIG_MEMCG

0 commit comments

Comments
 (0)