Skip to content

Commit 18796aa

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
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 <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f7a75f0 commit 18796aa

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

include/linux/sched.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,16 @@ struct task_struct {
918918
#endif
919919

920920
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). */
921931
#ifdef CONFIG_BLK_DEV_IO_TRACE
922932
unsigned int btrace_seq;
923933
#endif
@@ -1003,16 +1013,6 @@ struct task_struct {
10031013
struct key *thread_keyring; /* keyring private to this thread */
10041014
unsigned char jit_keyring; /* default keyring to attach requested keys to */
10051015
#endif
1006-
/*
1007-
* fpu_counter contains the number of consecutive context switches
1008-
* that the FPU is used. If this is over a threshold, the lazy fpu
1009-
* saving becomes unlazy to save the trap. This is an unsigned char
1010-
* so that after 256 times the counter wraps and the behavior turns
1011-
* lazy again; this to deal with bursty apps that only use FPU for
1012-
* a short time
1013-
*/
1014-
unsigned char fpu_counter;
1015-
s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
10161016
char comm[TASK_COMM_LEN]; /* executable name excluding path
10171017
- access with [gs]et_task_comm (which lock
10181018
it with task_lock())

0 commit comments

Comments
 (0)