From 4f872a6f750bd5967aff75a33deade69908843eb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 24 Jul 2024 00:23:13 -0400 Subject: [PATCH] kernel/vm: Actually initialize all members of the vm_page bitfield. If we do, the compiler should merge the stores and avoid loading and masking, saving some instructions. --- headers/private/kernel/vm/vm_types.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/headers/private/kernel/vm/vm_types.h b/headers/private/kernel/vm/vm_types.h index 397997d723..138f8a144b 100644 --- a/headers/private/kernel/vm/vm_types.h +++ b/headers/private/kernel/vm/vm_types.h @@ -205,18 +205,23 @@ inline void vm_page::Init(page_num_t pageNumber) { physical_page_number = pageNumber; - InitState(PAGE_STATE_FREE); new(&mappings) vm_page_mappings(); - fWiredCount = 0; - usage_count = 0; - busy_writing = false; SetCacheRef(NULL); - #if DEBUG_PAGE_QUEUE - queue = NULL; - #endif - #if DEBUG_PAGE_ACCESS - accessing_thread = -1; - #endif + + InitState(PAGE_STATE_FREE); + busy = busy_writing = false; + accessed = modified = false; + _unused = 0; + usage_count = 0; + + fWiredCount = 0; + +#if DEBUG_PAGE_QUEUE + queue = NULL; +#endif +#if DEBUG_PAGE_ACCESS + accessing_thread = -1; +#endif }