The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Ani Sinha <ani@anisinha.ca>,
	linux-kernel@vger.kernel.org, anirban.sinha@nokia.com,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v1] Add info log when user enables NOHZ in commandline but NOHZ is not possible
Date: Wed, 7 Jul 2021 12:43:53 +0200	[thread overview]
Message-ID: <20210707104353.GA115752@lothringen> (raw)
In-Reply-To: <87zguypgy8.ffs@nanos.tec.linutronix.de>

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.

  reply	other threads:[~2021-07-07 10:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27  7:28 [PATCH v1] Add info log when user enables NOHZ in commandline but NOHZ is not possible Ani Sinha
2021-07-03 17:29 ` Ani Sinha
2021-07-07 10:16 ` Thomas Gleixner
2021-07-07 10:43   ` Frederic Weisbecker [this message]
2021-07-10  3:57     ` Ani Sinha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707104353.GA115752@lothringen \
    --to=frederic@kernel.org \
    --cc=ani@anisinha.ca \
    --cc=anirban.sinha@nokia.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox