mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-14 12:06:47 +07:00
b6416e6101
Modules that use static_key_deferred need a way to synchronize with any delayed work that is still pending when the module is unloaded. Introduce static_key_deferred_flush() which flushes any pending jump label updates. Signed-off-by: David Matlack <dmatlack@google.com> Cc: stable@vger.kernel.org Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
|
|
#define _LINUX_JUMP_LABEL_RATELIMIT_H
|
|
|
|
#include <linux/jump_label.h>
|
|
#include <linux/workqueue.h>
|
|
|
|
#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
|
|
struct static_key_deferred {
|
|
struct static_key key;
|
|
unsigned long timeout;
|
|
struct delayed_work work;
|
|
};
|
|
#endif
|
|
|
|
#ifdef HAVE_JUMP_LABEL
|
|
extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
|
|
extern void static_key_deferred_flush(struct static_key_deferred *key);
|
|
extern void
|
|
jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
|
|
|
|
#else /* !HAVE_JUMP_LABEL */
|
|
struct static_key_deferred {
|
|
struct static_key key;
|
|
};
|
|
static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
|
|
{
|
|
STATIC_KEY_CHECK_USE();
|
|
static_key_slow_dec(&key->key);
|
|
}
|
|
static inline void static_key_deferred_flush(struct static_key_deferred *key)
|
|
{
|
|
STATIC_KEY_CHECK_USE();
|
|
}
|
|
static inline void
|
|
jump_label_rate_limit(struct static_key_deferred *key,
|
|
unsigned long rl)
|
|
{
|
|
STATIC_KEY_CHECK_USE();
|
|
}
|
|
#endif /* HAVE_JUMP_LABEL */
|
|
#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
|