powerpc/hugetlb: Don't do runtime allocation of 16G pages in LPAR configuration
[linux-2.6-block.git] / include / linux / jump_label_ratelimit.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
851cf6e7
AJ
2#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
3#define _LINUX_JUMP_LABEL_RATELIMIT_H
4
5#include <linux/jump_label.h>
6#include <linux/workqueue.h>
7
e9666d10 8#if defined(CONFIG_JUMP_LABEL)
851cf6e7
AJ
9struct static_key_deferred {
10 struct static_key key;
11 unsigned long timeout;
12 struct delayed_work work;
13};
851cf6e7 14
851cf6e7 15extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
b6416e61 16extern void static_key_deferred_flush(struct static_key_deferred *key);
851cf6e7
AJ
17extern void
18jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
19
e9666d10 20#else /* !CONFIG_JUMP_LABEL */
851cf6e7
AJ
21struct static_key_deferred {
22 struct static_key key;
23};
24static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
25{
5cdda511 26 STATIC_KEY_CHECK_USE(key);
851cf6e7
AJ
27 static_key_slow_dec(&key->key);
28}
b6416e61
DM
29static inline void static_key_deferred_flush(struct static_key_deferred *key)
30{
5cdda511 31 STATIC_KEY_CHECK_USE(key);
b6416e61 32}
851cf6e7
AJ
33static inline void
34jump_label_rate_limit(struct static_key_deferred *key,
35 unsigned long rl)
36{
5cdda511 37 STATIC_KEY_CHECK_USE(key);
851cf6e7 38}
e9666d10 39#endif /* CONFIG_JUMP_LABEL */
851cf6e7 40#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */