lkml.org 
[lkml]   [2004]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.6.8-rc1-mm1
Andrew Morton <akpm@osdl.org> wrote:
>
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.8-rc1/2.6.8-rc1-mm1/
>

This kernel runs like a dessicated slug if you have more than 2G of memory
due to a 32-bit overflow.

Dentry cache hash table entries: 1 (order: -10, 4 bytes)
Inode-cache hash table entries: 1 (order: -10, 4 bytes)

The dcache is a singly-linked list. Here's a (lame) fix:


--- 25/mm/page_alloc.c~making-i-dhash_entries-cmdline-work-as-it-use-to-fix 2004-07-14 00:11:26.437028752 -0700
+++ 25-akpm/mm/page_alloc.c 2004-07-14 00:24:56.461886256 -0700
@@ -2004,7 +2004,8 @@ void *__init alloc_large_system_hash(con
unsigned int *_hash_shift,
unsigned int *_hash_mask)
{
- unsigned long max, log2qty, size;
+ unsigned long long max;
+ unsigned long log2qty, size;
void *table;

/* allow the kernel cmdline to have a say */
@@ -2025,18 +2026,19 @@ void *__init alloc_large_system_hash(con
numentries = 1UL << (long_log2(numentries) + 1);

/* limit allocation size to 1/16 total memory */
- max = ((nr_all_pages << PAGE_SHIFT)/16) / bucketsize;
+ max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4;
+ do_div(max, bucketsize);

if (numentries > max)
numentries = max;

log2qty = long_log2(numentries);

+ size = bucketsize << log2qty;
do {
- size = bucketsize << log2qty;
-
- table = (void *) alloc_bootmem(size);
-
+ table = alloc_bootmem(size);
+ if (!table)
+ size /= 2;
} while (!table && size > PAGE_SIZE);

if (!table)
_


btw, David, I'm wondering about this loop:

do {
size = bucketsize << log2qty;
table = (void *) alloc_bootmem(size);

} while (!table && size > PAGE_SIZE);
Is this a busy-wait-until-someone-plugs-in-more-ram-chips thing? ;)

I assume you meant something like the above?

btw, that (void *) cast was superfluous...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.180 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site