[PATCH] use unlikely() for current_kernel_time() loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>


--- ./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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux