[RFC][PATCH 3/6] sched: Re-arrange the {EN,DE}QUEUE flags

Peter Zijlstra posted 6 patches 3 weeks, 4 days ago
[RFC][PATCH 3/6] sched: Re-arrange the {EN,DE}QUEUE flags
Posted by Peter Zijlstra 3 weeks, 4 days ago
Ensure the matched flags are in the low byte while the unmatched flags
go into the second byte.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/sched/sched.h |   27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2337,26 +2337,25 @@ extern const u32		sched_prio_to_wmult[40
 #define DEQUEUE_SAVE		0x02 /* Matches ENQUEUE_RESTORE */
 #define DEQUEUE_MOVE		0x04 /* Matches ENQUEUE_MOVE */
 #define DEQUEUE_NOCLOCK		0x08 /* Matches ENQUEUE_NOCLOCK */
-#define DEQUEUE_SPECIAL		0x10
-#define DEQUEUE_MIGRATING	0x100 /* Matches ENQUEUE_MIGRATING */
-#define DEQUEUE_DELAYED		0x200 /* Matches ENQUEUE_DELAYED */
+
+#define DEQUEUE_MIGRATING	0x10 /* Matches ENQUEUE_MIGRATING */
+#define DEQUEUE_DELAYED		0x20 /* Matches ENQUEUE_DELAYED */
+
+#define DEQUEUE_SPECIAL		0x0100
 
 #define ENQUEUE_WAKEUP		0x01
 #define ENQUEUE_RESTORE		0x02
 #define ENQUEUE_MOVE		0x04
 #define ENQUEUE_NOCLOCK		0x08
 
-#define ENQUEUE_HEAD		0x10
-#define ENQUEUE_REPLENISH	0x20
-#ifdef CONFIG_SMP
-#define ENQUEUE_MIGRATED	0x40
-#else
-#define ENQUEUE_MIGRATED	0x00
-#endif
-#define ENQUEUE_INITIAL		0x80
-#define ENQUEUE_MIGRATING	0x100
-#define ENQUEUE_DELAYED		0x200
-#define ENQUEUE_RQ_SELECTED	0x400
+#define ENQUEUE_MIGRATING	0x10
+#define ENQUEUE_DELAYED		0x20
+
+#define ENQUEUE_HEAD		0x0100
+#define ENQUEUE_REPLENISH	0x0200
+#define ENQUEUE_MIGRATED	(0x0400*IS_ENABLED(CONFIG_SMP))
+#define ENQUEUE_INITIAL		0x0800
+#define ENQUEUE_RQ_SELECTED	0x1000
 
 #define RETRY_TASK		((void *)-1UL)