lkml.org 
[lkml]   [2010]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic
Date
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


\
 
 \ /
  Last update: 2010-06-05 12:25    [W:0.073 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site