mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel: Don't flush TLB after creating brand-new mappings
The CPU will not cache TLB entries for non-present mappings, so we can simply skip flushing the TLB after creating entirely new mappings.
This commit is contained in:
parent
068aea660c
commit
de05223122
1 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,7 @@ ErrorOr<Region*> AddressSpace::allocate_region(VirtualRange const& range, String
|
|||
region_name = TRY(KString::try_create(name));
|
||||
auto vmobject = TRY(AnonymousVMObject::try_create_with_size(range.size(), strategy));
|
||||
auto region = TRY(Region::try_create_user_accessible(range, move(vmobject), 0, move(region_name), prot_to_region_access_flags(prot), Region::Cacheable::Yes, false));
|
||||
TRY(region->map(page_directory()));
|
||||
TRY(region->map(page_directory(), ShouldFlushTLB::No));
|
||||
return add_region(move(region));
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ ErrorOr<Region*> AddressSpace::allocate_region_with_vmobject(VirtualRange const&
|
|||
region_name = TRY(KString::try_create(name));
|
||||
auto region = TRY(Region::try_create_user_accessible(range, move(vmobject), offset_in_vmobject, move(region_name), prot_to_region_access_flags(prot), Region::Cacheable::Yes, shared));
|
||||
auto* added_region = TRY(add_region(move(region)));
|
||||
TRY(added_region->map(page_directory()));
|
||||
TRY(added_region->map(page_directory(), ShouldFlushTLB::No));
|
||||
return added_region;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue