All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v4 0/8] mac80211: jump labels for HW flags
@ 2015-11-12  8:47 Johannes Berg
  2015-11-12  8:47 ` [RFC v4 1/8] mac80211: add ieee80211_hw_clear() Johannes Berg
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Johannes Berg @ 2015-11-12  8:47 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jason Baron, Peter Zijlstra, Steven Rostedt, Michal Marek

Changes since v3:
 * fix Kconfig count to count only enabled (!= n) symbols
 * fix code when CONFIG_JUMP_LABEL is not enabled

Changes since v2:
 * introduce Kconfig count and use it instead of _ON/_OFF in
   the first few patches and described below
   (I'll squash that later if I don't abandon the whole thing)

Changes since v1:
 * use struct static_key_false
 * get rid of all those generated macros and use the optimiser

-----

This was an experiment I thought of on Sunday ...

As also explained in the log for patch 3, we have a lot of behaviour
differences in mac80211 based on which driver we're working against.
In many cases (say OpenWRT router, or a phone/tablet, ChromeBook, etc.)
we only have a single driver built into the system though. In that
case we could - theoretically - elide all the code that isn't required
by that driver, but that seems too dangerous.

Instead, use static keys to set a default for each of the flags. If
the flag is selected as _OFF in Kconfig, then any code that needs it
to be on will be placed out of line and the jump NOPed out; if then
a driver registers that actually needs the code the jump will be put
back and the first thing in the out-of-line section will be to check
the real hw flags.

This pretty much results in the same thing as removing the code/if,
but with more safety.

I haven't done any measurements whatsoever, but I think it might be
something to test on a little MIPS router box.


As far as the code is concerned, there are two really ugly things:
 1) I still use struct static_key - couldn't quite figure it out
    with static_key_false. I think I can replace it easily though.
 2) There are a lot of boilerplate ifdefs/macros.

I can't see a way to avoid more of (2), although I think that we
can probably remove it for a lot of flags and just not have this
ability for those that aren't used in RX/TX/status paths. That'd
probably reduce the code quite a bit.

If anyone has an easy setup to test it on a low-power platform that
would be great.

johannes



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-11-13 16:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12  8:47 [RFC v4 0/8] mac80211: jump labels for HW flags Johannes Berg
2015-11-12  8:47 ` [RFC v4 1/8] mac80211: add ieee80211_hw_clear() Johannes Berg
2015-11-12  8:47 ` [RFC v4 2/8] mac80211: introduce ieee80211_local_check() Johannes Berg
2015-11-12  8:47 ` [RFC v4 3/8] mac80211: use static keys for hw flags Johannes Berg
2015-11-13 16:22   ` Steven Rostedt
2015-11-13 16:30     ` Johannes Berg
2015-11-12  8:47 ` [RFC v4 4/8] mac80211: test the static key code Johannes Berg
2015-11-12  8:47 ` [RFC v4 5/8] mac80211: generate hw flags from include file Johannes Berg
2015-11-13 16:25   ` Steven Rostedt
2015-11-13 16:31     ` Johannes Berg
2015-11-12  8:47 ` [RFC v4 6/8] kconfig: introduce "count" Johannes Berg
2015-11-13 16:26   ` Steven Rostedt
2015-11-13 16:32     ` Johannes Berg
2015-11-12  8:47 ` [RFC v4 7/8] kconfig: regenerate the shipped files Johannes Berg
2015-11-12  8:47 ` [RFC v4 8/8] mac80211: use Kconfig counters to determine feature optimisation Johannes Berg
2015-11-13 16:29   ` Steven Rostedt
2015-11-13 16:35     ` Johannes Berg
2015-11-13 16:49       ` Steven Rostedt

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.