public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>,
	Jeremiah Mahler <jmmahler@gmail.com>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [BUG, bisect] hrtimer: severe lag after suspend & resume
Date: Fri, 5 Jun 2015 12:07:07 +0200	[thread overview]
Message-ID: <20150605100707.GB8995@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1506051110040.4155@nanos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> On Thu, 4 Jun 2015, John Stultz wrote:
> > On Wed, Jun 3, 2015 at 5:56 PM, Jeremiah Mahler <jmmahler@gmail.com> wrote:
> > So I suspect the problem is the change to clock_was_set_seq in
> > timekeeping_update is done prior to mirroring the time state to the
> > shadow-timekeeper. Thus the next time we do update_wall_time() the
> > updated sequence is overwritten by whats in the shadow copy. The
> > attached patch moving the modification up seems to avoid the issue for
> > me.
> 
> Duh, yes.
>  
> > Thomas: Looking at the problematic change, I'm not a big fan of it. Caching 
> > timekeeping state here in the hrtimer code has been a source of bugs in the 
> > past, and I'm not sure I see how avoiding copying 24bytes is that big of a 
> > win. Especially since it adds more state to the timekeeper and hrtimer base 
> > that we have to read and mange.
> 
> It's not about copying 24 bytes. It's about touching 3 cache lines for nothing. 
> In situations where we run high frequency periodic timers on clock monotonic and 
> nothing is going on in the other clock domains, which is a pretty common 
> situation, this is measurable in terms of cache utilization. [...]

It's not just about 'touching': it's about _dirtying_ cachelines from a globally 
executed function (timekeeping), which is then accessed by per-CPU functionality 
(hrtimers).

That makes it far more expensive, it has similar scalability limiting effects as a 
global lock - while if we do it smart it can perform as essentially lockless code 
in most cases.

Thanks,

	Ingo

  reply	other threads:[~2015-06-05 10:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  0:56 [BUG, bisect] hrtimer: severe lag after suspend & resume Jeremiah Mahler
2015-06-04 11:22 ` Thomas Gleixner
2015-06-04 20:13   ` Jeremiah Mahler
2015-06-04 22:54 ` John Stultz
2015-06-05  0:01   ` Jeremiah Mahler
2015-06-05  7:57   ` Ingo Molnar
2015-06-05  9:14   ` Thomas Gleixner
2015-06-05 10:07     ` Ingo Molnar [this message]
2015-06-05 18:52       ` John Stultz
2015-06-08  7:44         ` Thomas Gleixner
2015-06-08 17:37           ` John Stultz
2015-06-08 19:31             ` Thomas Gleixner
2015-06-05 14:02     ` Thomas Gleixner

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=20150605100707.GB8995@gmail.com \
    --to=mingo@kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=jmmahler@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox