Re: [PATCH 3/6] ksm: change the KSM_REMOVE_MEMORY_REGION ioctl.

From: Chris Wright
Date: Wed May 06 2009 - 12:16:23 EST


* Izik Eidus (ieidus@xxxxxxxxxx) wrote:
> But why not go go step by step?
> We can first start with this ioctl interface, later when we add swapping
> to the pages, we can have madvice, and still (probably easily) support
> the ioctls by just calling from inside ksm the madvice functions for
> that specific address)

Then we have 2 interfaces to maintain. Makes more sense to try and get
it right the first time.

> I want to see ksm use madvice, but i believe it require some more
> changes to mm/*.c, so it probably better to start with merging it when
> it doesnt touch alot of stuff outisde ksm.c, and then to add swapping
> and after that add madvice support (when the pages are swappable,
> everyone can use it)

There's already locking issues w/ using madvise and ksm, so yes,
changes would need to be made. Some question of how (whether) to handle
registration of unmapped ranges, closest to say ->mm->def_flags=VM_MERGE.
My hunch is there's 2 cases users might care about, a specific range
(qemu-kvm, CERN app, etc) or the entire vma space of a process. Another
question of what to do w/ VM_LOCKED, should that exclude VM_MERGE or
let user get what asked for?

thanks,
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/