All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: John Stultz <johnstul@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic
Date: Sat, 5 Jun 2010 12:23:05 +0200	[thread overview]
Message-ID: <201006051223.06000.arnd@arndb.de> (raw)
In-Reply-To: <1275706406-8111-6-git-send-email-johnstul@us.ibm.com>

On Saturday 05 June 2010, John Stultz wrote:
>         do {
>                 seq = read_seqbegin(&xtime_lock);
>                 xts = __current_kernel_time();
> -               tom = wall_to_monotonic;
> +               tom = __get_wall_to_monotonic();
>         } while (read_seqretry(&xtime_lock, seq));
>  

Would it make sense to also limit the use of xtime_lock to the
timekeeping code? I suppose you could merge the various accessors
(current_kernel_time, get_monotonic_coarse, __current_kernel_time,
__get_wall_to_monotonic) with a single function doing

struct timespec current_kernel_time(struct timespec *tomono)
{
        struct timespec now;
        unsigned long seq;

        do {
                seq = read_seqbegin(&xtime_lock);
		if (tomono)
			wall_to_monotonic;
                now = xtime;
        } while (read_seqretry(&xtime_lock, seq));

        return now;
}

	Arnd

  parent reply	other threads:[~2010-06-05 10:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05  2:53 [RFC][PATCH 0/6] xtime/wall_to_monotonic cleanups John Stultz
2010-06-05  2:53 ` [RFC][PATCH 1/6] powerpc: Simplify update_vsyscall John Stultz
2010-06-05  2:53   ` [RFC][PATCH 2/6] powerpc: Cleanup xtime usage John Stultz
2010-06-05  2:53     ` [RFC][PATCH 3/6] Fix update_vsyscall to provide wall_to_monotonic offset John Stultz
2010-06-05  2:53       ` [RFC][PATCH 4/6] Convert um to use read_persistent_clock John Stultz
2010-06-05  2:53         ` [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic John Stultz
2010-06-05  2:53           ` [RFC][PATCH 6/6] Make xtime and wall_to_monotonic static John Stultz
2010-06-05 10:23           ` Arnd Bergmann [this message]
2010-06-05 18:01             ` [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic 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=201006051223.06000.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.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.