From: Steven Rostedt <rostedt@goodmis.org>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: kpreempt-tech@lists.sourceforge.net,
Peter Zijlstra <peterz@infradead.org>,
Robert Love <rml@tech9.net>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] sched/preempt: fix cond_resched_lock() and cond_resched_softirq()
Date: Thu, 7 May 2015 13:32:28 -0400 [thread overview]
Message-ID: <20150507173228.GA28383@home.goodmis.org> (raw)
In-Reply-To: <20150507170647.14403.30477.stgit@buzz>
On Thu, May 07, 2015 at 08:06:47PM +0300, Konstantin Khlebnikov wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index fe22f7510bce..087bf36ecd46 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4223,7 +4223,7 @@ SYSCALL_DEFINE0(sched_yield)
>
> int __sched _cond_resched(void)
> {
> - if (should_resched()) {
> + if (should_resched(0)) {
> preempt_schedule_common();
> return 1;
> }
> @@ -4241,7 +4241,7 @@ EXPORT_SYMBOL(_cond_resched);
> */
> int __cond_resched_lock(spinlock_t *lock)
> {
> - int resched = should_resched();
> + int resched = should_resched(PREEMPT_LOCK_OFFSET);
Hmm, yeah, the current code would have should_resched() always return false.
> int ret = 0;
>
> lockdep_assert_held(lock);
> @@ -4263,7 +4263,7 @@ int __sched __cond_resched_softirq(void)
> {
> BUG_ON(!in_softirq());
>
> - if (should_resched()) {
> + if (should_resched(SOFTIRQ_DISABLE_OFFSET)) {
Here too.
-- Steve
> local_bh_enable();
> preempt_schedule_common();
> local_bh_disable();
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2015-05-07 17:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 17:06 [PATCH] sched/preempt: fix cond_resched_lock() and cond_resched_softirq() Konstantin Khlebnikov
2015-05-07 17:32 ` Steven Rostedt [this message]
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=20150507173228.GA28383@home.goodmis.org \
--to=rostedt@goodmis.org \
--cc=khlebnikov@yandex-team.ru \
--cc=kpreempt-tech@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rml@tech9.net \
--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