All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Wei Li <liwei391@huawei.com>,
	Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>,
	Yu Liao <liaoyu15@huawei.com>, Hillf Danton <hdanton@sina.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 7/7] selftests/proc: Remove idle time monotonicity assertions
Date: Wed, 22 Feb 2023 15:48:57 +0100	[thread overview]
Message-ID: <Y/YrWZ6GnwLcWlwW@lothringen> (raw)
In-Reply-To: <87k00covg2.ffs@tglx>

On Mon, Feb 20, 2023 at 10:53:17PM +0100, Thomas Gleixner wrote:
> On Mon, Feb 20 2023 at 13:41, Frederic Weisbecker wrote:
> 
> > Due to broken iowait task counting design (cf: comments above
> > get_cpu_idle_time_us() and nr_iowait()), it is not possible to provide
> > the guarantee that /proc/stat or /proc/uptime display monotonic idle
> > time values.
> >
> > Remove the selftests that verify the related wrong assumption so that
> > testers and maintainers don't spend more time on that.
> >
> > Reported-by: Yu Liao <liaoyu15@huawei.com>
> > Reported-by: Thomas Gleixner <tglx@linutronix.de>
> 
> I did really not ask you to remove the selftests alltogether.
> 
> Those tests check uptime and idle time. I asked you to remove the idle
> time monotonicity assertion.
> 
> uptime is really supposed to be monotonically increasing. It's based on
> CLOCK_BOOTTIME. If that goes backwards then we surely have more trouble
> than /proc/uptime.

Right, I naively thought it wasn't worth checking CLOCK_BOOTTIME monotonicity
alone... Anyway, kept that in the new version.

> 
> But it would be a good thing to change the test in the following way:
> 
>        ut1 = parse("/proc/uptime");
>        bt1 = clock_gettime(CLOCK_BOOTTIME);
>        assert(ut1 <= bt1);
>        ut2 = parse("/proc/uptime");
>        bt2 = clock_gettime(CLOCK_BOOTTIME);
>        assert(ut2 <= bt2);
>        assert(ut1 <= ut2);
>        ....
> 
> Hmm?

Makes sense, added to the new version.

Thanks!

> 
> Thanks,
> 
>         tglx

      reply	other threads:[~2023-02-22 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 12:41 [PATCH 0/7] timers/nohz: Fixes and cleanups v2 Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 1/7] timers/nohz: Restructure and reshuffle struct tick_sched Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 2/7] timers/nohz: Only ever update sleeptime from idle exit Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 3/7] timers/nohz: Protect idle/iowait sleep time under seqcount Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 4/7] timers/nohz: Add a comment about broken iowait counter update race Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 5/7] timers/nohz: Remove middle-function __tick_nohz_idle_stop_tick() Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 6/7] MAINTAINERS: Remove stale email address Frederic Weisbecker
2023-02-20 12:41 ` [PATCH 7/7] selftests/proc: Remove idle time monotonicity assertions Frederic Weisbecker
2023-02-20 20:16   ` Alexey Dobriyan
2023-02-20 21:53   ` Thomas Gleixner
2023-02-22 14:48     ` Frederic Weisbecker [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=Y/YrWZ6GnwLcWlwW@lothringen \
    --to=frederic@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=hdanton@sina.com \
    --cc=liaoyu15@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=mingo@kernel.org \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --cc=peterz@infradead.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 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.