All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use unlikely() for current_kernel_time() loop
@ 2006-06-07 17:36 Andreas Dilger
  2006-06-08  2:28 ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Dilger @ 2006-06-07 17:36 UTC (permalink / raw)
  To: Adrian's Trivial Patches; +Cc: linux-kernel

Hello,
I just noticed this minor optimization.  current_kernel_time() is called
from current_fs_time() so it is used fairly often but it doesn't use
unlikely(read_seqretry(&xtime_lock, seq)) as other users of xtime_lock do.
Also removes extra whitespace on the empty line above.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>


--- ./kernel/time.c.orig	2006-05-08 15:40:43.000000000 -0600
+++ ./kernel/time.c	2006-06-07 11:24:49.000000000 -0600
@@ -424,9 +424,9 @@ inline struct timespec current_kernel_time
 
 	do {
 		seq = read_seqbegin(&xtime_lock);
-		
+
 		now = xtime;
-	} while (read_seqretry(&xtime_lock, seq));
+	} while (unlikely(read_seqretry(&xtime_lock, seq)));
 
 	return now; 
 }

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-06-08 10:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-07 17:36 [PATCH] use unlikely() for current_kernel_time() loop Andreas Dilger
2006-06-08  2:28 ` Andi Kleen
2006-06-08  5:01   ` Andrew Morton
2006-06-08  5:39     ` Andi Kleen
2006-06-08  6:41       ` Brian F. G. Bidulock
2006-06-08  6:51         ` Andi Kleen
2006-06-08  7:00           ` Brian F. G. Bidulock
2006-06-08  7:07             ` Andi Kleen
2006-06-08  7:43               ` Brian F. G. Bidulock
2006-06-08  8:59               ` Brian F. G. Bidulock
2006-06-08  9:14                 ` Andi Kleen
2006-06-08  9:36                   ` Brian F. G. Bidulock
2006-06-08 10:20                     ` Andi Kleen
2006-06-08 10:50                       ` Brian F. G. Bidulock

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.