Messages in this thread | | | From | Arnd Bergmann <> | 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 |
| |
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
| |