All right, my question is not sufficiently specific. I've not mentioned the kernel version, the distribution and other potentially interesting things. But, anyway... these are important but doesn't matter essentially in this crude context (what I can bear for now).
If nice value is in the interval of [-20,20), why to store it in a large space memory (actually,8 bytes)? What kind of advantage could someone/the processor take from it?
Origin of this doubt: https://www.researchgate.net/post/How_many_bytes_are_used_to_makes_the_structure_of_process_control_block_in_Assembly_language_programming_and_what_do_these_bytes_store)
"Reinforcement"(https://github.com/torvalds/linux/blob/master/include/linux/sched.h)
long nice
I can find in the "Reinforcement" link you provided is the parameter toset_user_nice
, which is long because it is called from the syscall interface. System calls on x86_64 pass parameters in 1-6 registers, and the full 64-bit registers are used. All the other variables are of typeint
, like theprio
,static_prio
, etc fields intask_struct
.int
is 32 bits on x86_64.int
is also the natural size in C; smaller types are expanded toint
in expressions, as are function parameters, even if they are declaredchar
. So you will have to be more specific. – Johan Myréen Jul 10 '19 at 18:38