Skip to content

Commit 799ba82

Browse files
luca abeniIngo Molnar
authored andcommitted
sched/deadline: Use C bitfields for the state flags
Ask the compiler to use a single bit for storing true / false values, instead of wasting the size of a whole int value. Tested with gcc 5.4.0 on x86_64, and the compiler produces the expected Assembly (similar to the Assembly code generated when explicitly accessing the bits with bitmasks, "&" and "|"). Signed-off-by: luca abeni <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Daniel Bristot de Oliveira <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 8c0944c commit 799ba82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/sched.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,10 @@ struct sched_dl_entity {
474474
* conditions between the inactive timer handler and the wakeup
475475
* code.
476476
*/
477-
int dl_throttled;
478-
int dl_boosted;
479-
int dl_yielded;
480-
int dl_non_contending;
477+
int dl_throttled : 1;
478+
int dl_boosted : 1;
479+
int dl_yielded : 1;
480+
int dl_non_contending : 1;
481481

482482
/*
483483
* Bandwidth enforcement timer. Each -deadline task has its

0 commit comments

Comments
 (0)