mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
Merge cc09ee80c3 ("Merge tag 'mm-slub-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux") into android-mainline
Steps on the way to 5.15-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I8fd7a6384a9cc7b6c607d755150accbcfa07fb6b
This commit is contained in:
2
Makefile
2
Makefile
@@ -815,6 +815,8 @@ else
|
||||
# Disabled for clang while comment to attribute conversion happens and
|
||||
# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
|
||||
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=5,)
|
||||
# gcc inanely warns about local variables called 'main'
|
||||
KBUILD_CFLAGS += -Wno-main
|
||||
endif
|
||||
|
||||
# These warnings generated too much noise in a regular build.
|
||||
|
||||
@@ -778,6 +778,15 @@ static inline int PageSlabPfmemalloc(struct 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);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <linux/kfence.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/reciprocal_div.h>
|
||||
#include <linux/local_lock.h>
|
||||
|
||||
enum stat_item {
|
||||
ALLOC_FASTPATH, /* Allocation from cpu slab */
|
||||
@@ -40,6 +41,10 @@ enum stat_item {
|
||||
CPU_PARTIAL_DRAIN, /* Drain cpu partial to node partial */
|
||||
NR_SLUB_STAT_ITEMS };
|
||||
|
||||
/*
|
||||
* When changing the layout, make sure freelist and tid are still compatible
|
||||
* with this_cpu_cmpxchg_double() alignment requirements.
|
||||
*/
|
||||
struct kmem_cache_cpu {
|
||||
void **freelist; /* Pointer to next available object */
|
||||
unsigned long tid; /* Globally unique transaction id */
|
||||
@@ -47,6 +52,7 @@ struct kmem_cache_cpu {
|
||||
#ifdef CONFIG_SLUB_CPU_PARTIAL
|
||||
struct page *partial; /* Partially allocated frozen slabs */
|
||||
#endif
|
||||
local_lock_t lock; /* Protects the fields above */
|
||||
#ifdef CONFIG_SLUB_STATS
|
||||
unsigned stat[NR_SLUB_STAT_ITEMS];
|
||||
#endif
|
||||
|
||||
@@ -502,6 +502,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
|
||||
if (unlikely(!s))
|
||||
return;
|
||||
|
||||
cpus_read_lock();
|
||||
mutex_lock(&slab_mutex);
|
||||
|
||||
s->refcount--;
|
||||
@@ -516,6 +517,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
|
||||
}
|
||||
out_unlock:
|
||||
mutex_unlock(&slab_mutex);
|
||||
cpus_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL(kmem_cache_destroy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user