LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH RT] sched: let softirq_count() return !0 if inside local_bh_disable()ed section
@ 2018-05-17 10:22 Sebastian Andrzej Siewior
2018-05-22 15:53 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-05-17 10:22 UTC (permalink / raw)
To: linux-rt-users; +Cc: linux-kernel, tglx, Steven Rostedt
I don't see a reason why softirq_count() shouldn't reflect the fact that
we are within a local_bh_disable() section. I *think* it was done
primary because in RT the softirq is slightly different (and
preemptible) and it broke some of RCU's assumptions.
I don't see any fallout with this change. Furthermore, all checks like
"WARN_ON(!softirq_count())" will work and we can drop the workaround we
currently have in the queue.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/preempt.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 0591df500e9d..d8c05a2626ca 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -91,7 +91,7 @@
# define softirq_count() (preempt_count() & SOFTIRQ_MASK)
# define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
#else
-# define softirq_count() (0UL)
+# define softirq_count() (current->softirq_nestcnt)
extern int in_serving_softirq(void);
#endif
--
2.17.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RT] sched: let softirq_count() return !0 if inside local_bh_disable()ed section
2018-05-17 10:22 [PATCH RT] sched: let softirq_count() return !0 if inside local_bh_disable()ed section Sebastian Andrzej Siewior
@ 2018-05-22 15:53 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2018-05-22 15:53 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: linux-rt-users, linux-kernel, tglx
On Thu, 17 May 2018 12:22:14 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> I don't see a reason why softirq_count() shouldn't reflect the fact that
> we are within a local_bh_disable() section. I *think* it was done
> primary because in RT the softirq is slightly different (and
> preemptible) and it broke some of RCU's assumptions.
> I don't see any fallout with this change. Furthermore, all checks like
> "WARN_ON(!softirq_count())" will work and we can drop the workaround we
> currently have in the queue.
Looks to keep the paradigm closer to vanilla Linux to me.
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-- Steve
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> include/linux/preempt.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/preempt.h b/include/linux/preempt.h
> index 0591df500e9d..d8c05a2626ca 100644
> --- a/include/linux/preempt.h
> +++ b/include/linux/preempt.h
> @@ -91,7 +91,7 @@
> # define softirq_count() (preempt_count() & SOFTIRQ_MASK)
> # define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
> #else
> -# define softirq_count() (0UL)
> +# define softirq_count() (current->softirq_nestcnt)
> extern int in_serving_softirq(void);
> #endif
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-22 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 10:22 [PATCH RT] sched: let softirq_count() return !0 if inside local_bh_disable()ed section Sebastian Andrzej Siewior
2018-05-22 15:53 ` Steven Rostedt
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).