mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 13:35:12 +00:00
Revert "Kernel: Allocate shared memory regions immediately"
This reverts commit fe6b3f99d1
.
This commit is contained in:
parent
4bc33ee3ae
commit
e3190bd144
Notes:
sideshowbarker
2024-07-19 00:11:49 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/e3190bd1442 Pull-request: https://github.com/SerenityOS/serenity/pull/4749
3 changed files with 2 additions and 8 deletions
|
@ -141,7 +141,7 @@ void* Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> user_params)
|
|||
}
|
||||
|
||||
if (map_anonymous) {
|
||||
auto strategy = map_shared ? AllocationStrategy::AllocateNow : (map_noreserve ? AllocationStrategy::None : AllocationStrategy::Reserve);
|
||||
auto strategy = map_noreserve ? AllocationStrategy::None : AllocationStrategy::Reserve;
|
||||
region = allocate_region(range.value(), !name.is_null() ? name : "mmap", prot, strategy);
|
||||
if (!region && (!map_fixed && addr != 0))
|
||||
region = allocate_region(allocate_range({}, size), !name.is_null() ? name : "mmap", prot, strategy);
|
||||
|
|
|
@ -52,7 +52,7 @@ int Process::sys$shbuf_create(int size, void** buffer)
|
|||
return -EINVAL;
|
||||
size = PAGE_ROUND_UP(size);
|
||||
|
||||
auto vmobject = AnonymousVMObject::create_with_size(size, AllocationStrategy::AllocateNow);
|
||||
auto vmobject = AnonymousVMObject::create_with_size(size, AllocationStrategy::Reserve);
|
||||
if (!vmobject)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -282,12 +282,6 @@ bool Region::map_individual_page_impl(size_t page_index)
|
|||
if (!page || (!is_readable() && !is_writable())) {
|
||||
pte->clear();
|
||||
} else {
|
||||
if (is_shared()) {
|
||||
// Shared memory should not be lazily populated!
|
||||
ASSERT(!page->is_shared_zero_page());
|
||||
ASSERT(!page->is_lazy_committed_page());
|
||||
}
|
||||
|
||||
pte->set_cache_disabled(!m_cacheable);
|
||||
pte->set_physical_page_base(page->paddr().get());
|
||||
pte->set_present(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue