* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
[not found] <20110524140212.a4f19769.sfr@canb.auug.org.au>
@ 2011-05-24 18:33 ` Randy Dunlap
2011-05-24 18:49 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2011-05-24 18:33 UTC (permalink / raw)
To: Stephen Rothwell, Joe Perches, netdev; +Cc: linux-next, LKML, davem
On Tue, 24 May 2011 14:02:12 +1000 Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20110523:
when CONFIG_PRINTK is not enabled:
net/core/filter.c:353: warning: type defaults to 'int' in declaration of 'DEFINE_RATELIMIT_STATE'
net/core/filter.c:353: warning: parameter names (without types) in function declaration
net/core/filter.c:353: error: invalid storage class for function 'DEFINE_RATELIMIT_STATE'
net/core/filter.c:353: error: implicit declaration of function '__ratelimit'
net/core/filter.c:353: error: '_rs' undeclared (first use in this function)
Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
In file included from linux-next-20110524/include/linux/thread_info.h:53,
from linux-next-20110524/include/linux/preempt.h:9,
from linux-next-20110524/include/linux/spinlock.h:50,
from linux-next-20110524/include/linux/ratelimit.h:5,
from linux-next-20110524/include/asm-generic/bug.h:5,
from linux-next-20110524/arch/x86/include/asm/bug.h:38,
from linux-next-20110524/include/linux/kernel.h:23,
from linux-next-20110524/arch/x86/include/asm/percpu.h:44,
from linux-next-20110524/arch/x86/include/asm/current.h:5,
from linux-next-20110524/arch/x86/include/asm/processor.h:15,
from linux-next-20110524/arch/x86/include/asm/atomic.h:6,
from linux-next-20110524/include/linux/crypto.h:20,
from linux-next-20110524/arch/x86/kernel/asm-offsets.c:8:
linux-next-20110524/arch/x86/include/asm/thread_info.h:34: error: expected specifier-qualifier-list before 'mm_segment_t'
In file included from linux-next-20110524/include/linux/thread_info.h:53,
from linux-next-20110524/include/linux/preempt.h:9,
from linux-next-20110524/include/linux/spinlock.h:50,
from linux-next-20110524/include/linux/ratelimit.h:5,
from linux-next-20110524/include/asm-generic/bug.h:5,
from linux-next-20110524/arch/x86/include/asm/bug.h:38,
from linux-next-20110524/include/linux/kernel.h:23,
from linux-next-20110524/arch/x86/include/asm/percpu.h:44,
from linux-next-20110524/arch/x86/include/asm/current.h:5,
from linux-next-20110524/arch/x86/include/asm/processor.h:15,
from linux-next-20110524/arch/x86/include/asm/atomic.h:6,
from linux-next-20110524/include/linux/crypto.h:20,
from linux-next-20110524/arch/x86/kernel/asm-offsets.c:8:
linux-next-20110524/arch/x86/include/asm/thread_info.h:217: error: expected declaration specifiers or '...' before 'kernel_stack'
linux-next-20110524/arch/x86/include/asm/thread_info.h:217: warning: data definition has no type or storage class
linux-next-20110524/arch/x86/include/asm/thread_info.h:217: warning: type defaults to 'int' in declaration of 'DECLARE_PER_CPU'
linux-next-20110524/arch/x86/include/asm/thread_info.h: In function 'current_thread_info':
linux-next-20110524/arch/x86/include/asm/thread_info.h:222: error: implicit declaration of function 'percpu_read_stable'
linux-next-20110524/arch/x86/include/asm/thread_info.h:222: error: 'kernel_stack' undeclared (first use in this function)
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 18:33 ` linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled) Randy Dunlap
@ 2011-05-24 18:49 ` Joe Perches
2011-05-24 19:32 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2011-05-24 18:49 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Stephen Rothwell, netdev, linux-next, LKML, davem
On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
> On Tue, 24 May 2011 14:02:12 +1000 Stephen Rothwell wrote:
> > Hi all,
> > Changes since 20110523:
> when CONFIG_PRINTK is not enabled:
> net/core/filter.c:353: warning: type defaults to 'int' in declaration of 'DEFINE_RATELIMIT_STATE'
> net/core/filter.c:353: warning: parameter names (without types) in function declaration
> net/core/filter.c:353: error: invalid storage class for function 'DEFINE_RATELIMIT_STATE'
> net/core/filter.c:353: error: implicit declaration of function '__ratelimit'
> net/core/filter.c:353: error: '_rs' undeclared (first use in this function)
Thanks for the report Randy.
I wonder if it's better to new create sections for
!CONFIG_PRINTK in bug.h. That might make the image
a bit smaller when !CONFIG_PRINTK too.
> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
Yup, that's not a good solution.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 18:49 ` Joe Perches
@ 2011-05-24 19:32 ` David Miller
2011-05-24 19:49 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2011-05-24 19:32 UTC (permalink / raw)
To: joe; +Cc: randy.dunlap, sfr, netdev, linux-next, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Tue, 24 May 2011 11:49:48 -0700
> On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
>> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
>
> Yup, that's not a good solution.
Please come up with a fix or I'll have to revert, thanks Joe.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 19:32 ` David Miller
@ 2011-05-24 19:49 ` Joe Perches
2011-05-24 19:53 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2011-05-24 19:49 UTC (permalink / raw)
To: David Miller; +Cc: randy.dunlap, sfr, netdev, linux-next, linux-kernel
On Tue, 2011-05-24 at 15:32 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Tue, 24 May 2011 11:49:48 -0700
> > On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
> >> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
> > Yup, that's not a good solution.
> Please come up with a fix or I'll have to revert, thanks Joe.
I have some errands to run for awhile.
Probably a revert today and another patch set tomorrow
might be best.
This seems to work and doesn't cause any extra state to be
instantiated when !CONFIG_PRINTK. What do you think?
#ifdef CONFIG_PRINTK
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))
#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = 0; \
if (unlikely(__ratelimit(state))) \
rtn = WARN(condition, format); \
rtn; \
})
#define WARN_RATELIMIT(condition, format...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \
__WARN_RATELIMIT(condition, &_rs, format); \
})
#else
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON(condition)
#define __WARN_RATELIMIT(condition, state, format...) \
({ \
int rtn = WARN(condition, format); \
rtn; \
})
#define WARN_RATELIMIT(condition, format...) \
({ \
int rtn = WARN(condition, format); \
rtn; \
})
#endif
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 19:49 ` Joe Perches
@ 2011-05-24 19:53 ` David Miller
2011-05-24 20:11 ` Randy Dunlap
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2011-05-24 19:53 UTC (permalink / raw)
To: joe; +Cc: randy.dunlap, sfr, netdev, linux-next, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Tue, 24 May 2011 12:49:40 -0700
> On Tue, 2011-05-24 at 15:32 -0400, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> Date: Tue, 24 May 2011 11:49:48 -0700
>> > On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
>> >> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
>> > Yup, that's not a good solution.
>> Please come up with a fix or I'll have to revert, thanks Joe.
>
> I have some errands to run for awhile.
>
> Probably a revert today and another patch set tomorrow
> might be best.
>
> This seems to work and doesn't cause any extra state to be
> instantiated when !CONFIG_PRINTK. What do you think?
Seems fine, here it is as a patch.
Randy please test this, thanks:
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 12b250c..9178484 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -162,6 +162,8 @@ extern void warn_slowpath_null(const char *file, const int line);
unlikely(__ret_warn_once); \
})
+#ifdef CONFIG_PRINTK
+
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))
@@ -181,6 +183,25 @@ extern void warn_slowpath_null(const char *file, const int line);
__WARN_RATELIMIT(condition, &_rs, format); \
})
+#else
+
+#define WARN_ON_RATELIMIT(condition, state) \
+ WARN_ON(condition)
+
+#define __WARN_RATELIMIT(condition, state, format...) \
+({ \
+ int rtn = WARN(condition, format); \
+ rtn; \
+})
+
+#define WARN_RATELIMIT(condition, format...) \
+({ \
+ int rtn = WARN(condition, format); \
+ rtn; \
+})
+
+#endif
+
/*
* WARN_ON_SMP() is for cases that the warning is either
* meaningless for !SMP or may even cause failures.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 19:53 ` David Miller
@ 2011-05-24 20:11 ` Randy Dunlap
2011-05-24 20:14 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2011-05-24 20:11 UTC (permalink / raw)
To: David Miller; +Cc: joe, sfr, netdev, linux-next, linux-kernel
On 05/24/11 12:53, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Tue, 24 May 2011 12:49:40 -0700
>
>> On Tue, 2011-05-24 at 15:32 -0400, David Miller wrote:
>>> From: Joe Perches <joe@perches.com>
>>> Date: Tue, 24 May 2011 11:49:48 -0700
>>>> On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
>>>>> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
>>>> Yup, that's not a good solution.
>>> Please come up with a fix or I'll have to revert, thanks Joe.
>>
>> I have some errands to run for awhile.
>>
>> Probably a revert today and another patch set tomorrow
>> might be best.
>>
>> This seems to work and doesn't cause any extra state to be
>> instantiated when !CONFIG_PRINTK. What do you think?
>
> Seems fine, here it is as a patch.
>
> Randy please test this, thanks:
Works here.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Thanks.
> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> index 12b250c..9178484 100644
> --- a/include/asm-generic/bug.h
> +++ b/include/asm-generic/bug.h
> @@ -162,6 +162,8 @@ extern void warn_slowpath_null(const char *file, const int line);
> unlikely(__ret_warn_once); \
> })
>
> +#ifdef CONFIG_PRINTK
> +
> #define WARN_ON_RATELIMIT(condition, state) \
> WARN_ON((condition) && __ratelimit(state))
>
> @@ -181,6 +183,25 @@ extern void warn_slowpath_null(const char *file, const int line);
> __WARN_RATELIMIT(condition, &_rs, format); \
> })
>
> +#else
> +
> +#define WARN_ON_RATELIMIT(condition, state) \
> + WARN_ON(condition)
> +
> +#define __WARN_RATELIMIT(condition, state, format...) \
> +({ \
> + int rtn = WARN(condition, format); \
> + rtn; \
> +})
> +
> +#define WARN_RATELIMIT(condition, format...) \
> +({ \
> + int rtn = WARN(condition, format); \
> + rtn; \
> +})
> +
> +#endif
> +
> /*
> * WARN_ON_SMP() is for cases that the warning is either
> * meaningless for !SMP or may even cause failures.
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled)
2011-05-24 20:11 ` Randy Dunlap
@ 2011-05-24 20:14 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2011-05-24 20:14 UTC (permalink / raw)
To: randy.dunlap; +Cc: joe, sfr, netdev, linux-next, linux-kernel
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Tue, 24 May 2011 13:11:51 -0700
> On 05/24/11 12:53, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> Date: Tue, 24 May 2011 12:49:40 -0700
>>
>>> On Tue, 2011-05-24 at 15:32 -0400, David Miller wrote:
>>>> From: Joe Perches <joe@perches.com>
>>>> Date: Tue, 24 May 2011 11:49:48 -0700
>>>>> On Tue, 2011-05-24 at 11:33 -0700, Randy Dunlap wrote:
>>>>>> Adding <linux/ratelimit.h> to <asm-generic/bug.h> causes other problems:
>>>>> Yup, that's not a good solution.
>>>> Please come up with a fix or I'll have to revert, thanks Joe.
>>>
>>> I have some errands to run for awhile.
>>>
>>> Probably a revert today and another patch set tomorrow
>>> might be best.
>>>
>>> This seems to work and doesn't cause any extra state to be
>>> instantiated when !CONFIG_PRINTK. What do you think?
>>
>> Seems fine, here it is as a patch.
>>
>> Randy please test this, thanks:
>
> Works here.
>
> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Thanks Randy, once my allmodconfig+!CONFIG_PRINTK build finishes
I'll push this out.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-24 20:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20110524140212.a4f19769.sfr@canb.auug.org.au>
2011-05-24 18:33 ` linux-next: Tree for May 24 (ratelimits, CONFIG_PRINTK not enabled) Randy Dunlap
2011-05-24 18:49 ` Joe Perches
2011-05-24 19:32 ` David Miller
2011-05-24 19:49 ` Joe Perches
2011-05-24 19:53 ` David Miller
2011-05-24 20:11 ` Randy Dunlap
2011-05-24 20:14 ` David Miller
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).