From: Davidlohr Bueso <dave@stgolabs.net>
To: akpm@linux-foundation.org
Cc: dave@stgolabs.net, linux-kernel@vger.kernel.org,
peterz@infradead.org, mingo@kernel.org
Subject: [PATCH 2/6] kernel/sched: Remove caller signal_pending branch predictions
Date: Thu, 15 Nov 2018 16:27:09 -0800 [thread overview]
Message-ID: <20181116002713.8474-3-dave@stgolabs.net> (raw)
In-Reply-To: <20181116002713.8474-1-dave@stgolabs.net>
This is already done for us internally by the signal machinery.
Cc: peterz@infradead.org
Cc: mingo@kernel.org
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
---
kernel/sched/core.c | 2 +-
kernel/sched/swait.c | 2 +-
kernel/sched/wait.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f12225f26b70..1972b4c63a1f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3416,7 +3416,7 @@ static void __sched notrace __schedule(bool preempt)
switch_count = &prev->nivcsw;
if (!preempt && prev->state) {
- if (unlikely(signal_pending_state(prev->state, prev))) {
+ if (signal_pending_state(prev->state, prev)) {
prev->state = TASK_RUNNING;
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP | DEQUEUE_NOCLOCK);
diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c
index 66b59ac77c22..e83a3f8449f6 100644
--- a/kernel/sched/swait.c
+++ b/kernel/sched/swait.c
@@ -93,7 +93,7 @@ long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait
long ret = 0;
raw_spin_lock_irqsave(&q->lock, flags);
- if (unlikely(signal_pending_state(state, current))) {
+ if (signal_pending_state(state, current)) {
/*
* See prepare_to_wait_event(). TL;DR, subsequent swake_up_one()
* must not see us.
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
index 5dd47f1103d1..6eb1f8efd221 100644
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -264,7 +264,7 @@ long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_en
long ret = 0;
spin_lock_irqsave(&wq_head->lock, flags);
- if (unlikely(signal_pending_state(state, current))) {
+ if (signal_pending_state(state, current)) {
/*
* Exclusive waiter must not fail if it was selected by wakeup,
* it should "consume" the condition we were waiting for.
--
2.16.4
next prev parent reply other threads:[~2018-11-16 0:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 0:27 [PATCH -next 0/6] treewide: Remove redundant branch predictions around signal_pending family Davidlohr Bueso
2018-11-16 0:27 ` [PATCH 1/6] locking/mutex: Remove caller signal_pending branch predictions Davidlohr Bueso
2018-11-16 0:27 ` Davidlohr Bueso [this message]
2018-11-16 0:27 ` [PATCH 3/6] arch/arc: Remove caller signal_pending_branch predictions Davidlohr Bueso
2018-11-16 0:27 ` [PATCH 4/6] mm: Remove caller signal_pending branch predictions Davidlohr Bueso
2018-11-16 0:27 ` [PATCH 5/6] drivers/i2c: " Davidlohr Bueso
2018-11-27 12:01 ` [5/6] " Wolfram Sang
2018-11-16 0:27 ` [PATCH 6/6] fs: " Davidlohr Bueso
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=20181116002713.8474-3-dave@stgolabs.net \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).