bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 6/7] vm: Add vm_map_coalesce_entry


From: Sergey Bugaev
Subject: Re: [RFC PATCH 6/7] vm: Add vm_map_coalesce_entry
Date: Mon, 26 Jun 2023 15:29:23 +0300

On Mon, Jun 26, 2023 at 2:27 PM Sergey Bugaev <bugaevc@gmail.com> wrote:
> +       /*
> +        *      Get rid of the entry without changing any wirings or the pmap,
> +       *       and without altering map->size.
> +        */
> +       prev->vme_end = entry->vme_end;
> +       vm_map_entry_unlink(map, entry);
> +       vm_object_deallocate(entry->object.vm_object);
> +       vm_map_entry_dispose(map, entry);

Here's a little issue: I'm always deallocating
entry->object.vm_object, but what if prev->object.vm_object was
VM_OBJECT_NULL, and it got coalesced the other way around? In that
case this needs to assign prev->object.vm_object to
entry->object.vm_object and deallocate nothing. And this will get more
complicated if vm_object_coalesce ever learns to coalesce actually
different objects into one.

So vm_object_coalesce needs to return, as an out parameter, the
resulting object, and the callers need to make use of it. I will do
that in v2 then.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]