mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:57:44 +00:00
Kernel: Specify default memory order for some non-synchronizing Atomics
This commit is contained in:
parent
fb84f0ec9c
commit
901ef3f1c8
12 changed files with 44 additions and 43 deletions
|
@ -205,7 +205,7 @@ void MemoryManager::parse_memory_map()
|
|||
ASSERT(m_user_physical_pages > 0);
|
||||
|
||||
// We start out with no committed pages
|
||||
m_user_physical_pages_uncommitted = m_user_physical_pages;
|
||||
m_user_physical_pages_uncommitted = m_user_physical_pages.load();
|
||||
}
|
||||
|
||||
PageTableEntry* MemoryManager::pte(PageDirectory& page_directory, VirtualAddress vaddr)
|
||||
|
|
|
@ -208,12 +208,12 @@ private:
|
|||
RefPtr<PhysicalPage> m_shared_zero_page;
|
||||
RefPtr<PhysicalPage> m_lazy_committed_page;
|
||||
|
||||
unsigned m_user_physical_pages { 0 };
|
||||
unsigned m_user_physical_pages_used { 0 };
|
||||
unsigned m_user_physical_pages_committed { 0 };
|
||||
unsigned m_user_physical_pages_uncommitted { 0 };
|
||||
unsigned m_super_physical_pages { 0 };
|
||||
unsigned m_super_physical_pages_used { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_used { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_committed { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_uncommitted { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_super_physical_pages { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_super_physical_pages_used { 0 };
|
||||
|
||||
NonnullRefPtrVector<PhysicalRegion> m_user_physical_regions;
|
||||
NonnullRefPtrVector<PhysicalRegion> m_super_physical_regions;
|
||||
|
|
|
@ -67,9 +67,9 @@ public:
|
|||
VMObject* m_next { nullptr };
|
||||
VMObject* m_prev { nullptr };
|
||||
|
||||
ALWAYS_INLINE void ref_region() { m_regions_count.fetch_add(1, AK::MemoryOrder::memory_order_relaxed); }
|
||||
ALWAYS_INLINE void unref_region() { m_regions_count.fetch_sub(1, AK::MemoryOrder::memory_order_relaxed); }
|
||||
ALWAYS_INLINE bool is_shared_by_multiple_regions() const { return m_regions_count.load(AK::MemoryOrder::memory_order_relaxed) > 1; }
|
||||
ALWAYS_INLINE void ref_region() { m_regions_count++; }
|
||||
ALWAYS_INLINE void unref_region() { m_regions_count--; }
|
||||
ALWAYS_INLINE bool is_shared_by_multiple_regions() const { return m_regions_count > 1; }
|
||||
|
||||
protected:
|
||||
explicit VMObject(size_t);
|
||||
|
@ -88,7 +88,7 @@ private:
|
|||
VMObject& operator=(VMObject&&) = delete;
|
||||
VMObject(VMObject&&) = delete;
|
||||
|
||||
Atomic<u32> m_regions_count { 0 };
|
||||
Atomic<u32, AK::MemoryOrder::memory_order_relaxed> m_regions_count { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue