2008-03-10 06:33:43

by Dave Young

[permalink] [raw]
Subject: [PATCH] [3/3] Use WARN_ON_SECS in rcupreempt.h

Use WARN_ON_SECS in rcupreempt.h to avoid warning flood

Signed-off-by: Dave Young <[email protected]>

---
include/linux/rcupreempt.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff -upr linux/include/linux/rcupreempt.h linux.new/include/linux/rcupreempt.h
--- linux/include/linux/rcupreempt.h 2008-03-10 13:33:13.000000000 +0800
+++ linux.new/include/linux/rcupreempt.h 2008-03-10 13:32:35.000000000 +0800
@@ -88,7 +88,7 @@ DECLARE_PER_CPU(long, dynticks_progress_
static inline void rcu_enter_nohz(void)
{
__get_cpu_var(dynticks_progress_counter)++;
- WARN_ON(__get_cpu_var(dynticks_progress_counter) & 0x1);
+ WARN_ON_SECS(__get_cpu_var(dynticks_progress_counter) & 0x1, 10);
mb();
}

@@ -96,7 +96,7 @@ static inline void rcu_exit_nohz(void)
{
mb();
__get_cpu_var(dynticks_progress_counter)++;
- WARN_ON(!(__get_cpu_var(dynticks_progress_counter) & 0x1));
+ WARN_ON_SECS(!(__get_cpu_var(dynticks_progress_counter) & 0x1), 10);
}

#else /* CONFIG_NO_HZ */


2008-03-20 00:38:18

by Dave Young

[permalink] [raw]
Subject: Re: [mmotm build error] Re: [PATCH] [3/3] Use WARN_ON_SECS in rcupreempt.h

On Thu, Mar 20, 2008 at 2:57 AM, Randy Dunlap <[email protected]> wrote:
> HZ notdef; NO_HZ=y, HZ=250
> CC init/main.o
> In file included from mmotm-2008-0318-1720/include/linux/rcupdate.h:59,
> from mmotm-2008-0318-1720/include/linux/rculist.h:10,
> from mmotm-2008-0318-1720/include/linux/dcache.h:8,
> from mmotm-2008-0318-1720/include/linux/fs.h:278,
> from mmotm-2008-0318-1720/include/linux/proc_fs.h:5,
> from mmotm-2008-0318-1720/init/main.c:14:
> mmotm-2008-0318-1720/include/linux/rcupreempt.h: In function 'rcu_enter_nohz':
> CC init/do_mounts.o
> mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: 'HZ' undeclared (first use in this function)
> mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: (Each undeclared identifier is reported only once
> mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: for each function it appears in.)
> mmotm-2008-0318-1720/include/linux/rcupreempt.h: In function 'rcu_exit_nohz':
> mmotm-2008-0318-1720/include/linux/rcupreempt.h:99: error: 'HZ' undeclared (first use in this function)
> make[2]: *** [init/main.o] Error 1

Hi,
There's a fix from andrew, please see:
http://lkml.org/lkml/2008/3/12/44

Regards
dave

2008-03-20 04:33:15

by Randy Dunlap

[permalink] [raw]
Subject: [mmotm build error] Re: [PATCH] [3/3] Use WARN_ON_SECS in rcupreempt.h

HZ notdef; NO_HZ=y, HZ=250
CC init/main.o
In file included from mmotm-2008-0318-1720/include/linux/rcupdate.h:59,
from mmotm-2008-0318-1720/include/linux/rculist.h:10,
from mmotm-2008-0318-1720/include/linux/dcache.h:8,
from mmotm-2008-0318-1720/include/linux/fs.h:278,
from mmotm-2008-0318-1720/include/linux/proc_fs.h:5,
from mmotm-2008-0318-1720/init/main.c:14:
mmotm-2008-0318-1720/include/linux/rcupreempt.h: In function 'rcu_enter_nohz':
CC init/do_mounts.o
mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: 'HZ' undeclared (first use in this function)
mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: (Each undeclared identifier is reported only once
mmotm-2008-0318-1720/include/linux/rcupreempt.h:92: error: for each function it appears in.)
mmotm-2008-0318-1720/include/linux/rcupreempt.h: In function 'rcu_exit_nohz':
mmotm-2008-0318-1720/include/linux/rcupreempt.h:99: error: 'HZ' undeclared (first use in this function)
make[2]: *** [init/main.o] Error 1

---
~Randy


Attachments:
config-rand6 (42.46 kB)