slab changes for 5.17 - part 2
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEjUuTAak14xi+SF7M4CHKc/GJqRAFAmHliSgACgkQ4CHKc/GJ
qRDPhAgAjvSnw9q4vBW2nqDAQ9Iapz8XAVDmTzaT/Bnbt9MMF8hf+BDBsqq0MC4C
aEa/vgPOTs9hNv+H0r3v2bkiGs0n6cA6jdUoFo272qlV+mOJbhcpCb7scX2P1vqn
mzZDe3y9qAoPoQnHs8zausqeIsTjuTVCpMdW1ONeGoF1HHScI22Z+XLwz9hNeit5
6ICZvwsD7raD3iVxG+LWA2dP9iq4+frlovO62LOkPX55QNJzWICzukog+05WyaxH
v07GIbBioSGd8DBdgkgRfHh5CdHVTjWPXDywTFpWf966jAH+OcsaEd9k7zYvzIhK
p/8mylhPyObHHrvLZfK9iLQgyiFa2A==
=i+Cl
-----END PGP SIGNATURE-----
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 ca1a46d6f5
) 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
This commit is contained in:
Коммит
e3a8b6a1e7
|
@ -119,31 +119,6 @@ struct page {
|
|||
atomic_long_t pp_frag_count;
|
||||
};
|
||||
};
|
||||
struct { /* slab, slob and slub */
|
||||
union {
|
||||
struct list_head slab_list;
|
||||
struct { /* Partial pages */
|
||||
struct page *next;
|
||||
#ifdef CONFIG_64BIT
|
||||
int pages; /* Nr of pages left */
|
||||
#else
|
||||
short int pages;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
struct kmem_cache *slab_cache; /* not slob */
|
||||
/* Double-word boundary */
|
||||
void *freelist; /* first free object */
|
||||
union {
|
||||
void *s_mem; /* slab: first object */
|
||||
unsigned long counters; /* SLUB */
|
||||
struct { /* SLUB */
|
||||
unsigned inuse:16;
|
||||
unsigned objects:15;
|
||||
unsigned frozen:1;
|
||||
};
|
||||
};
|
||||
};
|
||||
struct { /* Tail pages of compound page */
|
||||
unsigned long compound_head; /* Bit zero is set */
|
||||
|
||||
|
@ -207,9 +182,6 @@ struct page {
|
|||
* which are currently stored here.
|
||||
*/
|
||||
unsigned int page_type;
|
||||
|
||||
unsigned int active; /* SLAB */
|
||||
int units; /* SLOB */
|
||||
};
|
||||
|
||||
/* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */
|
||||
|
|
|
@ -920,43 +920,6 @@ extern bool is_free_buddy_page(struct page *page);
|
|||
|
||||
__PAGEFLAG(Isolated, isolated, PF_ANY);
|
||||
|
||||
/*
|
||||
* If network-based swap is enabled, sl*b must keep track of whether pages
|
||||
* were allocated from pfmemalloc reserves.
|
||||
*/
|
||||
static inline int PageSlabPfmemalloc(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageSlab(page), page);
|
||||
return PageActive(page);
|
||||
}
|
||||
|
||||
/*
|
||||
* A version of PageSlabPfmemalloc() for opportunistic checks where the page
|
||||
* might have been freed under us and not be a PageSlab anymore.
|
||||
*/
|
||||
static inline int __PageSlabPfmemalloc(struct page *page)
|
||||
{
|
||||
return PageActive(page);
|
||||
}
|
||||
|
||||
static inline void SetPageSlabPfmemalloc(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageSlab(page), page);
|
||||
SetPageActive(page);
|
||||
}
|
||||
|
||||
static inline void __ClearPageSlabPfmemalloc(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageSlab(page), page);
|
||||
__ClearPageActive(page);
|
||||
}
|
||||
|
||||
static inline void ClearPageSlabPfmemalloc(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageSlab(page), page);
|
||||
ClearPageActive(page);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#define __PG_MLOCKED (1UL << PG_mlocked)
|
||||
#else
|
||||
|
|
|
@ -67,14 +67,8 @@ struct slab {
|
|||
static_assert(offsetof(struct page, pg) == offsetof(struct slab, sl))
|
||||
SLAB_MATCH(flags, __page_flags);
|
||||
SLAB_MATCH(compound_head, slab_list); /* Ensure bit 0 is clear */
|
||||
SLAB_MATCH(slab_list, slab_list);
|
||||
#ifndef CONFIG_SLOB
|
||||
SLAB_MATCH(rcu_head, rcu_head);
|
||||
SLAB_MATCH(slab_cache, slab_cache);
|
||||
#endif
|
||||
#ifdef CONFIG_SLAB
|
||||
SLAB_MATCH(s_mem, s_mem);
|
||||
SLAB_MATCH(active, active);
|
||||
#endif
|
||||
SLAB_MATCH(_refcount, __page_refcount);
|
||||
#ifdef CONFIG_MEMCG
|
||||
|
|
Загрузка…
Ссылка в новой задаче