PERFORCE change 43335 for review

Peter Wemm peter at FreeBSD.org
Tue Dec 2 17:33:00 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=43335

Change 43335 by peter at peter_overcee on 2003/12/02 17:32:38

	actually, since we've already checked for zero in the loop,
	directly call bsfq() rather than "ffsl() - 1".  In theory,
	gcc -O should optimize out the mask == 0 case (already tested)
	and the "- 1 + 1", but dont depend on it.  This is why we have
	RQB_FFS() exposed like this anyway.

Affected files ...

.. //depot/projects/hammer/sys/amd64/include/runq.h#6 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/include/runq.h#6 (text+ko) ====

@@ -36,7 +36,7 @@
 #define	RQB_BIT(pri)	(1 << ((pri) & (RQB_BPW - 1)))
 #define	RQB_WORD(pri)	((pri) >> RQB_L2BPW)
 
-#define	RQB_FFS(word)	(ffsl(word) - 1)
+#define	RQB_FFS(word)	(bsfq(word))
 
 /*
  * Type of run queue status word.


More information about the p4-projects mailing list