Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 801481 | Differences between
and this patch

Collapse All | Expand All

(-)a/include/linux/mm.h (-6 / +4 lines)
Lines 2947-2966 static inline void kernel_poison_pages(struct page *page, int numpages) { } Link Here
2947
static inline void kernel_unpoison_pages(struct page *page, int numpages) { }
2947
static inline void kernel_unpoison_pages(struct page *page, int numpages) { }
2948
#endif
2948
#endif
2949
2949
2950
DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc);
2950
DECLARE_STATIC_KEY_FALSE(init_on_alloc);
2951
static inline bool want_init_on_alloc(gfp_t flags)
2951
static inline bool want_init_on_alloc(gfp_t flags)
2952
{
2952
{
2953
	if (static_branch_maybe(CONFIG_INIT_ON_ALLOC_DEFAULT_ON,
2953
	if (static_branch_unlikely(&init_on_alloc))
2954
				&init_on_alloc))
2955
		return true;
2954
		return true;
2956
	return flags & __GFP_ZERO;
2955
	return flags & __GFP_ZERO;
2957
}
2956
}
2958
2957
2959
DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free);
2958
DECLARE_STATIC_KEY_FALSE(init_on_free);
2960
static inline bool want_init_on_free(void)
2959
static inline bool want_init_on_free(void)
2961
{
2960
{
2962
	return static_branch_maybe(CONFIG_INIT_ON_FREE_DEFAULT_ON,
2961
	return static_branch_unlikely(&init_on_free);
2963
				   &init_on_free);
2964
}
2962
}
2965
2963
2966
extern bool _debug_pagealloc_enabled_early;
2964
extern bool _debug_pagealloc_enabled_early;
(-)a/mm/page_alloc.c (-2 / +2 lines)
Lines 177-186 unsigned long totalcma_pages __read_mostly; Link Here
177
177
178
int percpu_pagelist_fraction;
178
int percpu_pagelist_fraction;
179
gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
179
gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
180
DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc);
180
DEFINE_STATIC_KEY_FALSE(init_on_alloc);
181
EXPORT_SYMBOL(init_on_alloc);
181
EXPORT_SYMBOL(init_on_alloc);
182
182
183
DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free);
183
DEFINE_STATIC_KEY_FALSE(init_on_free);
184
EXPORT_SYMBOL(init_on_free);
184
EXPORT_SYMBOL(init_on_free);
185
185
186
static bool _init_on_alloc_enabled_early __read_mostly
186
static bool _init_on_alloc_enabled_early __read_mostly
(-)a/mm/slab.h (-4 / +2 lines)
Lines 610-617 static inline void cache_random_seq_destroy(struct kmem_cache *cachep) { } Link Here
610
610
611
static inline bool slab_want_init_on_alloc(gfp_t flags, struct kmem_cache *c)
611
static inline bool slab_want_init_on_alloc(gfp_t flags, struct kmem_cache *c)
612
{
612
{
613
	if (static_branch_maybe(CONFIG_INIT_ON_ALLOC_DEFAULT_ON,
613
	if (static_branch_unlikely(&init_on_alloc)) {
614
				&init_on_alloc)) {
615
		if (c->ctor)
614
		if (c->ctor)
616
			return false;
615
			return false;
617
		if (c->flags & (SLAB_TYPESAFE_BY_RCU | SLAB_POISON))
616
		if (c->flags & (SLAB_TYPESAFE_BY_RCU | SLAB_POISON))
Lines 623-630 static inline bool slab_want_init_on_alloc(gfp_t flags, struct kmem_cache *c) Link Here
623
622
624
static inline bool slab_want_init_on_free(struct kmem_cache *c)
623
static inline bool slab_want_init_on_free(struct kmem_cache *c)
625
{
624
{
626
	if (static_branch_maybe(CONFIG_INIT_ON_FREE_DEFAULT_ON,
625
	if (static_branch_unlikely(&init_on_free))
627
				&init_on_free))
628
		return !(c->ctor ||
626
		return !(c->ctor ||
629
			 (c->flags & (SLAB_TYPESAFE_BY_RCU | SLAB_POISON)));
627
			 (c->flags & (SLAB_TYPESAFE_BY_RCU | SLAB_POISON)));
630
	return false;
628
	return false;

Return to bug 801481