mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 14:14:01 +08:00
851cf6e7d6
Commit b202952075
("perf, core: Rate limit
perf_sched_events jump_label patching") introduced rate limiting
for jump label disabling. The changes were made in the jump label code
in order to be more widely available and to keep things tidier. This is
all fine, except now jump_label.h includes linux/workqueue.h, which
makes it impossible to include jump_label.h from anything that
workqueue.h needs. For example, it's now impossible to include
jump_label.h from asm/spinlock.h, which is done in proposed
pv-ticketlock patches. This patch splits out the rate limiting related
changes from jump_label.h into a new file, jump_label_ratelimit.h, to
resolve the issue.
Signed-off-by: Andrew Jones <drjones@redhat.com>
Link: http://lkml.kernel.org/r/1376058122-8248-10-git-send-email-raghavendra.kt@linux.vnet.ibm.com
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
35 lines
871 B
C
35 lines
871 B
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
|
|
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_slow_dec(&key->key);
|
|
}
|
|
static inline void
|
|
jump_label_rate_limit(struct static_key_deferred *key,
|
|
unsigned long rl)
|
|
{
|
|
}
|
|
#endif /* HAVE_JUMP_LABEL */
|
|
#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
|