Re: Suspend 2 merge: 30/51: Enable slab alloc fallback to suspend memory pool

Pavel Machek
2004-11-26T23:54:00Z

Hi!

> When we are preparing the image and have eaten all available memory, but
> before page allocations have been switched over to the memory pool, we
> sometimes need to allocate memory from slab for the image metadata (swap
> header information). This code allows the slab allocator to fall back to
> the memory pool in such circumstances. There is some extra debugging
> code there at the moment while I seek to diagnose intermittent slab
> corruption (not sure if it's suspend related).

More reasons to dislike two pagesets. Also you probably should not
printk() with two !!s in it (but without severity). Is it bug or not?

> diff -ruN 817-enable-slab-alloc-fallback-to-suspend-memory-pool-old/mm/slab.c 817-enable-slab-alloc-fallback-to-suspend-memory-pool-new/mm/slab.c
> --- 817-enable-slab-alloc-fallback-to-suspend-memory-pool-old/mm/slab.c 2004-11-24 15:48:55.066733152 +1100
> +++ 817-enable-slab-alloc-fallback-to-suspend-memory-pool-new/mm/slab.c 2004-11-23 07:11:42.000000000 +1100
> @@ -874,14 +874,30 @@
> flags |= cachep->gfpflags;
> if (likely(nodeid == -1)) {
> addr = (void*)__get_free_pages(flags, cachep->gfporder);
> + if (unlikely((!addr) && (current->pid == suspend_task) &&
> + test_suspend_state(SUSPEND_SLAB_ALLOC_FALLBACK))) {
> + addr = (void *) suspend2_get_grabbed_pages(0);
> + printk("!! Slab addition satisfied via fallback code.\n");
> + }
> if (!addr)
> return NULL;
> + if (unlikely(test_suspend_state(SUSPEND_RUNNING)))
> + printk("Order %d allocation %p added to slab %p.\n",
> + cachep->gfporder, addr, cachep);
> page = virt_to_page(addr);
> } else {

--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!