[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YOJ6aPuNOtzjVhBC@casper.infradead.org>
Date: Mon, 5 Jul 2021 04:20:08 +0100
From: Matthew Wilcox <willy@...radead.org>
To: yee.lee@...iatek.com
Cc: linux-kernel@...r.kernel.org, wsd_upstream@...iatek.com,
nicholas.Tang@...iatek.com, Kuan-Ying.lee@...iatek.com,
chinwen.chang@...iatek.com, Marco Elver <elver@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Matthias Brugger <matthias.bgg@...il.com>,
"open list:SLAB ALLOCATOR" <linux-mm@...ck.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v5 1/2] mm: introduce helper to check slub_debug_enabled
On Mon, Jul 05, 2021 at 10:40:57AM +0800, yee.lee@...iatek.com wrote:
> From: Marco Elver <elver@...gle.com>
>
> Introduce a helper to check slub_debug_enabled, so that we can confine
> the use of #ifdef to the definition of the slub_debug_enabled_unlikely()
> helper.
We don't usually embed '_unlikely' in function names; we
just do:
static inline bool slub_debug_enabled(void)
{
return static_branch_unlikely(&slub_debug_enabled);
}
eg:
static inline bool cpusets_enabled(void)
{
return static_branch_unlikely(&cpusets_enabled_key);
}
#define cgroup_bpf_enabled(type) static_branch_unlikely(&cgroup_bpf_enabled_key[type])
static inline int ip_tunnel_collect_metadata(void)
{
return static_branch_unlikely(&ip_tunnel_metadata_cnt);
}
static inline bool frontswap_enabled(void)
{
return static_branch_unlikely(&frontswap_enabled_key);
}
Powered by blists - more mailing lists