From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: jeremy@goop.org, gregkh@suse.de, kvm@vger.kernel.org,
linux-doc@vger.kernel.org, peterz@infradead.org,
drjones@redhat.com, virtualization@lists.linux-foundation.org,
andi@firstfloor.org, hpa@zytor.com,
xen-devel@lists.xensource.com, x86@kernel.org, mingo@redhat.com,
habanero@linux.vnet.ibm.com, riel@redhat.com,
stefano.stabellini@eu.citrix.com, ouyang@cs.pitt.edu,
avi.kivity@gmail.com, tglx@linutronix.de, chegu_vinod@hp.com,
linux-kernel@vger.kernel.org, srivatsa.vaddagiri@gmail.com,
attilio.rao@citrix.com, pbonzini@redhat.com,
torvalds@linux-foundation.org, stephan.diestelhorst@amd.com
Subject: Re: [PATCH RFC V9 9/19] Split out rate limiting from jump_label.h
Date: Mon, 3 Jun 2013 11:56:12 -0400 [thread overview]
Message-ID: <20130603155612.GD4224@phenom.dumpdata.com> (raw)
In-Reply-To: <20130601192422.5966.44354.sendpatchset@codeblue>
On Sun, Jun 02, 2013 at 12:54:22AM +0530, Raghavendra K T wrote:
> Split jumplabel ratelimit
I would change the title a bit, perhaps prefix it with: "jump_label: "
>
> From: Andrew Jones <drjones@redhat.com>
>
> Commit b202952075f62603bea9bfb6ebc6b0420db11949 introduced rate limiting
Also please add right after the git id this:
("perf, core: Rate limit perf_sched_events jump_label patching")
> 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>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Otherwise looks fine to me:
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> include/linux/jump_label.h | 26 +-------------------------
> include/linux/jump_label_ratelimit.h | 34 ++++++++++++++++++++++++++++++++++
> include/linux/perf_event.h | 1 +
> kernel/jump_label.c | 1 +
> 4 files changed, 37 insertions(+), 25 deletions(-)
> create mode 100644 include/linux/jump_label_ratelimit.h
>
> diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
> index 0976fc4..53cdf89 100644
> --- a/include/linux/jump_label.h
> +++ b/include/linux/jump_label.h
> @@ -48,7 +48,6 @@
>
> #include <linux/types.h>
> #include <linux/compiler.h>
> -#include <linux/workqueue.h>
>
> #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
>
> @@ -61,12 +60,6 @@ struct static_key {
> #endif
> };
>
> -struct static_key_deferred {
> - struct static_key key;
> - unsigned long timeout;
> - struct delayed_work work;
> -};
> -
> # include <asm/jump_label.h>
> # define HAVE_JUMP_LABEL
> #endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
> @@ -119,10 +112,7 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry,
> extern int jump_label_text_reserved(void *start, void *end);
> extern void static_key_slow_inc(struct static_key *key);
> extern void static_key_slow_dec(struct static_key *key);
> -extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
> extern void jump_label_apply_nops(struct module *mod);
> -extern void
> -jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
>
> #define STATIC_KEY_INIT_TRUE ((struct static_key) \
> { .enabled = ATOMIC_INIT(1), .entries = (void *)1 })
> @@ -141,10 +131,6 @@ static __always_inline void jump_label_init(void)
> {
> }
>
> -struct static_key_deferred {
> - struct static_key key;
> -};
> -
> static __always_inline bool static_key_false(struct static_key *key)
> {
> if (unlikely(atomic_read(&key->enabled)) > 0)
> @@ -169,11 +155,6 @@ static inline void static_key_slow_dec(struct static_key *key)
> atomic_dec(&key->enabled);
> }
>
> -static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
> -{
> - static_key_slow_dec(&key->key);
> -}
> -
> static inline int jump_label_text_reserved(void *start, void *end)
> {
> return 0;
> @@ -187,12 +168,6 @@ static inline int jump_label_apply_nops(struct module *mod)
> return 0;
> }
>
> -static inline void
> -jump_label_rate_limit(struct static_key_deferred *key,
> - unsigned long rl)
> -{
> -}
> -
> #define STATIC_KEY_INIT_TRUE ((struct static_key) \
> { .enabled = ATOMIC_INIT(1) })
> #define STATIC_KEY_INIT_FALSE ((struct static_key) \
> @@ -203,6 +178,7 @@ jump_label_rate_limit(struct static_key_deferred *key,
> #define STATIC_KEY_INIT STATIC_KEY_INIT_FALSE
> #define jump_label_enabled static_key_enabled
>
> +static inline int atomic_read(const atomic_t *v);
> static inline bool static_key_enabled(struct static_key *key)
> {
> return (atomic_read(&key->enabled) > 0);
> diff --git a/include/linux/jump_label_ratelimit.h b/include/linux/jump_label_ratelimit.h
> new file mode 100644
> index 0000000..1137883
> --- /dev/null
> +++ b/include/linux/jump_label_ratelimit.h
> @@ -0,0 +1,34 @@
> +#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 */
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index f463a46..a8eac60 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -48,6 +48,7 @@ struct perf_guest_info_callbacks {
> #include <linux/cpu.h>
> #include <linux/irq_work.h>
> #include <linux/static_key.h>
> +#include <linux/jump_label_ratelimit.h>
> #include <linux/atomic.h>
> #include <linux/sysfs.h>
> #include <linux/perf_regs.h>
> diff --git a/kernel/jump_label.c b/kernel/jump_label.c
> index 60f48fa..297a924 100644
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -13,6 +13,7 @@
> #include <linux/sort.h>
> #include <linux/err.h>
> #include <linux/static_key.h>
> +#include <linux/jump_label_ratelimit.h>
>
> #ifdef HAVE_JUMP_LABEL
>
>
next prev parent reply other threads:[~2013-06-03 15:56 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-01 19:21 [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks Raghavendra K T
2013-06-01 19:21 ` [PATCH RFC V9 1/19] x86/spinlock: Replace pv spinlocks with pv ticketlocks Raghavendra K T
2013-06-01 20:32 ` Jeremy Fitzhardinge
2013-06-02 6:54 ` Raghavendra K T
2013-06-01 19:22 ` [PATCH RFC V9 2/19] x86/ticketlock: Don't inline _spin_unlock when using paravirt spinlocks Raghavendra K T
2013-06-03 15:28 ` Konrad Rzeszutek Wilk
2013-06-01 19:22 ` [PATCH RFC V9 3/19] x86/ticketlock: Collapse a layer of functions Raghavendra K T
2013-06-03 15:28 ` Konrad Rzeszutek Wilk
2013-06-01 19:22 ` [PATCH RFC V9 4/19] xen: Defer spinlock setup until boot CPU setup Raghavendra K T
2013-06-01 19:23 ` [PATCH RFC V9 5/19] xen/pvticketlock: Xen implementation for PV ticket locks Raghavendra K T
2013-06-03 16:03 ` Konrad Rzeszutek Wilk
2013-06-04 7:21 ` Raghavendra K T
2013-06-01 19:23 ` [PATCH RFC V9 6/19] xen/pvticketlocks: Add xen_nopvspin parameter to disable xen pv ticketlocks Raghavendra K T
2013-06-01 19:23 ` [PATCH RFC V9 7/19] x86/pvticketlock: Use callee-save for lock_spinning Raghavendra K T
2013-06-01 19:24 ` [PATCH RFC V9 8/19] x86/pvticketlock: When paravirtualizing ticket locks, increment by 2 Raghavendra K T
2013-06-03 15:53 ` Konrad Rzeszutek Wilk
2013-06-01 19:24 ` [PATCH RFC V9 9/19] Split out rate limiting from jump_label.h Raghavendra K T
2013-06-03 15:56 ` Konrad Rzeszutek Wilk [this message]
2013-06-04 7:15 ` Raghavendra K T
2013-06-01 19:24 ` [PATCH RFC V9 10/19] x86/ticketlock: Add slowpath logic Raghavendra K T
2013-06-01 19:24 ` [PATCH RFC V9 11/19] xen/pvticketlock: Allow interrupts to be enabled while blocking Raghavendra K T
2013-06-01 19:25 ` [PATCH RFC V9 12/19] xen: Enable PV ticketlocks on HVM Xen Raghavendra K T
2013-06-03 15:57 ` Konrad Rzeszutek Wilk
2013-06-04 7:16 ` Raghavendra K T
2013-06-04 14:44 ` Konrad Rzeszutek Wilk
2013-06-04 15:00 ` Raghavendra K T
2013-06-01 19:25 ` [PATCH RFC V9 13/19] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks Raghavendra K T
2013-06-01 19:25 ` [PATCH RFC V9 14/19] kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration Raghavendra K T
2013-06-01 19:25 ` [PATCH RFC V9 15/19] kvm guest : Add configuration support to enable debug information for KVM Guests Raghavendra K T
2013-06-01 19:25 ` [PATCH RFC V9 16/19] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor Raghavendra K T
2013-06-03 16:00 ` Konrad Rzeszutek Wilk
2013-06-04 7:19 ` Raghavendra K T
2013-06-01 19:26 ` [PATCH RFC V9 17/19] kvm hypervisor : Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic Raghavendra K T
2013-06-01 19:26 ` [PATCH RFC V9 18/19] Documentation/kvm : Add documentation on Hypercalls and features used for PV spinlock Raghavendra K T
2013-06-03 16:04 ` Konrad Rzeszutek Wilk
2013-06-04 7:22 ` Raghavendra K T
2013-06-01 19:26 ` [PATCH RFC V9 19/19] kvm hypervisor: Add directed yield in vcpu block path Raghavendra K T
2013-06-03 16:05 ` Konrad Rzeszutek Wilk
2013-06-04 7:28 ` Raghavendra K T
2013-06-02 8:07 ` [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks Gleb Natapov
2013-06-02 16:20 ` Jiannan Ouyang
2013-06-03 1:40 ` Raghavendra K T
2013-06-03 6:21 ` Raghavendra K T
2013-06-07 6:15 ` Raghavendra K T
2013-06-07 13:29 ` Andrew Theurer
2013-06-07 23:41 ` Jiannan Ouyang
2013-06-25 14:50 ` Andrew Theurer
2013-06-26 8:45 ` Raghavendra K T
2013-06-26 11:37 ` Andrew Jones
2013-06-26 12:52 ` Gleb Natapov
2013-06-26 13:40 ` Raghavendra K T
2013-06-26 14:39 ` Chegu Vinod
2013-06-26 15:37 ` Raghavendra K T
2013-06-26 16:11 ` Gleb Natapov
2013-06-26 17:54 ` Raghavendra K T
2013-07-09 9:11 ` Raghavendra K T
2013-07-10 10:33 ` Gleb Natapov
2013-07-10 10:40 ` Peter Zijlstra
2013-07-10 10:47 ` Gleb Natapov
2013-07-10 11:28 ` Raghavendra K T
2013-07-10 11:29 ` Gleb Natapov
2013-07-10 11:40 ` Raghavendra K T
2013-07-10 15:03 ` Konrad Rzeszutek Wilk
2013-07-10 15:16 ` Gleb Natapov
2013-07-11 0:12 ` Konrad Rzeszutek Wilk
2013-07-10 11:24 ` Raghavendra K T
2013-07-10 11:41 ` Gleb Natapov
2013-07-10 11:50 ` Raghavendra K T
2013-07-11 9:13 ` Raghavendra K T
2013-07-11 9:48 ` Gleb Natapov
2013-07-11 10:10 ` Raghavendra K T
2013-07-11 10:11 ` Gleb Natapov
2013-07-11 10:53 ` Raghavendra K T
2013-07-11 10:56 ` Gleb Natapov
2013-07-11 11:14 ` Raghavendra K T
2013-06-26 14:13 ` Konrad Rzeszutek Wilk
2013-06-26 15:56 ` Andrew Theurer
2013-07-01 9:30 ` Raghavendra K T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130603155612.GD4224@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=andi@firstfloor.org \
--cc=attilio.rao@citrix.com \
--cc=avi.kivity@gmail.com \
--cc=chegu_vinod@hp.com \
--cc=drjones@redhat.com \
--cc=gregkh@suse.de \
--cc=habanero@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ouyang@cs.pitt.edu \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=raghavendra.kt@linux.vnet.ibm.com \
--cc=riel@redhat.com \
--cc=srivatsa.vaddagiri@gmail.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=stephan.diestelhorst@amd.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).