Skip to contentSkip to conversation

linux-2.5.66_monotonic-clock_A3

PATCH Andi Kleen 2 participants 2 messages Mar 29, 2003 – Mar 31, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1048892109.975.150.camel@w-jstultz2.beaverton.ibm.com.suse.lists.linux.kernel

Andi Kleen

author
#1 lore raw

Review

Quoted 4 lines · john stultz
(quoted diff) +4 -0
+	do {
+		seq = read_seqbegin(&xtime_lock);
+		ret = timer->monotonic_clock();
+	} while (read_seqretry(&xtime_lock, seq));

Why does it need to check xtime lock ? xtime should be independent of the monotonic time because it can be changed.

Also doing seqlocks around hardware register reads is quite nasty, because a hardware register read can be hundreds of cycles and you're very likely to get retries. If you really need a seqlock I would move it into the low level function and do it after the hardware access. But as far as I can see it can be just removed.

-Andi

#2 lore raw
Quoted 9 lines · Andi Kleen

Review

Quoted 4 lines · john stultz
(quoted diff) +4 -0
+	do {
+		seq = read_seqbegin(&xtime_lock);
+		ret = timer->monotonic_clock();
+	} while (read_seqretry(&xtime_lock, seq));

Why does it need to check xtime lock ? xtime should be independent of the monotonic time because it can be changed.

Ok, fair enough. I was using the xtime lock to protect monotonic_base in (updated in mark_offset()), but since that isn't obvious I should be more explicit and use a different lock.

Quoted 5 lines

Also doing seqlocks around hardware register reads is quite nasty, because a hardware register read can be hundreds of cycles and you're very likely to get retries. If you really need a seqlock I would move it into the low level function and do it after the hardware access. But as far as I can see it can be just removed.

I should be able to use a regular rwlock w/o troubles. I change that and resubmit.

thanks for the feedback!
-john