From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34E59C07E96 for ; Mon, 5 Jul 2021 03:21:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9090613C1 for ; Mon, 5 Jul 2021 03:21:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9090613C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5DA016B0011; Sun, 4 Jul 2021 23:21:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B1A86B0036; Sun, 4 Jul 2021 23:21:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 453426B005D; Sun, 4 Jul 2021 23:21:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 2153A6B0011 for ; Sun, 4 Jul 2021 23:21:29 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9C1438248047 for ; Mon, 5 Jul 2021 03:21:28 +0000 (UTC) X-FDA: 78327083856.36.4755455 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 1FDFF10015FB for ; Mon, 5 Jul 2021 03:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Uyi3dGXOAbIOJd7YWHBSfk15jYVVRDs3BwEnju0HB+g=; b=iCDc5WaFLUOylkXScUecwCi8xL luN19mrIQDU4G+Y0GREridkhZtrH8YBG+1+abFaOpeZO7VxyvF92UqRyQb6nP535rJ+gc+Tf7cB5a /FoKo/8TokUJOYSP6XH2TeWQRsdOXT4TKXZsdPxFfZHuq2N1AqYqXHnr1zHJd5EKNeLXJIT8tHo2B ZPlLpZvpT2urW9fzh8qeIp2LrrBclfsH/kPiY7glKG1xtPSxHoI7xXX5c7WyRoDCjL1XQAunLGBzV QYa6UCtiPYX0SIyhesPZtoXgaqtne5IGbwbEB8xVgYxyNyof9xL/kYqXzsjB4JN0INA9oVE7rynFD kxUF2BNA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0F9U-009qSU-3E; Mon, 05 Jul 2021 03:20:20 +0000 Date: Mon, 5 Jul 2021 04:20:08 +0100 From: Matthew Wilcox To: yee.lee@mediatek.com Cc: linux-kernel@vger.kernel.org, wsd_upstream@mediatek.com, nicholas.Tang@mediatek.com, Kuan-Ying.lee@mediatek.com, chinwen.chang@mediatek.com, Marco Elver , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Matthias Brugger , "open list:SLAB ALLOCATOR" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v5 1/2] mm: introduce helper to check slub_debug_enabled Message-ID: References: <20210705024101.1567-1-yee.lee@mediatek.com> <20210705024101.1567-2-yee.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210705024101.1567-2-yee.lee@mediatek.com> Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=iCDc5WaF; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-Stat-Signature: gczzsejqwmog5f4eakb1nfhaxuuzbabh X-Rspamd-Queue-Id: 1FDFF10015FB X-HE-Tag: 1625455287-246434 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 05, 2021 at 10:40:57AM +0800, yee.lee@mediatek.com wrote: > From: Marco Elver > > 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); }