mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	Kernel/SMP: Don't panic in inode fault if other CPU already paged it in
It may happen that CPU A manages to page in from the same inode while we're just entering the same page fault handler on CPU B. Handle it gracefully by checking if the data has already been paged in (instead of VERIFY'ing that it hasn't) and then remap the page if that's the case.
This commit is contained in:
		
							parent
							
								
									00bbbdeda6
								
							
						
					
					
						commit
						6283acb6b7
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		|  | @ -401,7 +401,16 @@ PageFaultResponse Region::handle_inode_fault(size_t page_index_in_region) | |||
| 
 | ||||
|     auto page_index_in_vmobject = translate_to_vmobject_page(page_index_in_region); | ||||
|     auto& vmobject_physical_page_entry = inode_vmobject.physical_pages()[page_index_in_vmobject]; | ||||
|     VERIFY(vmobject_physical_page_entry.is_null()); | ||||
| 
 | ||||
|     { | ||||
|         ScopedSpinLock locker(inode_vmobject.m_lock); | ||||
|         if (!vmobject_physical_page_entry.is_null()) { | ||||
|             dbgln_if(PAGE_FAULT_DEBUG, "handle_inode_fault: Page faulted in by someone else before reading, remapping."); | ||||
|             if (!remap_vmobject_page(page_index_in_vmobject)) | ||||
|                 return PageFaultResponse::OutOfMemory; | ||||
|             return PageFaultResponse::Continue; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     dbgln_if(PAGE_FAULT_DEBUG, "Inode fault in {} page index: {}", name(), page_index_in_region); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling