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=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 0CE52C43457 for ; Tue, 20 Oct 2020 12:10:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 59F6122253 for ; Tue, 20 Oct 2020 12:10:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59F6122253 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A1AFA6B0068; Tue, 20 Oct 2020 08:10:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CB436B006C; Tue, 20 Oct 2020 08:10:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BA856B006E; Tue, 20 Oct 2020 08:10:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 5FE696B0068 for ; Tue, 20 Oct 2020 08:10:12 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E444482F404E for ; Tue, 20 Oct 2020 12:10:11 +0000 (UTC) X-FDA: 77392185822.15.offer54_4d0f88f2723f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id BEFC01814B0C8 for ; Tue, 20 Oct 2020 12:10:11 +0000 (UTC) X-HE-Tag: offer54_4d0f88f2723f X-Filterd-Recvd-Size: 4263 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 20 Oct 2020 12:10:11 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 23316ABD1; Tue, 20 Oct 2020 12:10:10 +0000 (UTC) To: Steven Rostedt , linux-kernel@vger.kernel.org Cc: Yafang Shao , Axel Rasmussen , Andrew Morton , Michel Lespinasse , Daniel Jordan , Davidlohr Bueso , Linux MM , Ingo Molnar , Joonsoo Kim , Michal Nazarewicz , Minchan Kim , Mel Gorman , "Kirill A. Shutemov" , Sergey Senozhatsky , Arnd Bergmann References: <20200925211206.423598568@goodmis.org> <20200925211819.908745401@goodmis.org> From: Vlastimil Babka Subject: Re: [PATCH 2/3 v2] mm/page_ref: Convert the open coded tracepoint enabled to the new helper Message-ID: Date: Tue, 20 Oct 2020 14:10:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20200925211819.908745401@goodmis.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 9/25/20 11:12 PM, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" >=20 > As more use cases of checking if a tracepoint is enabled in a header ar= e > coming to fruition, a helper macro, tracepoint_enabled(), has been adde= d to > check if a tracepoint is enabled or not, and can be used with minimal h= eader > requirements (avoid "include hell"). Convert the page_ref logic over to= the > new helper macro. >=20 > Cc: Joonsoo Kim > Cc: Michal Nazarewicz > Cc: Vlastimil Babka > Cc: Minchan Kim > Cc: Mel Gorman > Cc: "Kirill A. Shutemov" > Cc: Sergey Senozhatsky > Cc: Arnd Bergmann > Signed-off-by: Steven Rostedt (VMware) > --- > include/linux/page_ref.h | 42 ++++++++++++++++++++-------------------= - > 1 file changed, 21 insertions(+), 21 deletions(-) >=20 > diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h > index d27701199a4d..f3318f34fc54 100644 > --- a/include/linux/page_ref.h > +++ b/include/linux/page_ref.h > @@ -7,13 +7,13 @@ > #include > #include > =20 > -extern struct tracepoint __tracepoint_page_ref_set; > -extern struct tracepoint __tracepoint_page_ref_mod; > -extern struct tracepoint __tracepoint_page_ref_mod_and_test; > -extern struct tracepoint __tracepoint_page_ref_mod_and_return; > -extern struct tracepoint __tracepoint_page_ref_mod_unless; > -extern struct tracepoint __tracepoint_page_ref_freeze; > -extern struct tracepoint __tracepoint_page_ref_unfreeze; > +DECLARE_TRACEPOINT(page_ref_set); > +DECLARE_TRACEPOINT(page_ref_mod); > +DECLARE_TRACEPOINT(page_ref_mod_and_test); > +DECLARE_TRACEPOINT(page_ref_mod_and_return); > +DECLARE_TRACEPOINT(page_ref_mod_unless); > +DECLARE_TRACEPOINT(page_ref_freeze); > +DECLARE_TRACEPOINT(page_ref_unfreeze); > =20 > #ifdef CONFIG_DEBUG_PAGE_REF Not that it matters much, but the declarations could be below the #ifdef,= AFAICS. > =20 > @@ -24,7 +24,7 @@ extern struct tracepoint __tracepoint_page_ref_unfree= ze; > * > * See trace_##name##_enabled(void) in include/linux/tracepoint.h > */ > -#define page_ref_tracepoint_active(t) static_key_false(&(t).key) > +#define page_ref_tracepoint_active(t) tracepoint_enabled(t) The full comment above could now be deleted too? Acked-by: Vlastimil Babka Thanks!