All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: "Alan J. Wylie" <alan@wylie.me.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: Regression in posix-cpu-timers.c (was Re: Linux 5.14.4)
Date: Wed, 15 Sep 2021 20:31:52 +0200	[thread overview]
Message-ID: <20210915183152.GA22415@lothringen> (raw)
In-Reply-To: <87ilz1pwaq.fsf@wylie.me.uk>

On Wed, Sep 15, 2021 at 06:45:33PM +0100, Alan J. Wylie wrote:
> 564005805aadec9cb7e5dc4e14071b8f87cd6b58 is the first bad commit
> commit 564005805aadec9cb7e5dc4e14071b8f87cd6b58
> Author: Frederic Weisbecker <frederic@kernel.org>
> Date:   Mon Jul 26 14:55:10 2021 +0200
> 
>     posix-cpu-timers: Force next expiration recalc after itimer reset
>     
>     [ Upstream commit 406dd42bd1ba0c01babf9cde169bb319e52f6147 ]
>     
>     When an itimer deactivates a previously armed expiration, it simply doesn't
>     do anything. As a result the process wide cputime counter keeps running and
>     the tick dependency stays set until it reaches the old ghost expiration
>     value.
>     
>     This can be reproduced with the following snippet:
>     
>             void trigger_process_counter(void)
>             {
>                     struct itimerval n = {};
>     
>                     n.it_value.tv_sec = 100;
>                     setitimer(ITIMER_VIRTUAL, &n, NULL);
>                     n.it_value.tv_sec = 0;
>                     setitimer(ITIMER_VIRTUAL, &n, NULL);
>             }
>     
>     Fix this with resetting the relevant base expiration. This is similar to
>     disarming a timer.
>     
>     Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
>     Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>     Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>     Link: https://lore.kernel.org/r/20210726125513.271824-4-frederic@kernel.org
>     Signed-off-by: Sasha Levin <sashal@kernel.org>
>

Right, this should fix the issue: https://lore.kernel.org/lkml/20210913145332.232023-1-frederic@kernel.org/

Thanks!

  parent reply	other threads:[~2021-09-15 18:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  8:09 Linux 5.14.4 Greg Kroah-Hartman
2021-09-15  8:09 ` Greg Kroah-Hartman
2021-09-15 17:45 ` Regression in posix-cpu-timers.c (was Re: Linux 5.14.4) Alan J. Wylie
2021-09-15 18:09   ` Greg Kroah-Hartman
2021-09-15 18:53     ` Alan J. Wylie
2021-09-16  8:51       ` Greg Kroah-Hartman
2021-09-15 18:31   ` Frederic Weisbecker [this message]
2021-09-15 18:41     ` Linus Torvalds
2021-09-15 21:15       ` Frederic Weisbecker
2021-09-15 19:20     ` Alan J. Wylie

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=20210915183152.GA22415@lothringen \
    --to=frederic@kernel.org \
    --cc=alan@wylie.me.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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.