On Wed, Aug 6, 2008 at 2:47 PM, Daniel Godás <[EMAIL PROTECTED]> wrote: > As you pointed out, i was just replying to you instead of the list > (thx for that) so heres my last message and my answer to you answer: > > The problem i see is that slots are a scarce resource (i think they > are limited to 8 now) and they shouldnt be wasted. There are some > cases in which we could run out of slots even without having any > memory holes. > > Sample case: > > 1) Create continuous memory block (1 slot used) > 2) Create memory hole (3 slots used: mem - hole - mem) > 3) Remove memory hole (3 slots used: mem - mem - mem) > 4) Map the hole somewhere else (5 slots used: mem - hole - mem - mem - mem) > 5) Remove memory hole (5 slots used: mem - mem - mem - mem - mem) > > With the change I propose we could be using just 1 slot in 1) and 5) > and only 3 in 4). > > Of course the slot-merging should be done in kernel space just like in > the user space example. > > --- > > In your last mail you say slots are not a scarce resource so i > understand the 8 limitation could be raised to many more (maybe in the > hundreds?). Anyway, each slot you create is a new structure in memory. > I still think it would be better to have as few as possible, specially > when the solution doesnt seem to have any counterparts. This procedure > would only take cpu time when a slot gets inserted or removed and not > while the vm is running so whats the problem with it? > Well, it does seem to have a lot of counterparts. The patch you posted does not have, but you did not solve the problem either. To do the kernel part, you'd have to cope with the userspace addresses too.
AFAIK, the same slot must have a contiguous userspace virtual address. To grant that, you'd have to cope, for example, with the case in which you'd have to augment the current address space, then move the data from the old place to there. Of course this is a naive solution, you could avoid the copy in some cases. My point is: If you really need that many slots, it's probably easier and more worthy to invest time in algorithms to handle a large number of them, (avoiding a linear search, for ex), instead of doing this slot merging. Anyway, you, or someone else, may have a different argument on this, but that's my position so far. -- Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act." -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
