Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

task_struct: move ->fpu_counter and ->oomkilladj

There is nice 2 byte hole after struct task_struct::ioprio field
into which we can put two 1-byte fields: ->fpu_counter and ->oomkilladj.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Acked-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
18796aa0 f7a75f0a

+10 -10
+10 -10
include/linux/sched.h
··· 918 918 #endif 919 919 920 920 unsigned short ioprio; 921 + /* 922 + * fpu_counter contains the number of consecutive context switches 923 + * that the FPU is used. If this is over a threshold, the lazy fpu 924 + * saving becomes unlazy to save the trap. This is an unsigned char 925 + * so that after 256 times the counter wraps and the behavior turns 926 + * lazy again; this to deal with bursty apps that only use FPU for 927 + * a short time 928 + */ 929 + unsigned char fpu_counter; 930 + s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ 921 931 #ifdef CONFIG_BLK_DEV_IO_TRACE 922 932 unsigned int btrace_seq; 923 933 #endif ··· 1013 1003 struct key *thread_keyring; /* keyring private to this thread */ 1014 1004 unsigned char jit_keyring; /* default keyring to attach requested keys to */ 1015 1005 #endif 1016 - /* 1017 - * fpu_counter contains the number of consecutive context switches 1018 - * that the FPU is used. If this is over a threshold, the lazy fpu 1019 - * saving becomes unlazy to save the trap. This is an unsigned char 1020 - * so that after 256 times the counter wraps and the behavior turns 1021 - * lazy again; this to deal with bursty apps that only use FPU for 1022 - * a short time 1023 - */ 1024 - unsigned char fpu_counter; 1025 - s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ 1026 1006 char comm[TASK_COMM_LEN]; /* executable name excluding path 1027 1007 - access with [gs]et_task_comm (which lock 1028 1008 it with task_lock())