mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: John Stultz <john.stultz@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Jamie Lokier" <jamie@shareable.org>,
	"Alexander Shishkin" <virtuoso@slind.org>,
	"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH 2/2] hrtimers: Add CLOCK_BOOTTIME clockid, hrtimerbase and posix interface
Date: Tue, 1 Feb 2011 15:16:14 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1102011510570.31804@localhost6.localdomain6> (raw)
In-Reply-To: <1296531837-12879-3-git-send-email-john.stultz@linaro.org>

On Mon, 31 Jan 2011, John Stultz wrote:

> CLOCK_MONOTONIC stops while the system is in suspend. This is because
> to applications system suspend is invisible. However, there is a
> growing set of applications that are wanting to be suspend-aware,
> but do not want to deal with the complicatoins of CLOCK_REALTIME
> (which might jump around if settimeofday is called).
> 
> For these applications, I propose a new clockid: CLOCK_BOOTTIME.
> CLOCK_BOOTTIME is idential to CLOCK_MONOTONIC, except it also
> includes any time spent in suspend.
> 
> This patch adds the new CLOCK_BOOTTIME clockid, as well as the
> infrastructure needed to support hrtimers against it, and the
> wiring to expose it out via the posix interface.

Can you please split that into parts:

    - Add the new functions
    - Wire up hrtimers, posix-timers

>  static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
>  {
> -	ktime_t xtim, tomono;
> -	struct timespec xts, tom;
> +	ktime_t xtim, tomono, sleep;
> +	struct timespec xts, tom, slp;
>  	unsigned long seq;
>  
>  	do {
>  		seq = read_seqbegin(&xtime_lock);
>  		xts = __current_kernel_time();
>  		tom = __get_wall_to_monotonic();
> +		slp = __get_sleep_time();
>  	} while (read_seqretry(&xtime_lock, seq));

Hmm, that conflicts with the xtime_lock cleanup in tip/timers/core.

>  /*
>   * Initialize everything, well, just everything in Posix clocks/timers ;)
>   */
> @@ -301,12 +309,18 @@ static __init int init_posix_timers(void)
>  		.timer_create = no_timer_create,
>  		.nsleep = no_nsleep,
>  	};
> +	struct k_clock clock_boottime = {
> +		.clock_getres = hrtimer_get_res,
> +		.clock_get = posix_get_boottime,
> +		.clock_set = do_posix_clock_nosettime,

That's going to conflict with the posix timer cleanup, but it's easy enough to fix.

Thanks,

	tglx

  reply	other threads:[~2011-02-01 14:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  3:43 [PATCH 0/2] Add CLOCK_BOOTTIME functionality John Stultz
2011-02-01  3:43 ` [PATCH 1/2] hrtimers: extend hrtimer base code to handle more then 2 clockids John Stultz
2011-02-01 14:10   ` Thomas Gleixner
2011-02-01 18:37     ` John Stultz
2011-02-01 18:47       ` Thomas Gleixner
2011-02-01  3:43 ` [PATCH 2/2] hrtimers: Add CLOCK_BOOTTIME clockid, hrtimerbase and posix interface John Stultz
2011-02-01 14:16   ` Thomas Gleixner [this message]
2011-02-01 18:35     ` John Stultz

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=alpine.LFD.2.00.1102011510570.31804@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=arve@android.com \
    --cc=jamie@shareable.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtuoso@slind.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

all inboxes | Powered by JetHome®