Kernel: Make F11 drop disk cache
This can be useful to detect memory leaks or something
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Kernel
|
||||
|
||||
void add_inode(BAN::StringView path, BAN::RefPtr<TmpInode>);
|
||||
|
||||
void initiate_disk_cache_drop();
|
||||
void initiate_sync(bool should_block);
|
||||
|
||||
private:
|
||||
@@ -37,6 +38,10 @@ namespace Kernel
|
||||
ThreadBlocker m_sync_done;
|
||||
ThreadBlocker m_sync_thread_blocker;
|
||||
volatile bool m_should_sync { false };
|
||||
|
||||
SpinLock m_disk_cache_lock;
|
||||
ThreadBlocker m_disk_cache_thread_blocker;
|
||||
BAN::Atomic<bool> m_should_drop_disk_cache { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Kernel
|
||||
BAN::Vector<BAN::RefPtr<Partition>>& partitions() { return m_partitions; }
|
||||
const BAN::Vector<BAN::RefPtr<Partition>>& partitions() const { return m_partitions; }
|
||||
|
||||
size_t drop_disk_cache();
|
||||
BAN::ErrorOr<void> sync_disk_cache();
|
||||
virtual bool is_storage_device() const override { return true; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user