All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Matt Mackall <mpm@selenic.com>
Subject: [patch -mm] fix SLOB on x64
Date: Sun, 11 Dec 2005 15:12:17 +0100	[thread overview]
Message-ID: <20051211141217.GA5912@elte.hu> (raw)


this patch fixes 32-bitness bugs in mm/slob.c. Successfully booted x64 
with SLOB enabled. (i have switched the PREEMPT_RT feature to use the 
SLOB allocator exclusively, so it must work on all platforms)

Signed-off-by: Ingo Molnar <mingo@elte.hu>

Index: linux/mm/slob.c
===================================================================
--- linux.orig/mm/slob.c
+++ linux/mm/slob.c
@@ -198,7 +198,7 @@ void kfree(const void *block)
 	if (!block)
 		return;
 
-	if (!((unsigned int)block & (PAGE_SIZE-1))) {
+	if (!((unsigned long)block & (PAGE_SIZE-1))) {
 		/* might be on the big block list */
 		spin_lock_irqsave(&block_lock, flags);
 		for (bb = bigblocks; bb; last = &bb->next, bb = bb->next) {
@@ -227,7 +227,7 @@ unsigned int ksize(const void *block)
 	if (!block)
 		return 0;
 
-	if (!((unsigned int)block & (PAGE_SIZE-1))) {
+	if (!((unsigned long)block & (PAGE_SIZE-1))) {
 		spin_lock_irqsave(&block_lock, flags);
 		for (bb = bigblocks; bb; bb = bb->next)
 			if (bb->pages == block) {
@@ -326,7 +326,7 @@ void kmem_cache_init(void)
 	void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1);
 
 	if (p)
-		free_page((unsigned int)p);
+		free_page((unsigned long)p);
 
 	mod_timer(&slob_timer, jiffies + HZ);
 }

             reply	other threads:[~2005-12-11 14:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-11 14:12 Ingo Molnar [this message]
2005-12-11 17:22 ` [patch -mm] fix SLOB on x64 Ed Tomlinson
2005-12-11 20:05   ` Ingo Molnar
2005-12-11 18:05 ` Matt Mackall
2005-12-11 20:02   ` Ingo Molnar

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=20051211141217.GA5912@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.