From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-arch@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org,
Alexander Graf <agraf@suse.de>, Paul Mackerras <paulus@samba.org>,
David Vrabel <david.vrabel@citrix.com>,
xen-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 3/3] sched/preempt: fix cond_resched_lock() and cond_resched_softirq()
Date: Wed, 15 Jul 2015 12:52:34 +0000 [thread overview]
Message-ID: <55A65792.80903@yandex-team.ru> (raw)
In-Reply-To: <1436962596.1026.10.camel@edumazet-glaptop2.roam.corp.google.com>
On 15.07.2015 15:16, Eric Dumazet wrote:
> On Wed, 2015-07-15 at 12:52 +0300, Konstantin Khlebnikov wrote:
>> These functions check should_resched() before unlocking spinlock/bh-enable:
>> preempt_count always non-zero => should_resched() always returns false.
>> cond_resched_lock() worked iff spin_needbreak is set.
>
> Interesting, this definitely used to work (linux-3.11)
>
> Any idea of which commit broke things ?
>
Searching... done
This one: bdb43806589096ac4272fe1307e789846ac08d7c in v3.13
before
-static inline int should_resched(void)
-{
- return need_resched() && !(preempt_count() & PREEMPT_ACTIVE);
-}
after
+static __always_inline bool should_resched(void)
+{
+ return unlikely(!*preempt_count_ptr());
+}
So,
Fixes: bdb438065890 ("sched: Extract the basic add/sub preempt_count
modifiers")
--
Konstantin
WARNING: multiple messages have this Message-ID (diff)
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-arch@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org,
Alexander Graf <agraf@suse.de>, Paul Mackerras <paulus@samba.org>,
David Vrabel <david.vrabel@citrix.com>,
xen-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 3/3] sched/preempt: fix cond_resched_lock() and cond_resched_softirq()
Date: Wed, 15 Jul 2015 15:52:34 +0300 [thread overview]
Message-ID: <55A65792.80903@yandex-team.ru> (raw)
In-Reply-To: <1436962596.1026.10.camel@edumazet-glaptop2.roam.corp.google.com>
On 15.07.2015 15:16, Eric Dumazet wrote:
> On Wed, 2015-07-15 at 12:52 +0300, Konstantin Khlebnikov wrote:
>> These functions check should_resched() before unlocking spinlock/bh-enable:
>> preempt_count always non-zero => should_resched() always returns false.
>> cond_resched_lock() worked iff spin_needbreak is set.
>
> Interesting, this definitely used to work (linux-3.11)
>
> Any idea of which commit broke things ?
>
Searching... done
This one: bdb43806589096ac4272fe1307e789846ac08d7c in v3.13
before
-static inline int should_resched(void)
-{
- return need_resched() && !(preempt_count() & PREEMPT_ACTIVE);
-}
after
+static __always_inline bool should_resched(void)
+{
+ return unlikely(!*preempt_count_ptr());
+}
So,
Fixes: bdb438065890 ("sched: Extract the basic add/sub preempt_count
modifiers")
--
Konstantin
next prev parent reply other threads:[~2015-07-15 12:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 9:52 [PATCH v2 1/3] drivers/xen/preempt: use need_resched() instead of should_resched() Konstantin Khlebnikov
2015-07-15 9:52 ` Konstantin Khlebnikov
2015-07-15 9:52 ` [PATCH v2 2/3] KVM: PPC: Book3S HV: Use " Konstantin Khlebnikov
2015-07-15 9:52 ` Konstantin Khlebnikov
2015-08-03 17:08 ` [tip:sched/core] sched/preempt, powerpc, kvm: " tip-bot for Konstantin Khlebnikov
2015-07-15 9:52 ` [PATCH v2 2/3] KVM: PPC: Book3S HV: " Konstantin Khlebnikov
2015-07-15 9:52 ` [PATCH v2 3/3] sched/preempt: fix cond_resched_lock() and cond_resched_softirq() Konstantin Khlebnikov
2015-07-15 9:52 ` Konstantin Khlebnikov
2015-07-15 9:52 ` Konstantin Khlebnikov
2015-07-15 12:16 ` Eric Dumazet
2015-07-15 12:16 ` Eric Dumazet
2015-07-15 12:16 ` Eric Dumazet
2015-07-15 12:52 ` Konstantin Khlebnikov [this message]
2015-07-15 12:52 ` Konstantin Khlebnikov
2015-07-15 13:35 ` Peter Zijlstra
2015-07-15 13:35 ` Peter Zijlstra
2015-07-15 13:35 ` Peter Zijlstra
2015-07-15 12:52 ` Konstantin Khlebnikov
2015-08-03 17:08 ` [tip:sched/core] sched/preempt: Fix " tip-bot for Konstantin Khlebnikov
2015-07-20 13:41 ` [Xen-devel] [PATCH v2 1/3] drivers/xen/preempt: use need_resched() instead of should_resched() David Vrabel
2015-07-20 13:41 ` David Vrabel
2015-07-20 13:41 ` David Vrabel
2015-07-20 13:41 ` David Vrabel
2015-08-03 17:07 ` [tip:sched/core] sched/preempt, xen: Use " tip-bot for Konstantin Khlebnikov
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=55A65792.80903@yandex-team.ru \
--to=khlebnikov@yandex-team.ru \
--cc=agraf@suse.de \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=eric.dumazet@gmail.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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 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.