On Thu, Apr 28, 2011 at 23:41, David Rientjes <rientjes@xxxxxxxxxx> wrote:Forgot to mention what I did for tests, on all kernels that I could actually boot: I ran slabinfo -l and slabinfo -T (saved the output in case anyone wants to analyze that), any kernel that survived this was considered good in the original bisect. The current fix was also tested on the actual hardware.
On Thu, 28 Apr 2011, James Bottomley wrote:
I think what the N_NORMAL_MEMORY patch did is just make it take a whiileWith parisc, you encountered an oops in add_partial() because the
before you start allocating from that range. Try executing a memory
balloon on the platform; that was how we first demonstrated the problem
on parisc.
kmem_cache_node structure for the memory range returned by page_to_nid()
was not allocated. init_kmem_cache_nodes() takes care of this for all
memory ranges set in N_NORMAL_MEMORY.
Adding Christoph and Pekka to the cc if there is additional concerns about
slub on this architecture.
My ARAnyM instance has
System Memory: 276480K
14 MB at 0x00000000 (ST-RAM)
256 MB at 0x01000000 (alternate RAM)
and 137800KIB of swap, and survived the following program just fine:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
size_t size = 1048576;
size_t total = 0;
void *p;
while (size) {
p = malloc(size);
if (!p) {
printf("Failed to allocate %zu bytes\n", size);
size /= 2;
}
memset(p, 0xaa, size);
total += size;
printf("Using %zu / 0x%zx bytes of memory\n", total, total);
}
printf("Finished!\n");
return 0;
}
i.e. the OOM-killer just killed the program after it consumed all
available virtual
memory:
Out of memory: Kill process 1727 (malloctest) score 854 or sacrifice child
Killed process 1727 (malloctest) total-vm:361160kB, anon-rss:224164kB,
file-rss:0kB
malloctest: page allocation failure. order:0, mode:0x84d0
So SLUB really seems to work now.