From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: get_order() broken !
Date: Tue, 06 Mar 2007 18:02:35 +0100 [thread overview]
Message-ID: <1173200555.9349.2.camel@localhost.localdomain> (raw)
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.
next reply other threads:[~2007-03-06 17:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 17:02 Benjamin Herrenschmidt [this message]
2007-03-06 17:13 ` get_order() broken ! Linus Torvalds
2007-03-06 17:43 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1173200555.9349.2.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox