All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	john stultz <johnstul@us.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@tglx.de>, Ingo Molnar <mingo@elte.hu>,
	Andi Kleen <ak@suse.de>,
	nikolag@ca.ibm.com, Darren Hart <dvhltc@us.ibm.com>,
	jatriple@us.ibm.com
Subject: Re: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE
Date: Mon, 20 Jul 2009 05:22:07 -0700	[thread overview]
Message-ID: <20090720122207.GB6944@linux.vnet.ibm.com> (raw)
In-Reply-To: <1248088622.15751.8465.camel@twins>

On Mon, Jul 20, 2009 at 01:17:02PM +0200, Peter Zijlstra wrote:
> On Sat, 2009-07-18 at 15:30 -0700, Arjan van de Ven wrote:
> > On Sat, 18 Jul 2009 15:09:38 -0700
> > john stultz <johnstul@us.ibm.com> wrote:
> > 
> > > After talking with some application writers who want very fast, but
> > > not fine-grained timestamps, I decided to try to implement a new
> > > clock_ids to clock_gettime(): CLOCK_REALTIME_COARSE and
> > > CLOCK_MONOTONIC_COARSE which returns the time at the last tick. This
> > > is very fast as we don't have to access any hardware (which can be
> > > very painful if you're using something like the acpi_pm clocksource),
> > > and we can even use the vdso clock_gettime() method to avoid the
> > > syscall. The only trade off is you only get low-res tick grained time
> > > resolution.
> > 
> > Does this tie us to having a tick? I still have hope that we can get
> > rid of the tick even when apps are running .... since with CFS we don't
> > really need the tick for the scheduler anymore for example....
> 
> On the hardware side to make this happen we'd need a platform that has:
> 
>   - cheap, high-res, cross-cpu synced, clocksource
>   - cheap, high-res, clockevents
> 
> Maybe power64, sparc64 and s390x qualify, but certainly nothing on x86
> does.
> 
> Furthermore, on the software side we'd need a few modifications, such as
> doing lazy accounting for things like u/s-time which currently rely on
> the tick and moving the load-balancing into a hrtimer.
> 
> Also, even with the above done, we'd probably want to tinker with the
> clockevent/hrtimer code and possibly use a second per-cpu hardware timer
> for the scheduler, since doing the whole hrtimer rb-tree dance for every
> context switch is simply way too expensive.
> 
> But even with all that manged, there's still other bits that rely on the
> tick -- RCU being one of the more interesting ones.

On alternative to the tick is to inform RCU of each transition to/from
userspace, so that RCU would treat user-mode execution as it currently
does dyntick-idle state.  If there is -never- to be any scheduling-clock
interrupts, then RCU would need to also know about transitions to/from
the idle loop -- which happens automatically if CONFIG_NO_HZ, of course.

But I expect that there would be some additional excitement elsewhere...
And given the large number of transitions to/from userspace, getting all
of them noted in the RCU case might be non-trivial as well.

							Thanx, Paul

  reply	other threads:[~2009-07-20 12:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 23:39 [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE john stultz
2009-07-18  8:30 ` Thomas Gleixner
2009-07-18 22:09   ` john stultz
2009-07-18 22:30     ` Arjan van de Ven
2009-07-20 11:17       ` Peter Zijlstra
2009-07-20 12:22         ` Paul E. McKenney [this message]
2009-07-20 13:33         ` Arjan van de Ven
2009-07-20 13:49           ` Peter Zijlstra
2009-07-22 21:39             ` Josh Triplett
2009-07-21 22:31       ` john stultz
2009-07-22  1:26         ` john stultz
2009-08-01 12:21         ` Andy Lutomirski
2009-07-18 12:09 ` Ingo Molnar
2009-07-18 22:20   ` john stultz
2009-07-19  3:00 ` Chris Snook
2009-07-19  6:14   ` Arjan van de Ven
2009-07-19  6:48     ` Nicholas Miell

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=20090720122207.GB6944@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=ak@suse.de \
    --cc=arjan@infradead.org \
    --cc=dvhltc@us.ibm.com \
    --cc=jatriple@us.ibm.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nikolag@ca.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tglx@tglx.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.