[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
- [RFC PATCH 0/7] Forward merging entries and other VM shenanigans, Sergey Bugaev, 2023/06/26
- [RFC PATCH 2/7] vm: Allow coalescing a VM object with itself, Sergey Bugaev, 2023/06/26
- [RFC PATCH 1/7] Shrink struct vm_page size, Sergey Bugaev, 2023/06/26
- [RFC PATCH 4/7] vm: Allow coalescing entries forward, Sergey Bugaev, 2023/06/26
- [RFC PATCH 3/7] vm: Allow coalescing null object with an internal object, Sergey Bugaev, 2023/06/26
- [RFC PATCH 7/7] vm: Coalesce map entries, Sergey Bugaev, 2023/06/26
- [RFC PATCH 6/7] vm: Add vm_map_coalesce_entry, Sergey Bugaev, 2023/06/26
- Re: [RFC PATCH 6/7] vm: Add vm_map_coalesce_entry,
Sergey Bugaev <=
- [RFC PATCH 5/7] vm: Eagerly release deallocated pages, Sergey Bugaev, 2023/06/26