get_order() broken !

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel Mailing List <linux-kernel@...>
Cc: Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>
Date: Tuesday, March 6, 2007 - 1:02 pm

Ok, maybe I have lots of shit in my eyes.... but it looks like get_order
in asm-generic/page.h is broken.

AFAIK, get_order() should round up (and we have code here or there
assuming such).

However, it seems to assume that ilog2 rounds up, which it doesn't. It
rounds down. At least the generic implementation seems to do so and the
powerpc optimized one too.

So I end up for example with get_order(0x1020) returning ... 0 (which
explains some memory corruption problems I'm having on ppc32 among
others0.

So who is right and who is wrong ? Should we audit all users of these
things ?

Cheers,
Ben.


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
get_order() broken !, Benjamin Herrenschmidt, (Tue Mar 6, 1:02 pm)
Re: get_order() broken !, Linus Torvalds, (Tue Mar 6, 1:13 pm)
Re: get_order() broken ! , David Howells, (Tue Mar 6, 1:43 pm)