From: Peter Zijlstra <peterz@infradead.org>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, linux-tip-commits@vger.kernel.org,
Fengguang Wu <fengguang.wu@intel.com>,
Huang Ying <ying.huang@intel.com>,
lkp@linux.intel.com
Subject: [PATCH] sched: Revert need_resched() to look at TIF_NEED_RESCHED
Date: Fri, 27 Sep 2013 17:30:03 +0200 [thread overview]
Message-ID: <20130927153003.GF15690@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <20130927091427.GE24743@yliu-dev.sh.intel.com>
Subject: sched: Revert need_resched() to look at TIF_NEED_RESCHED
From: Peter Zijlstra <peterz@infradead.org>
Date: Fri Sep 27 17:20:30 CEST 2013
Yuanhan reported a serious throughput regression in his pigz
benchmark. Using the ftrace patch I found that several idle paths
need more TLC before we can switch the generic need_resched() over to
preempt_need_resched.
The preemption paths benefit most from preempt_need_resched and do
indeed use it; all other need_resched() users don't really care that
much so reverting need_resched() back to tif_need_resched() is the
simple and safe solution.
Reported-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
---
arch/x86/include/asm/preempt.h | 8 --------
include/asm-generic/preempt.h | 8 --------
include/linux/sched.h | 5 +++++
3 files changed, 5 insertions(+), 16 deletions(-)
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
@@ -80,14 +80,6 @@ static __always_inline bool __preempt_co
}
/*
- * Returns true when we need to resched -- even if we can not.
- */
-static __always_inline bool need_resched(void)
-{
- return unlikely(test_preempt_need_resched());
-}
-
-/*
* Returns true when we need to resched and can (barring IRQ state).
*/
static __always_inline bool should_resched(void)
--- a/include/asm-generic/preempt.h
+++ b/include/asm-generic/preempt.h
@@ -85,14 +85,6 @@ static __always_inline bool __preempt_co
}
/*
- * Returns true when we need to resched -- even if we can not.
- */
-static __always_inline bool need_resched(void)
-{
- return unlikely(test_preempt_need_resched());
-}
-
-/*
* Returns true when we need to resched and can (barring IRQ state).
*/
static __always_inline bool should_resched(void)
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2577,6 +2577,11 @@ static inline bool __must_check current_
}
#endif
+static __always_inline bool need_resched(void)
+{
+ return unlikely(tif_need_resched());
+}
+
/*
* Thread group CPU time accounting.
*/
next prev parent reply other threads:[~2013-09-27 15:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 16:38 [tip:sched/core] sched: Add NEED_RESCHED to the preempt_count tip-bot for Peter Zijlstra
2013-09-27 9:14 ` Yuanhan Liu
2013-09-27 11:57 ` Peter Zijlstra
2013-09-27 12:13 ` Fengguang Wu
2013-09-27 12:20 ` Fengguang Wu
2013-09-27 15:29 ` [PATCH] ftrace, sched: Add TRACE_FLAG_PREEMPT_RESCHED Peter Zijlstra
2013-10-04 8:09 ` Peter Zijlstra
2013-10-04 14:53 ` Steven Rostedt
2013-10-04 15:16 ` Peter Zijlstra
2013-10-04 15:25 ` Steven Rostedt
2013-10-04 15:28 ` Peter Zijlstra
2013-10-04 15:57 ` Steven Rostedt
2013-10-04 16:28 ` Peter Zijlstra
2013-11-11 17:52 ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-11-06 16:37 ` [PATCH] " Steven Rostedt
2013-11-06 16:45 ` Peter Zijlstra
2013-11-06 16:58 ` Steven Rostedt
2013-11-06 17:23 ` Peter Zijlstra
2013-09-27 15:30 ` Peter Zijlstra [this message]
2013-09-28 8:28 ` [tip:sched/core] sched: Revert need_resched() to look at TIF_NEED_RESCHED tip-bot for Peter Zijlstra
2013-12-09 6:41 ` [PATCH] " Aneesh Kumar K.V
2013-12-10 15:52 ` Peter Zijlstra
2013-11-28 13:26 ` [PATCH] sched: Remove PREEMPT_NEED_RESCHED from generic code Peter Zijlstra
2013-11-28 15:24 ` Alexander Graf
2013-12-09 6:29 ` Benjamin Herrenschmidt
2013-12-12 9:51 ` [tip:sched/urgent] " tip-bot for 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=20130927153003.GF15690@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lkp@linux.intel.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.com \
--cc=yuanhan.liu@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.