[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180504175144.12179-1-bigeasy@linutronix.de>
Date: Fri, 4 May 2018 19:51:42 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Johannes Berg <johannes@...solutions.net>,
Alexander Aring <alex.aring@...il.com>,
Stefan Schmidt <stefan@....samsung.com>,
netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
linux-wpan@...r.kernel.org
Subject: [RFC PATCH 0/2] Introduce assert_in_softirq()
ieee80211_rx_napi() has a check to ensure that it is invoked in softirq
context / with BH disabled. It is there because it invokes
netif_receive_skb() which has this requirement.
On -RT this check does not work as expected so there is always this
warning.
Tree wide there are two users of this check: ieee80211_rx_napi() and
ieee802154_rx(). This approach introduces assert_in_softirq() which does
the check if lockdep is enabled. This check could then become a nop on
-RT.
As an alternative netif_receive_skb() (or ieee80211_rx_napi() could do
local_bh_disable() / local_bh_enable() unconditionally. The _disable()
part is very cheap. The _enable() part is more expensive because it
includes a function call. We could avoid that jump in the likely case
when BH was already disabled by something like:
static inline void local_bh_enable(void)
{
if (softirq_count() == SOFTIRQ_DISABLE_OFFSET)
__local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
else
preempt_count_sub(SOFTIRQ_DISABLE_OFFSET);
}
Which would make bh_enable() cheaper for everyone.
Sebastian
Powered by blists - more mailing lists