Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755943Ab2BVLzc (ORCPT ); Wed, 22 Feb 2012 06:55:32 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:34029 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754795Ab2BVLz1 (ORCPT ); Wed, 22 Feb 2012 06:55:27 -0500 Message-ID: <4F44D798.3070607@linux.vnet.ibm.com> Date: Wed, 22 Feb 2012 17:25:04 +0530 From: Raghavendra K T User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: Andrew Jones , Peter Zijlstra , Jason Baron , Avi Kivity , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Xiao Guangrong CC: Jeremy Fitzhardinge , Tejun Heo , John Stultz , LKML , Thomas Gleixner , Srivatsa Vaddagiri , Peter Zijlstra , David Howells , Gleb Natapov , Raghavendra Subject: Re: [PATCH 1/1] linux headers: header file(s) changes to enable spinlock use jumplabel References: <4F428814.1060801@linux.vnet.ibm.com> <20120221152349.GA7274@turtle.usersys.redhat.com> In-Reply-To: <20120221152349.GA7274@turtle.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit x-cbid: 12022201-5140-0000-0000-000000C98C6C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6474 Lines: 191 On 02/21/2012 08:53 PM, Andrew Jones wrote: [Including people in perf_event and jumplabel also] > On Mon, Feb 20, 2012 at 11:21:16PM +0530, Raghavendra K T wrote: > > Below is the patch I wrote when I first proposed the idea to > Gleb. This patch isn't exactly what I stated above, because > it's splitting original and ratelimit, rather than minimal and > extended. Maybe this is sufficient for now? Or maybe we don't > want to split at all? > IMHO, This patch is sufficient and makes lot more sense than my patches. I verified and compile tested this with rebased patches of Jeremy (yesconfig). Can add Reviewed-By: Raghavendra K T Peter, Jason, Ingo, please let's know if you have any objection with below patch.. > Drew > > --- > > From: Andrew Jones > Date: Thu, 26 Jan 2012 13:59:30 +0100 > Subject: [PATCH] split out rate limiting from jump_label.h > > Commit b202952075f62603bea9bfb6ebc6b0420db11949 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 was done in Jeremy's 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 > --- > include/linux/jump_label.h | 24 ------------------------ > include/linux/jump_label_ratelimit.h | 32 ++++++++++++++++++++++++++++++++ > include/linux/perf_event.h | 2 +- > kernel/jump_label.c | 2 +- > 4 files changed, 34 insertions(+), 26 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 5ce8b14..b15954a 100644 > --- a/include/linux/jump_label.h > +++ b/include/linux/jump_label.h > @@ -3,7 +3,6 @@ > > #include > #include > -#include > > #if defined(CC_HAVE_ASM_GOTO)&& defined(CONFIG_JUMP_LABEL) > > @@ -15,12 +14,6 @@ struct jump_label_key { > #endif > }; > > -struct jump_label_key_deferred { > - struct jump_label_key key; > - unsigned long timeout; > - struct delayed_work work; > -}; > - > # include > # define HAVE_JUMP_LABEL > #endif /* CC_HAVE_ASM_GOTO&& CONFIG_JUMP_LABEL */ > @@ -58,11 +51,8 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry, > extern int jump_label_text_reserved(void *start, void *end); > extern void jump_label_inc(struct jump_label_key *key); > extern void jump_label_dec(struct jump_label_key *key); > -extern void jump_label_dec_deferred(struct jump_label_key_deferred *key); > extern bool jump_label_enabled(struct jump_label_key *key); > extern void jump_label_apply_nops(struct module *mod); > -extern void jump_label_rate_limit(struct jump_label_key_deferred *key, > - unsigned long rl); > > #else /* !HAVE_JUMP_LABEL */ > > @@ -78,10 +68,6 @@ static __always_inline void jump_label_init(void) > { > } > > -struct jump_label_key_deferred { > - struct jump_label_key key; > -}; > - > static __always_inline bool static_branch(struct jump_label_key *key) > { > if (unlikely(atomic_read(&key->enabled))) > @@ -99,11 +85,6 @@ static inline void jump_label_dec(struct jump_label_key *key) > atomic_dec(&key->enabled); > } > > -static inline void jump_label_dec_deferred(struct jump_label_key_deferred *key) > -{ > - jump_label_dec(&key->key); > -} > - > static inline int jump_label_text_reserved(void *start, void *end) > { > return 0; > @@ -121,11 +102,6 @@ static inline int jump_label_apply_nops(struct module *mod) > { > return 0; > } > - > -static inline void jump_label_rate_limit(struct jump_label_key_deferred *key, > - unsigned long rl) > -{ > -} > #endif /* HAVE_JUMP_LABEL */ > > #define jump_label_key_enabled ((struct jump_label_key){ .enabled = ATOMIC_INIT(1), }) > diff --git a/include/linux/jump_label_ratelimit.h b/include/linux/jump_label_ratelimit.h > new file mode 100644 > index 0000000..2cf61b9 > --- /dev/null > +++ b/include/linux/jump_label_ratelimit.h > @@ -0,0 +1,32 @@ > +#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H > +#define _LINUX_JUMP_LABEL_RATELIMIT_H > + > +#include > +#include > + > +#if defined(CC_HAVE_ASM_GOTO)&& defined(CONFIG_JUMP_LABEL) > +struct jump_label_key_deferred { > + struct jump_label_key key; > + unsigned long timeout; > + struct delayed_work work; > +}; > +#endif > + > +#ifdef HAVE_JUMP_LABEL > +extern void jump_label_dec_deferred(struct jump_label_key_deferred *key); > +extern void jump_label_rate_limit(struct jump_label_key_deferred *key, > + unsigned long rl); > +#else > +struct jump_label_key_deferred { > + struct jump_label_key key; > +}; > +static inline void jump_label_dec_deferred(struct jump_label_key_deferred *key) > +{ > + jump_label_dec(&key->key); > +} > +static inline void jump_label_rate_limit(struct jump_label_key_deferred *key, > + unsigned long rl) > +{ > +} > +#endif > +#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */ > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 0885561..7ae33d9 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -512,7 +512,7 @@ struct perf_guest_info_callbacks { > #include > #include > #include > -#include > +#include > #include > #include > > diff --git a/kernel/jump_label.c b/kernel/jump_label.c > index 01d3b70..f736308 100644 > --- a/kernel/jump_label.c > +++ b/kernel/jump_label.c > @@ -12,7 +12,7 @@ > #include > #include > #include > -#include > +#include > > #ifdef HAVE_JUMP_LABEL > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/