Linus Torvalds <torvalds@linux-foundation.org> wrote:Damn. I missed that. I should have, yes. I'd rather not do that as the inline assembly variants then have to special case ilog2(0) rather than just having an undefined result. Unfortunately, I can't disagree. It was tested... I've just re-examined my test program and I've realised I've only tested power-of-2 parameters. Sigh. Well, that should be CONFIG_ARCH_HAS_ILOG2_U?? macros, and powerpc defines those too. True, for N being a non-power-of-two, unfortunately; and also where evaluating N has side-effects. Not true, just that my userspace test program isn't sufficiently exhaustive. Unfortunately so. Not true. Various archs (including i386, x86_64, powerpc and frv) have instructions that can be used to calculate integer log2(N). The fallback position is to use a loop: size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1; order++; } while (size); Probably a good idea. I'll work on it some more and improve my test program (which is actually quite simple to do). David -
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Alan Stern | Re: 2.6.22-rc2-mm1 |
| Satyam Sharma | Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures |
| William Lee Irwin III | Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS] |
git: | |
| Dale Farnsworth | Re: [PATCH 03/39] mv643xx_eth: shorten reg names |
| Jarek Poplawski | Re: HTB accuracy for high speed |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
