On Sun, Dec 11, 2005 at 03:12:17PM +0100, Ingo Molnar wrote:
>
> 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)
The patch looks fine, but what's this about using SLOB exclusively?
Fragmentation performance of SLOB is miserable on anything like a
modern desktop, I think SLOB only makes sense for small machines. The
locking also suggests dual core at most.
Anyway,
> Signed-off-by: Ingo Molnar <[email protected]>
Acked-by: Matt Mackall <[email protected]>
>
> 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);
> }
--
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]