mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Kernel: Release the paging lock while reading from the disk
Because reading from the disk may preempt, we need to release the paging lock.
This commit is contained in:
parent
1110c659ee
commit
fe679de791
1 changed files with 8 additions and 2 deletions
|
@ -539,8 +539,14 @@ PageFaultResponse Region::handle_inode_fault(size_t page_index_in_region, Scoped
|
|||
|
||||
// Reading the page may block, so release the MM lock temporarily
|
||||
mm_lock.unlock();
|
||||
auto buffer = UserOrKernelBuffer::for_kernel_buffer(page_buffer);
|
||||
auto result = inode.read_bytes(page_index_in_vmobject * PAGE_SIZE, PAGE_SIZE, buffer, nullptr);
|
||||
|
||||
KResultOr<ssize_t> result(KSuccess);
|
||||
{
|
||||
ScopedLockRelease release_paging_lock(vmobject().m_paging_lock);
|
||||
auto buffer = UserOrKernelBuffer::for_kernel_buffer(page_buffer);
|
||||
result = inode.read_bytes(page_index_in_vmobject * PAGE_SIZE, PAGE_SIZE, buffer, nullptr);
|
||||
}
|
||||
|
||||
mm_lock.lock();
|
||||
|
||||
if (result.is_error()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue