mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Valentin Schneider" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Valentin Schneider <valentin.schneider@arm.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched: Add WF_TTWU, WF_EXEC wakeup flags
Date: Wed, 11 Nov 2020 08:23:13 -0000	[thread overview]
Message-ID: <160508299362.11244.3308131020454587854.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201102184514.2733-2-valentin.schneider@arm.com>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     17770579059258c5f1eef759e941af5f1a54f482
Gitweb:        https://git.kernel.org/tip/17770579059258c5f1eef759e941af5f1a54f482
Author:        Valentin Schneider <valentin.schneider@arm.com>
AuthorDate:    Mon, 02 Nov 2020 18:45:12 
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 10 Nov 2020 18:39:06 +01:00

sched: Add WF_TTWU, WF_EXEC wakeup flags

To remove the sd_flag parameter of select_task_rq(), we need another way of
encoding wakeup types. There already is a WF_FORK flag, add the missing two.

With that said, we still need an easy way to turn WF_foo into
SD_bar (e.g. WF_TTWU into SD_BALANCE_WAKE). As suggested by Peter, let's
make our lives easier and make them match exactly, and throw in some
compile-time checks for good measure.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201102184514.2733-2-valentin.schneider@arm.com
---
 kernel/sched/sched.h | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index e897d77..4725873 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1744,13 +1744,20 @@ static inline int task_on_rq_migrating(struct task_struct *p)
 	return READ_ONCE(p->on_rq) == TASK_ON_RQ_MIGRATING;
 }
 
-/*
- * wake flags
- */
-#define WF_SYNC			0x01		/* Waker goes to sleep after wakeup */
-#define WF_FORK			0x02		/* Child wakeup after fork */
-#define WF_MIGRATED		0x04		/* Internal use, task got migrated */
-#define WF_ON_CPU		0x08		/* Wakee is on_cpu */
+/* Wake flags. The first three directly map to some SD flag value */
+#define WF_EXEC     0x02 /* Wakeup after exec; maps to SD_BALANCE_EXEC */
+#define WF_FORK     0x04 /* Wakeup after fork; maps to SD_BALANCE_FORK */
+#define WF_TTWU     0x08 /* Wakeup;            maps to SD_BALANCE_WAKE */
+
+#define WF_SYNC     0x10 /* Waker goes to sleep after wakeup */
+#define WF_MIGRATED 0x20 /* Internal use, task got migrated */
+#define WF_ON_CPU   0x40 /* Wakee is on_cpu */
+
+#ifdef CONFIG_SMP
+static_assert(WF_EXEC == SD_BALANCE_EXEC);
+static_assert(WF_FORK == SD_BALANCE_FORK);
+static_assert(WF_TTWU == SD_BALANCE_WAKE);
+#endif
 
 /*
  * To aid in avoiding the subversion of "niceness" due to uneven distribution

  reply	other threads:[~2020-11-11  8:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 18:45 [PATCH v4 0/3] sched: Get rid of select_task_rq()'s sd_flag parameter Valentin Schneider
2020-11-02 18:45 ` [PATCH v4 1/3] sched: Add WF_TTWU, WF_EXEC wakeup flags Valentin Schneider
2020-11-11  8:23   ` tip-bot2 for Valentin Schneider [this message]
2020-11-02 18:45 ` [PATCH v4 2/3] sched: Remove select_task_rq()'s sd_flag parameter Valentin Schneider
2020-11-11  8:23   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-11-02 18:45 ` [PATCH v4 3/3] sched/fair: Dissociate wakeup decisions from SD flag value Valentin Schneider
2020-11-11  8:23   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2020-11-10 12:52 ` [PATCH v4 0/3] sched: Get rid of select_task_rq()'s sd_flag parameter Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160508299362.11244.3308131020454587854.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=valentin.schneider@arm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®