Hi, On 2/11/24 9:43 PM, Samuel Thibault wrote:
> Damien Zammit, le dim. 11 févr. 2024 07:09:48 +0000, a ecrit: >> diff --git a/configfrag.ac b/configfrag.ac >> index f9285c9d..d059c7b9 100644 >> --- a/configfrag.ac >> +++ b/configfrag.ac >> @@ -71,7 +71,7 @@ AC_DEFINE([MACH_DEBUG], [1], [MACH_DEBUG]) >> AC_DEFINE([MACH_FIXPRI], [1], [MACH_FIXPRI]) >> >> # Mach host (resource alloc.). >> -AC_DEFINE([MACH_HOST], [0], [MACH_HOST]) >> +AC_DEFINE([MACH_HOST], [1], [MACH_HOST]) > That's enabling a significant part of code. Better only enable it only > for NCPUS > 1 OK that is fair. >> diff --git a/kern/task.h b/kern/task.h >> index dec3a530..27970620 100644 >> --- a/kern/task.h >> +++ b/kern/task.h >> @@ -61,11 +61,11 @@ struct task { >> decl_simple_lock_data(,lock) /* Task's lock */ >> int ref_count; /* Number of references to me */ >> >> - /* Flags */ >> - unsigned int active:1, /* Task has not been terminated */ >> - /* boolean_t */ may_assign:1, /* can assigned pset be changed? */ >> - assign_active:1, /* waiting for may_assign */ >> - essential:1; /* Is this task essential for the >> system? */ >> + /* Addressable flags */ >> + unsigned char active; /* Task has not been terminated */ >> + unsigned char may_assign; /* can assigned pset be changed? */ >> + unsigned char assign_active; /* waiting for may_assign */ >> + unsigned char essential; /* Is this task essential for the >> system? */ > AIUI only assign_active need to be adressable? Better make only that one > addressable. Looking at the existing flag types, it needs to fit into part of a cacheline. The way I have done it, I rearranged the existing 4 byte integer to be 4 separate single byte flags. If you want me to put only one of the values into an addressable field, how will I retain the same size for the rest of the fields? Damien