[lkml]   [2009]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/6] ksm: dont allow overlap memory addresses registrations.
Rik van Riel wrote:
> Izik Eidus wrote:
>> Rik van Riel wrote:
>>> Izik Eidus wrote:
>>>> subjects say it all.
>>> Not a very useful commit message.
>>> This makes me wonder, though.
>>> What happens if a user mmaps a 30MB memory region, registers it
>>> with KSM and then unmaps the middle 10MB?
>> User cant break 30MB into smaller one.
> The user can break up the underlying VMAs though.

So? KSM work on contigiouns virtual address, if user will break its
virtual address and will leave it to be registered inside ksm
get_user_pages() will just fail, and ksm will skip scanning this

Normal usage of ksm is:

1) Allocating big chunck of memory.

2) registering it inside ksm

3) free the memory and remove it from ksm...

> I am just wondering out loud if we really want two
> VMA-like objects in the kernel, the VMA itself and
> a separate KSM object, with different semantics.
> Maybe this is fine, but I do think it's a question
> that needs to be thought about.

Yea, we had some talk about that issue, considering the fact that user
register its memory using ioctl and not systemcall, and considering the
fact that ksm is loadable module that the kernel doesnt depend on,

How would you prefer to see the interface?

 \ /
  Last update: 2009-05-06 14:49    [W:0.097 / U:21.896 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site