All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: ramesh.thomas@intel.com
Cc: linux-rt-users@vger.kernel.org, williams@redhat.com,
	frederic@kernel.org, tglx@linutronix.de
Subject: Re: [PATCH 1/1] dynticks/preempt_rt: Fix a nohz_full entry failure in preempt_rt
Date: Thu, 14 Jan 2021 15:48:35 +0100	[thread overview]
Message-ID: <20210114144835.ok7y4s2csbfhh5eu@linutronix.de> (raw)
In-Reply-To: <20201223092034.528782-2-ramesh.thomas@intel.com>

On 2020-12-23 04:20:36 [-0500], ramesh.thomas@intel.com wrote:
> From: Ramesh Thomas <ramesh.thomas@intel.com>
> 
> After all conditions to enter nohz_full state are met, if a timer event
> is detected in the next period, nohz_full entry is aborted in
> tick_nohz_next_event(). In the failure condition, this scenario keeps
> repeating. This has been reproduced in preempt_rt kernel, however it may
> not be limited to it.
 
Which timer is? Why does it make sense to enter NOHZ_FULL if the timer
expires shortly after (in next jiffy window if I understood it
properly).

> Not bailing out if CONFIG_NO_HZ_FULL is defined, fixes the issue. Since
> in NO_HZ_FULL mode, idle state is not entered at tick stoppage, the
> pending timer event can be handled where the next timer is programmed in
> tick_nohz_stop_tick(). This also simplifies the logic by keeping a
> common path to handle the entry/exit of nohz_full state, whether the
> tick was already stopped or not.
> 
> (The entire check for the presence of a timer event in the next period
> can possibly be skipped for NO_HZ_FULL)
> 
> Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
> ---
>  kernel/time/tick-sched.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 308a98c28ee8..3798dbc5f082 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -739,10 +739,12 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu)
>  		 * We've not stopped the tick yet, and there's a timer in the
>  		 * next period, so no point in stopping it either, bail.
>  		 */
> +#ifndef CONFIG_NO_HZ_FULL
>  		if (!ts->tick_stopped) {
>  			ts->timer_expires = 0;
> -			goto out;
> +			return 0;
>  		}
> +#endif
>  	}
>  
>  	/*
> @@ -763,7 +765,6 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu)
>  
>  	ts->timer_expires = min_t(u64, expires, next_tick);
>  
> -out:
>  	return ts->timer_expires;
>  }
>  
> -- 
> 2.26.2
> 

Sebastian

      reply	other threads:[~2021-01-14 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  9:20 [PATCH 0/1] nohz_full state entry failure in preempt_rt and proposed fix ramesh.thomas
2020-12-23  9:20 ` [PATCH 1/1] dynticks/preempt_rt: Fix a nohz_full entry failure in preempt_rt ramesh.thomas
2021-01-14 14:48   ` Sebastian Andrzej Siewior [this message]

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=20210114144835.ok7y4s2csbfhh5eu@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=ramesh.thomas@intel.com \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.