Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5432254pxv; Wed, 7 Jul 2021 03:44:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO6GRa0Ib+ilUo+Zioex+7u63SWJm4LiaW6q2Berm01sjE0MqSxB7MZgZdrNZNePIGeH6Z X-Received: by 2002:a05:6e02:2163:: with SMTP id s3mr17216535ilv.3.1625654673372; Wed, 07 Jul 2021 03:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625654673; cv=none; d=google.com; s=arc-20160816; b=QGud38r/baJ/g11Jpbwxq3Zz/dv+uqHBPu1Hg5T8lb025qqHnbNqJQUOEcqtcWSg8Z os3h4xN0QTGnfezPRr+QNbFvPa0Q+EsW0wdycXA+/9414QdelBF97HVB1tyve5J5NnKm 2o+XI0JYOmO4Iq3f/ymwQWP0tJEMot2tHiw5pbDFCAqxnkMPBqZnrT/jguJAY+YKN78H tAlKaZ/Zo28CEuK7mJMOqFtWXUIynl+cmEquk2fXfizMOgeLo8rBM+LNra2ZoXoYKZof NOYPDWCvzBvzMuvRHHuzbZclmICh6EBBxUmxnR7brKYfc7Hz6RiBzXfL8weur7Ailp4n CViA== 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=dVxPOmznAJWLxMs59wUwreI7BaHv4gVZzw2g6bukhL4=; b=Hw2V4bEZYeFm84oxuiD9uwt12unnw7F2v06jDBqY4klsaaxUdzZLxvpQpVrPZH5eo0 LlG/3m/KJRfTf8IDvPgfuVGcG312YXU2vBWhn9VDZ/m6lp+MwVWJ01wOVaeIQvcjNVQD oOTGoDEJLLIoOVlUACGYSkTETefh6nWx3/efCK7bBDS2B1QfTSDowS1ucnIvC+kC4qOH 2XMGOg9JjR5APYushDnTFCfeFip+iAmTMigPJL5lzlTOGyIkdkot/mQ+2Bp3V8wF/sSb E9m41j/mMmjgsnB6HXLHPxyNZjmJAX7nv7YwQem2xLGavCfO7z02+2OiJSnwfBw29q4V V2bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZUrNlD26; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si22553753jan.119.2021.07.07.03.44.21; Wed, 07 Jul 2021 03:44:33 -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=k20201202 header.b=ZUrNlD26; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231258AbhGGKqg (ORCPT + 99 others); Wed, 7 Jul 2021 06:46:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230354AbhGGKqg (ORCPT ); Wed, 7 Jul 2021 06:46:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A697C61C99; Wed, 7 Jul 2021 10:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625654636; bh=v/Id4xESUyVn7Okazo3/CpOE9/KzPJJ/ubAqgJSHNVU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZUrNlD26Mo/6gf8K9+HTJEKFhaupnbQ1PtnmcoSrUK7gqJXzmyQefbHDeFDw3Nkry tKURG69432uWPoJEWfV/+QUuDL+Sm/qKB0gVVN8vabMu3gvilTxG7/bls7btf3QRi/ NHs+JmFt0pyvSTQMyUZ/gYIHUfBGtv0eTRb2PQo/PXG0YO6CY7dayvP9x2aBIaSemx Iea4YH6oKrd7A2szHKMTrpHGbGiznjcYzxRQJXPvCaw0SfoN8/y2iXPz6g8UlgNDAF eR9rQ9saUaw7gxNMpsoEwiegPF5+xHegmUqabsyXLKNTz7XYAOrRMLZLcKR/gQAdKa h1pWacd94A5sg== Date: Wed, 7 Jul 2021 12:43:53 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Ani Sinha , linux-kernel@vger.kernel.org, anirban.sinha@nokia.com, Frederic Weisbecker , Ingo Molnar Subject: Re: [PATCH v1] Add info log when user enables NOHZ in commandline but NOHZ is not possible Message-ID: <20210707104353.GA115752@lothringen> References: <20210627072833.2199463-1-ani@anisinha.ca> <87zguypgy8.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zguypgy8.ffs@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 07, 2021 at 12:16:15PM +0200, Thomas Gleixner wrote: > Ani, > > On Sun, Jun 27 2021 at 12:58, Ani Sinha wrote: > > same comment vs. Subject, 'this patch' and 'we' > > > @@ -930,6 +930,7 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts) > > { > > #ifdef CONFIG_NO_HZ_FULL > > int cpu = smp_processor_id(); > > + static bool no_tick_warned; > > > > if (!tick_nohz_full_cpu(cpu)) > > return; > > @@ -937,10 +938,24 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts) > > if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) > > return; > > > > - if (can_stop_full_tick(cpu, ts)) > > + if (can_stop_full_tick(cpu, ts)) { > > tick_nohz_stop_sched_tick(ts, cpu); > > - else if (ts->tick_stopped) > > - tick_nohz_restart_sched_tick(ts, ktime_get()); > > + if (no_tick_warned) { > > + pr_info("NO_HZ_FULL is now enabled in the system.\n"); > > + no_tick_warned = false; > > + } > > + } else { > > + /* > > + * Don't allow the user to think they can get > > + * full NO_HZ with this machine. > > + */ > > + if (!no_tick_warned && tick_nohz_full_running) { > > + pr_info("NO_HZ_FULL has been disabled in the system."); > > + no_tick_warned = true; > > + } > > So this is going to emit this message everytime the NOHZ state of a CPU > changes, which is an easy to trigger dmesg flooding from unpriviledged > user space. > > Also the message is misleading because this is a per CPU condition and > not a system wide condition. IIUC, the clock can be marked unstable anytime before or after nohz_full is initialized. So we can do two things: * If tick_nohz_init() is called after the clock has been marked unstable, just don't initialize nohz_full. * If the clock is marked unstable after tick_nohz_init(), issue a pr_warn() from __clear_sched_clock_stable(). Thanks.