public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] static keys: fix test/set races
@ 2013-06-28 22:30 jbaron
  2013-06-28 22:30 ` [PATCH 1/3] static_keys: Add a static_key_slow_set_true()/false() interface jbaron
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: jbaron @ 2013-06-28 22:30 UTC (permalink / raw)
  To: rostedt, andi; +Cc: linux-kernel, mingo, peterz

Hi,

As pointed out by Andi Kleen, some static key users can be racy because they
check the value of the key->enabled, and then subsequently update the branch
direction. A number of call sites have 'higher' level locking that avoids this
race, but the usage in the scheduler features does not. See:
http://lkml.indiana.edu/hypermail/linux/kernel/1304.2/01655.html

Thus, introduce a new API that does the check and set under the
'jump_label_mutex'. This should also allow to simplify call sites a bit.

Users of static keys should use either the inc/dec or the set_true/set_false
API.

Thanks,

-Jason


Jason Baron (3):
  static_keys: Add a static_key_slow_set_true()/false() interface
  sched: fix static keys race in sched_feat
  udp: make use of static_key_slow_set_true() interface

 Documentation/static-keys.txt |    8 ++++++++
 include/linux/jump_label.h    |   30 ++++++++++++++++++++++++++++++
 kernel/jump_label.c           |   40 ++++++++++++++++++++++++++++++++++++++++
 kernel/sched/core.c           |   12 +++++-------
 kernel/sched/sched.h          |   10 +++++-----
 net/ipv4/udp.c                |    9 ++++-----
 net/ipv6/udp.c                |    9 ++++-----
 7 files changed, 96 insertions(+), 22 deletions(-)

-- 
1.7.9.5


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

end of thread, other threads:[~2014-06-30 22:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28 22:30 [PATCH 0/3] static keys: fix test/set races jbaron
2013-06-28 22:30 ` [PATCH 1/3] static_keys: Add a static_key_slow_set_true()/false() interface jbaron
2013-06-29  3:00   ` Steven Rostedt
2013-06-28 22:30 ` [PATCH 2/3] sched: fix static keys race in sched_feat jbaron
2013-06-29  3:03   ` Steven Rostedt
2013-06-28 22:30 ` [PATCH 3/3] udp: make use of static_key_slow_set_true() interface jbaron
2013-06-29  3:13   ` Steven Rostedt
2013-07-01  4:20     ` Jason Baron
2013-07-01 14:28       ` Steven Rostedt
2013-06-29  7:20 ` [PATCH 0/3] static keys: fix test/set races Ingo Molnar
2013-07-01  4:12   ` Jason Baron
2013-07-02  8:03     ` Peter Zijlstra
2013-07-02  9:38       ` Ingo Molnar
2014-06-24  2:28 ` Steven Rostedt
2014-06-24  2:41   ` Jason Baron
2014-06-30 21:43   ` Jason Baron
2014-06-30 22:36     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox