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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3CB65C433E6 for ; Mon, 25 Jan 2021 21:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F289F2080D for ; Mon, 25 Jan 2021 21:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732423AbhAYVB7 (ORCPT ); Mon, 25 Jan 2021 16:01:59 -0500 Received: from foss.arm.com ([217.140.110.172]:58644 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732117AbhAYTrm (ORCPT ); Mon, 25 Jan 2021 14:47:42 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 03AF731B; Mon, 25 Jan 2021 11:46:06 -0800 (PST) Received: from e107158-lin (unknown [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 000763F66E; Mon, 25 Jan 2021 11:46:04 -0800 (PST) Date: Mon, 25 Jan 2021 19:46:02 +0000 From: Qais Yousef To: John Ogness Cc: Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Thomas Gleixner , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] printk: Add new pr_*_deferred_once() variants Message-ID: <20210125194602.4ayir2tmlllmrnk4@e107158-lin> References: <20210123233741.3614408-1-qais.yousef@arm.com> <20210123233741.3614408-2-qais.yousef@arm.com> <87y2gh2shy.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87y2gh2shy.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/21 12:04, John Ogness wrote: > On 2021-01-25, Peter Zijlstra wrote: > > On Sat, Jan 23, 2021 at 11:37:40PM +0000, Qais Yousef wrote: > >> To allow users in code where printk is not allowed. > >> > >> Signed-off-by: Qais Yousef > >> --- > >> include/linux/printk.h | 24 ++++++++++++++++++++++++ > >> 1 file changed, 24 insertions(+) > >> > >> diff --git a/include/linux/printk.h b/include/linux/printk.h > >> index fe7eb2351610..92c0978c7b44 100644 > >> --- a/include/linux/printk.h > >> +++ b/include/linux/printk.h > >> @@ -480,21 +480,45 @@ extern int kptr_restrict; > >> printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > >> /* no pr_cont_once, don't do that... */ > >> > >> +#define pr_emerg_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_alert_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_crit_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_err_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_warn_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_notice_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) > >> +#define pr_info_deferred_once(fmt, ...) \ > >> + printk_deferred_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > >> +/* no pr_cont_deferred_once, don't do that... */ > > > > I absolutely detest this.. the whole _deferred thing is an > > abomination. > > And it will disappear at some point. > > > We should be very close to printk not needing this anymore, printk > > people? > > It will disappear once console printing threads are introduced. We > probably still have a few kernel releases until we see that. First we > need to finish merging full lockless access, remove the safe buffers, > and merge the atomic consoles. Okay. As I said in the cover letter, I didn't think the addition of these new macros looked like a win overall. I will drop this patch and just open code the use of printk_deferred_once() in hrtimer_interrupt(). Which should be easier to fix later when it should disappear. Thanks -- Qais Yousef