Kernel: Avoid flushing the tlb if there's only one thread
If we're flushing user space pointers and the process only has one thread, we do not need to broadcast this to other processors as they will all discard that request anyway.
This commit is contained in:
parent
40a5487bab
commit
b445f15131
Notes:
sideshowbarker
2024-07-18 22:22:04 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/b445f151317 Pull-request: https://github.com/SerenityOS/serenity/pull/5333
1 changed files with 1 additions and 1 deletions
|
@ -1703,7 +1703,7 @@ void Processor::flush_tlb_local(VirtualAddress vaddr, size_t page_count)
|
|||
|
||||
void Processor::flush_tlb(const PageDirectory* page_directory, VirtualAddress vaddr, size_t page_count)
|
||||
{
|
||||
if (s_smp_enabled)
|
||||
if (s_smp_enabled && (!is_user_address(vaddr) || Process::current()->thread_count() > 1))
|
||||
smp_broadcast_flush_tlb(page_directory, vaddr, page_count);
|
||||
else
|
||||
flush_tlb_local(vaddr, page_count);
|
||||
|
|
Loading…
Add table
Reference in a new issue