Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp85600pxk; Wed, 23 Sep 2020 23:35:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhV5U2+0nnY+twUDN+LPUy0dxBsr9G/ZvfwO8znD3JgM0TNP2FVUhEkmxykVBlzHMhXiAy X-Received: by 2002:a17:906:4754:: with SMTP id j20mr3217205ejs.293.1600929329383; Wed, 23 Sep 2020 23:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600929329; cv=none; d=google.com; s=arc-20160816; b=nGM9O4Za8E9cheggL04FvyB6/qM15ZNn/At3BI+abeasP+XMXQ4RImCSi8RKoE7kbk 70oGliYrbH8ZKAxQ7ffjQQCo2RVxpjhuBrnISK04wnemi0pUBbjt13AYKfkk5Ma2bYf0 PyL8xtxytDPjLHeHXRUs2BXMlG3FCQ1j/powLMVRWmBA744rGp3Qc/xlMTgBsEUen7lg Ilb0tJHl6aL9TnocjET2618+N64+7J89DtQ3WQ+fy4mr5+X5JubEbdiOoWaFg5SioF8+ o4S765VW+n3viJQvub10epQYX+VB4KKHm6XZH95AmkGge63tJpsd3tvaXwdikDsFOLtq HxgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Be+x03MTwXEJwLVsL8mvKrMQydoEu3mk8iDhT7GArcI=; b=nMa6ZmBeMO3fvtHvifZeSSjRTDSIrbkgiLJmftEzgITqRGUFOtJDIbbLFYlIYBeNo3 0r/PL79EN5/nJKYLKgxFhNw/Zc9acc/oPFVDsJC5v+WAVY9UCpzdpLsuLumcrq8wXHI1 cyuMYS665HjGar7RnrAiB40S/03hbB5W+BDKsbNTIN8VLHvQtdvoA9n1oX2uG6CTIeNZ JxmRzpCithW5v2Io34rd/floxHP7BL9QIsxKIpa5ztNNqtXwOSyLr25Rq3PSbd4/dLFg CwdaPrVQP4bCTaBpKPAzx4ubHaWFp4E8ieG4BVZ4uKJ5ej1e67cUlaPo4HdFxtUY5aje 0tQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FAo4sEaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si1469894edt.429.2020.09.23.23.35.02; Wed, 23 Sep 2020 23:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FAo4sEaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbgIXGd5 (ORCPT + 99 others); Thu, 24 Sep 2020 02:33:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:46582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbgIXGd5 (ORCPT ); Thu, 24 Sep 2020 02:33:57 -0400 Received: from localhost (unknown [84.241.198.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7C4A82311A; Thu, 24 Sep 2020 06:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600929237; bh=4/P3ZUYO2V2jRyA7YB32zRBOvcFdYM0p0Ma1pDQrDbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FAo4sEazkhdK5B0M9MG9nHzvZJzn+idWiYi7GAE0HvYBHYZVHtM4H61RitFksOEug vSWE0oyfS2DsID2B00xSqxOzSaip13wFW+oapcQ8+KkE9y5RhieLYgRhwLecv7OCHr /42XPUKdWpl9ldaKVip6S26E4mACsXPTT9BIqiRs= Date: Thu, 24 Sep 2020 08:33:52 +0200 From: Greg KH To: Prasad Sodagudi Cc: rostedt@goodmis.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, tkjos@google.com, Mohammed Khajapasha Subject: Re: [PATCH 2/2] printk: Make the console flush configurable in hotplug path Message-ID: <20200924063352.GB592892@kroah.com> References: <1600906112-126722-1-git-send-email-psodagud@codeaurora.org> <1600906112-126722-2-git-send-email-psodagud@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600906112-126722-2-git-send-email-psodagud@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 05:08:32PM -0700, Prasad Sodagudi wrote: > From: Mohammed Khajapasha > > The thread which initiates the hot plug can get scheduled > out, while trying to acquire the console lock, > thus increasing the hot plug latency. This option > allows to selectively disable the console flush and > in turn reduce the hot plug latency. > > Signed-off-by: Mohammed Khajapasha > Signed-off-by: Prasad Sodagudi > --- > init/Kconfig | 10 ++++++++++ > kernel/printk/printk.c | 10 ++++++++-- > 2 files changed, 18 insertions(+), 2 deletions(-) > > diff --git a/init/Kconfig b/init/Kconfig > index d6a0b31..9ce39ba 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -699,6 +699,16 @@ config LOG_BUF_SHIFT > 13 => 8 KB > 12 => 4 KB > > +config CONSOLE_FLUSH_ON_HOTPLUG > + bool "Enable console flush configurable in hot plug code path" > + depends on HOTPLUG_CPU > + def_bool n n is the default, no need to list it. > + help > + In cpu hot plug path console lock acquire and release causes the > + console to flush. If console lock is not free hot plug latency > + increases. So make console flush configurable in hot plug path > + and default disabled to help in cpu hot plug latencies. Why would you not want this option? Why isn't this just a bugfix? > + > config LOG_CPU_MAX_BUF_SHIFT > int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" > depends on SMP > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 9b75f6b..f02d3ef 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2283,6 +2283,8 @@ void resume_console(void) > console_unlock(); > } > > +#ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG > + > /** > * console_cpu_notify - print deferred console messages after CPU hotplug > * @cpu: unused > @@ -2302,6 +2304,8 @@ static int console_cpu_notify(unsigned int cpu) > return 0; > } > > +#endif > + > /** > * console_lock - lock the console system for exclusive use. > * > @@ -2974,7 +2978,7 @@ void __init console_init(void) > static int __init printk_late_init(void) > { > struct console *con; > - int ret; > + int ret = 0; > > for_each_console(con) { > if (!(con->flags & CON_BOOT)) > @@ -2996,13 +3000,15 @@ static int __init printk_late_init(void) > unregister_console(con); > } > } > +#ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG #ifdef in .c code is a mess to maintain. > ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL, > console_cpu_notify); > WARN_ON(ret < 0); > ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "printk:online", > console_cpu_notify, NULL); > WARN_ON(ret < 0); > - return 0; > +#endif What happens if we don't make these calls entirely? Why not just remove them as who wants extra latency for their system? thanks, greg k-h