mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:12:44 +00:00 
			
		
		
		
	Kernel: Make Region::amount_shared() and amount_resident() lazy-aware
Don't count the lazy-committed page towards shared/resident amounts.
This commit is contained in:
		
							parent
							
								
									f5384d7c70
								
							
						
					
					
						commit
						14493645e0
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -219,7 +219,7 @@ size_t Region::amount_resident() const | |||
|     size_t bytes = 0; | ||||
|     for (size_t i = 0; i < page_count(); ++i) { | ||||
|         auto* page = physical_page(i); | ||||
|         if (page && !page->is_shared_zero_page()) | ||||
|         if (page && !page->is_shared_zero_page() && !page->is_lazy_committed_page()) | ||||
|             bytes += PAGE_SIZE; | ||||
|     } | ||||
|     return bytes; | ||||
|  | @ -230,7 +230,7 @@ size_t Region::amount_shared() const | |||
|     size_t bytes = 0; | ||||
|     for (size_t i = 0; i < page_count(); ++i) { | ||||
|         auto* page = physical_page(i); | ||||
|         if (page && page->ref_count() > 1 && !page->is_shared_zero_page()) | ||||
|         if (page && page->ref_count() > 1 && !page->is_shared_zero_page() && !page->is_lazy_committed_page()) | ||||
|             bytes += PAGE_SIZE; | ||||
|     } | ||||
|     return bytes; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling