From 7ff14fecba4051f8d3d67f801b01aaee648701b0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 14 Jul 2021 23:54:45 +0200 Subject: [PATCH] Kernel: Remove unnecessary locking in RangeAllocator::contains() The total range managed by a RangeAllocator doesn't change, so there's no need to take a spinlock while comparing against it. --- Kernel/VM/RangeAllocator.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Kernel/VM/RangeAllocator.h b/Kernel/VM/RangeAllocator.h index e98eb95a01..8c6c7bb0d5 100644 --- a/Kernel/VM/RangeAllocator.h +++ b/Kernel/VM/RangeAllocator.h @@ -28,11 +28,7 @@ public: void dump() const; - bool contains(Range const& range) const - { - ScopedSpinLock lock(m_lock); - return m_total_range.contains(range); - } + bool contains(Range const& range) const { return m_total_range.contains(range); } private: void carve_at_index(int, Range const&);