[linux-mm-cc] compcache-0.5pre1 release

Nitin Gupta nitingupta910 at gmail.com
Fri Dec 26 13:20:33 EST 2008


On Wed, Dec 24, 2008 at 9:56 AM, John McCabe-Dansted <gmatht at gmail.com> wrote:

> I have attached a patch for you to look at. It isn't ready to be
> applied, but I have some questions.
>
> 1) Using Kmalloc instead of xv if size > PAGE_SIZE-512
>
> This is against compcache.c. Currently it does not even try to support
> 64bit or kfree on unload. Also for some reason it crashes after
> writing "setting size to ..." to /var/log/syslog.
>
> However does this seem a worthwhile approach?

This seems to be the _only_ way for now. Real thing would be to let
such pages go to real swap disk (if present). But till the time that
is implemented we should allocate full page to keep it or just return
I/O error as we currently do. It seems that if we return too many swap
I/O errors, we get into some problems (need to check block layer
stuff?).

In your code:
 + compcache.table[page_no].pageNum=(u32)(cmem);

you are casting virtual address to u32. This will surely segfault on
64bit. Maybe this is the reason for crash.

Nit: you are using GFP_KERNEL alloc flag with kmalloc - this can cause
deadlock: alloc memory to store compressed page -> not enough memory,
swap out something -> alloc memory to store compressed page -> ...and
this goes on.
So GFP_NOIO should be used.


>
> 2) warning the user if size is too large.
>
> In this patch I have used both "cat <<EOF" and multi line echo. I
> should probably pick just one. Do you have a preference?
>

Changes to script look good but now we need not have special warning
for 32-bit system as we not longer depend to virtual memory area.
I will apply these script changes and fix compcache changes to handle
incompressible pages.

Thanks for the patch.
Nitin


More information about the linux-mm-cc mailing list