aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-10-09 17:30:52 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-09 23:26:23 -0400
commitcf4c950b87ee2f547ad3abd3aca6ae3f3eb3443f (patch)
treeec62d0b29fcd7361e4abb8cdc95042597571cf2c /lib
parentd93fa2ba64384a0bbee4ae7409d85fccb2cfcf14 (diff)
once: switch to new jump label API
Switch the DO_ONCE() macro from the deprecated jump label API to the new one. The new one is more readable, and for DO_ONCE() it also makes the generated code more icache-friendly: now the one-time initialization code is placed out-of-line at the jump target, rather than at the inline fallthrough case. Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/once.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/once.c b/lib/once.c
index 05c8604627eb..831c5a6b0bb2 100644
--- a/lib/once.c
+++ b/lib/once.c
@@ -5,7 +5,7 @@
5 5
6struct once_work { 6struct once_work {
7 struct work_struct work; 7 struct work_struct work;
8 struct static_key *key; 8 struct static_key_true *key;
9}; 9};
10 10
11static void once_deferred(struct work_struct *w) 11static void once_deferred(struct work_struct *w)
@@ -14,11 +14,11 @@ static void once_deferred(struct work_struct *w)
14 14
15 work = container_of(w, struct once_work, work); 15 work = container_of(w, struct once_work, work);
16 BUG_ON(!static_key_enabled(work->key)); 16 BUG_ON(!static_key_enabled(work->key));
17 static_key_slow_dec(work->key); 17 static_branch_disable(work->key);
18 kfree(work); 18 kfree(work);
19} 19}
20 20
21static void once_disable_jump(struct static_key *key) 21static void once_disable_jump(struct static_key_true *key)
22{ 22{
23 struct once_work *w; 23 struct once_work *w;
24 24
@@ -51,7 +51,7 @@ bool __do_once_start(bool *done, unsigned long *flags)
51} 51}
52EXPORT_SYMBOL(__do_once_start); 52EXPORT_SYMBOL(__do_once_start);
53 53
54void __do_once_done(bool *done, struct static_key *once_key, 54void __do_once_done(bool *done, struct static_key_true *once_key,
55 unsigned long *flags) 55 unsigned long *flags)
56 __releases(once_lock) 56 __releases(once_lock)
57{ 57{