mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:22:43 +00:00 
			
		
		
		
	Kernel: Don't remap already non-writable regions when they become CoW
The only purpose of the remap() in Region::try_clone() is to ensure non-writable page table entries for CoW regions. If a region is already non-writable, there's no need to waste time updating the page tables.
This commit is contained in:
		
							parent
							
								
									c6adefcfc0
								
							
						
					
					
						commit
						094b88e6a5
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -94,7 +94,8 @@ ErrorOr<NonnullOwnPtr<Region>> Region::try_clone() | |||
|     auto vmobject_clone = TRY(vmobject().try_clone()); | ||||
| 
 | ||||
|     // Set up a COW region. The parent (this) region becomes COW as well!
 | ||||
|     remap(); | ||||
|     if (is_writable()) | ||||
|         remap(); | ||||
| 
 | ||||
|     OwnPtr<KString> clone_region_name; | ||||
|     if (m_name) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling