[linux-mm-cc] compcache with swap free notify support

Nitin Gupta nitingupta910 at gmail.com
Mon Jun 16 09:33:20 EDT 2008

On Mon, Jun 16, 2008 at 6:33 PM, John McCabe-Dansted <gmatht at gmail.com> wrote:
> On Mon, Jun 16, 2008 at 4:59 PM, Nitin Gupta <nitingupta910 at gmail.com> wrote:
>> Hi All,
>> Attached is the patch for much refined version of compcache (for
>> kernel 2.6.26-rc6). This version saves lot more memory than previous
>> versions since it now know when a swap page is no longer in use. So,
> Just to clarify, there could still be two copies of the page if the
> page is clean but not free?

Yes, that's true.

> Notification that a page is free could be useful in other cases as
> well. E.g. if you are in a VM with dynamic partitions, it could be
> useful for ext4 to tell the VM that some sectors are no longer
> required.
> Also just to comment on "the colour of the bikeshed"*
>                       if (p->notify_swap_entry_free_fn)
> could perhaps be
>                       if (unlikely(p->notify_swap_entry_free_fn))
> to minimize the effect of this change on people who don't need it,
> until compcache enters widespread use.
> Also the line could be #ifdef'd out if it is not in use (but the
> kernel folks don't like ifdefs?)

This unlikely() will not be good for compcache so, cleanly introducing
ifdef (via some wrapper that's noop without compcache) sounds better.
I will post this on LKML to get more feedback on this.

Overall, with this notify thing, compcache is now just so good :)


> * The cost of a single branch is probably insignificant compared to
> the cost of swap (including disk access), but everyone likes to voice
> an opinion :) (and now you know some one has at least skimmed the
> code)
>>  - In kernel config, enable (as module or in-built): Device Drivers
> You can also just do a "make oldconfig" and hit the 'y' key several times.
> --
> John C. McCabe-Dansted
> PhD Student
> University of Western Australia

More information about the linux-mm-cc mailing list