linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tty_init_dev: 24 callbacks suppressed
@ 2012-10-04  9:20 Borislav Petkov
  2012-10-04 11:23 ` Markus Trippelsdorf
  0 siblings, 1 reply; 20+ messages in thread
From: Borislav Petkov @ 2012-10-04  9:20 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Greg Kroah-Hartman, Alan Cox, LKML

Hi,

I'm seeing this on today's Linus tree:

[   24.048278] tty_init_dev: 24 callbacks suppressed
[   45.630349] tty_init_dev: 3 callbacks suppressed

It is either from that WARN_RATELIMIT thing or the printk_ratelimited
further below in tty_init_dev but I don't know for sure because the
actual text message from both printk's doesn't come out in dmesg - only
that something got suppressed.

And it quiets down later, after the machine has finished booting. Still,
this doesn't tell me anything about any issue. So what's up?

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-04  9:20 tty_init_dev: 24 callbacks suppressed Borislav Petkov
@ 2012-10-04 11:23 ` Markus Trippelsdorf
  2012-10-04 11:51   ` Markus Trippelsdorf
  0 siblings, 1 reply; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-04 11:23 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Jiri Slaby, Greg Kroah-Hartman, Alan Cox, LKML

On 2012.10.04 at 11:20 +0200, Borislav Petkov wrote:
> Hi,
> 
> I'm seeing this on today's Linus tree:
> 
> [   24.048278] tty_init_dev: 24 callbacks suppressed
> [   45.630349] tty_init_dev: 3 callbacks suppressed
> 
> It is either from that WARN_RATELIMIT thing or the printk_ratelimited
> further below in tty_init_dev but I don't know for sure because the
> actual text message from both printk's doesn't come out in dmesg - only
> that something got suppressed.
> 
> And it quiets down later, after the machine has finished booting. Still,
> this doesn't tell me anything about any issue. So what's up?

I'm seeing the same thing.
This can be fixed by a slightly modified version of:
https://patchwork.kernel.org/patch/1339221/


diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index e11ccb4..2d02461 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, state, fmt, ...)			\
 ({								\
 	static DEFINE_RATELIMIT_STATE(_rs,			\
 				      DEFAULT_RATELIMIT_INTERVAL,	\
 				      DEFAULT_RATELIMIT_BURST);	\
-	__WARN_RATELIMIT(condition, &_rs, format);		\
+	int rtn = !!(condition);				\
+								\
+	if (unlikely(rtn && __ratelimit(state)))		\
+		WARN(rtn, fmt, ##__VA_ARGS__);			\
+								\
+	rtn;							\
 })
 
 #else
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, fmt, ...)			\
 ({								\
-	int rtn = WARN(condition, format);			\
+	int rtn = WARN(condition, fmt, ##__VA_ARGS__);		\
 	rtn;							\
 })
 
-- 
Markus

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-04 11:23 ` Markus Trippelsdorf
@ 2012-10-04 11:51   ` Markus Trippelsdorf
  2012-10-04 12:40     ` Borislav Petkov
  0 siblings, 1 reply; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-04 11:51 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Jiri Slaby, Greg Kroah-Hartman, Alan Cox, LKML

On 2012.10.04 at 13:23 +0200, Markus Trippelsdorf wrote:
> On 2012.10.04 at 11:20 +0200, Borislav Petkov wrote:
> > Hi,
> > 
> > I'm seeing this on today's Linus tree:
> > 
> > [   24.048278] tty_init_dev: 24 callbacks suppressed
> > [   45.630349] tty_init_dev: 3 callbacks suppressed
> > 
> > It is either from that WARN_RATELIMIT thing or the printk_ratelimited
> > further below in tty_init_dev but I don't know for sure because the
> > actual text message from both printk's doesn't come out in dmesg - only
> > that something got suppressed.
> > 
> > And it quiets down later, after the machine has finished booting. Still,
> > this doesn't tell me anything about any issue. So what's up?
> 
> I'm seeing the same thing.
> This can be fixed by a slightly modified version of:
> https://patchwork.kernel.org/patch/1339221/

My first patch was wrong. This one should be correct:

diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index e11ccb4..d8de255 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, fmt, ...)			\
 ({								\
 	static DEFINE_RATELIMIT_STATE(_rs,			\
 				      DEFAULT_RATELIMIT_INTERVAL,	\
 				      DEFAULT_RATELIMIT_BURST);	\
-	__WARN_RATELIMIT(condition, &_rs, format);		\
+	int rtn = !!(condition);				\
+								\
+	if (unlikely(rtn && __ratelimit(&_rs)))		\
+		WARN(rtn, fmt, ##__VA_ARGS__);			\
+								\
+	rtn;							\
 })
 
 #else
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, fmt, ...)			\
 ({								\
-	int rtn = WARN(condition, format);			\
+	int rtn = WARN(condition, fmt, ##__VA_ARGS__);		\
 	rtn;							\
 })
 
-- 
Markus

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-04 11:51   ` Markus Trippelsdorf
@ 2012-10-04 12:40     ` Borislav Petkov
  2012-10-04 13:11       ` Markus Trippelsdorf
  0 siblings, 1 reply; 20+ messages in thread
From: Borislav Petkov @ 2012-10-04 12:40 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: Jiri Slaby, Greg Kroah-Hartman, Alan Cox, LKML

On Thu, Oct 04, 2012 at 01:51:57PM +0200, Markus Trippelsdorf wrote:
> diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
> index e11ccb4..d8de255 100644
> --- a/include/linux/ratelimit.h
> +++ b/include/linux/ratelimit.h
> @@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
>  #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...)			\
> +#define WARN_RATELIMIT(condition, fmt, ...)			\
>  ({								\
>  	static DEFINE_RATELIMIT_STATE(_rs,			\
>  				      DEFAULT_RATELIMIT_INTERVAL,	\
>  				      DEFAULT_RATELIMIT_BURST);	\
> -	__WARN_RATELIMIT(condition, &_rs, format);		\
> +	int rtn = !!(condition);				\
> +								\
> +	if (unlikely(rtn && __ratelimit(&_rs)))		\
> +		WARN(rtn, fmt, ##__VA_ARGS__);			\
> +								\
> +	rtn;							\
>  })

Aha, I see it. We need to look at the condition before the __ratelimit,
otherwise we WARN unnecessarily, good catch.

>  #else
> @@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
>  #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...)			\
> +#define WARN_RATELIMIT(condition, fmt, ...)			\

... except this change is unrelated and unneeded - there's enough room
in 80 cols to leave it as "format" instead of shortening it.

Other than that:

Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-04 12:40     ` Borislav Petkov
@ 2012-10-04 13:11       ` Markus Trippelsdorf
  2012-10-05 11:17         ` Jiri Slaby
  0 siblings, 1 reply; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-04 13:11 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Jiri Slaby, Greg Kroah-Hartman, Alan Cox, LKML

On 2012.10.04 at 14:40 +0200, Borislav Petkov wrote:
> On Thu, Oct 04, 2012 at 01:51:57PM +0200, Markus Trippelsdorf wrote:
> > diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
> > index e11ccb4..d8de255 100644
> > --- a/include/linux/ratelimit.h
> > +++ b/include/linux/ratelimit.h
> > @@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
> >  #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...)			\
> > +#define WARN_RATELIMIT(condition, fmt, ...)			\
> >  ({								\
> >  	static DEFINE_RATELIMIT_STATE(_rs,			\
> >  				      DEFAULT_RATELIMIT_INTERVAL,	\
> >  				      DEFAULT_RATELIMIT_BURST);	\
> > -	__WARN_RATELIMIT(condition, &_rs, format);		\
> > +	int rtn = !!(condition);				\
> > +								\
> > +	if (unlikely(rtn && __ratelimit(&_rs)))		\
> > +		WARN(rtn, fmt, ##__VA_ARGS__);			\
> > +								\
> > +	rtn;							\
> >  })
> 
> Aha, I see it. We need to look at the condition before the __ratelimit,
> otherwise we WARN unnecessarily, good catch.
> 
> >  #else
> > @@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
> >  #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...)			\
> > +#define WARN_RATELIMIT(condition, fmt, ...)			\
> 
> ... except this change is unrelated and unneeded - there's enough room
> in 80 cols to leave it as "format" instead of shortening it.
> 
> Other than that:
> 
> Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>

I'll let Jiri handle this :). It's his patch anyway.

-- 
Markus

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-04 13:11       ` Markus Trippelsdorf
@ 2012-10-05 11:17         ` Jiri Slaby
  2012-10-05 11:25           ` Alan Cox
                             ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Jiri Slaby @ 2012-10-05 11:17 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Borislav Petkov, Greg Kroah-Hartman, Alan Cox, LKML, Joe Perches

CCing Joe.

On 10/04/2012 03:11 PM, Markus Trippelsdorf wrote:
> On 2012.10.04 at 14:40 +0200, Borislav Petkov wrote:
>> On Thu, Oct 04, 2012 at 01:51:57PM +0200, Markus Trippelsdorf wrote:
>>> diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
>>> index e11ccb4..d8de255 100644
>>> --- a/include/linux/ratelimit.h
>>> +++ b/include/linux/ratelimit.h
>>> @@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
>>>  #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...)			\
>>> +#define WARN_RATELIMIT(condition, fmt, ...)			\
>>>  ({								\
>>>  	static DEFINE_RATELIMIT_STATE(_rs,			\
>>>  				      DEFAULT_RATELIMIT_INTERVAL,	\
>>>  				      DEFAULT_RATELIMIT_BURST);	\
>>> -	__WARN_RATELIMIT(condition, &_rs, format);		\
>>> +	int rtn = !!(condition);				\
>>> +								\
>>> +	if (unlikely(rtn && __ratelimit(&_rs)))		\
>>> +		WARN(rtn, fmt, ##__VA_ARGS__);			\
>>> +								\
>>> +	rtn;							\
>>>  })
>>
>> Aha, I see it. We need to look at the condition before the __ratelimit,
>> otherwise we WARN unnecessarily, good catch.
>>
>>>  #else
>>> @@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
>>>  #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...)			\
>>> +#define WARN_RATELIMIT(condition, fmt, ...)			\
>>
>> ... except this change is unrelated and unneeded - there's enough room
>> in 80 cols to leave it as "format" instead of shortening it.
>>
>> Other than that:
>>
>> Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>
> 
> I'll let Jiri handle this :). It's his patch anyway.

Actually this is Joe's version of the patch. Joe, people started hitting
the bug [1]. Could you resend your patch?

[1] https://patchwork.kernel.org/patch/1339221/

BTW what scares me that nobody noticed that bug until this is in the
Linus's tree. Do people use -next at all or am I the only one user? (I
didn't hit it as I have the patch in my local queue.)

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-05 11:17         ` Jiri Slaby
@ 2012-10-05 11:25           ` Alan Cox
  2012-10-05 12:27           ` Borislav Petkov
  2012-10-05 15:33           ` tty_init_dev: 24 callbacks suppressed Joe Perches
  2 siblings, 0 replies; 20+ messages in thread
From: Alan Cox @ 2012-10-05 11:25 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Markus Trippelsdorf, Borislav Petkov, Greg Kroah-Hartman, LKML,
	Joe Perches

> Actually this is Joe's version of the patch. Joe, people started hitting
> the bug [1]. Could you resend your patch?
> 
> [1] https://patchwork.kernel.org/patch/1339221/
> 
> BTW what scares me that nobody noticed that bug until this is in the
> Linus's tree. Do people use -next at all or am I the only one user? (I
> didn't hit it as I have the patch in my local queue.)

I run -next for various things. I'd noticed that funny but you'd started
investigating it before I got to investigating.

Alan

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-05 11:17         ` Jiri Slaby
  2012-10-05 11:25           ` Alan Cox
@ 2012-10-05 12:27           ` Borislav Petkov
  2012-10-05 12:57             ` [PATCH] Fix bogus "callbacks suppressed" messages Markus Trippelsdorf
  2012-10-05 15:33           ` tty_init_dev: 24 callbacks suppressed Joe Perches
  2 siblings, 1 reply; 20+ messages in thread
From: Borislav Petkov @ 2012-10-05 12:27 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Markus Trippelsdorf, Borislav Petkov, Greg Kroah-Hartman,
	Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 01:17:02PM +0200, Jiri Slaby wrote:
> BTW what scares me that nobody noticed that bug until this is in the
> Linus's tree. Do people use -next at all or am I the only one user? (I
> didn't hit it as I have the patch in my local queue.)

Noticing this before -rc1 and fixing it around that time is still fine
in my book. So can *someone* *please* send a patch already so that we
can forget about this.

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 12:27           ` Borislav Petkov
@ 2012-10-05 12:57             ` Markus Trippelsdorf
  2012-10-05 14:26               ` Greg Kroah-Hartman
  2012-10-05 18:06               ` Jiri Slaby
  0 siblings, 2 replies; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-05 12:57 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Jiri Slaby, Greg Kroah-Hartman, Alan Cox, LKML, Joe Perches

On the current git tree one sees messages such as:
 tty_init_dev: 24 callbacks suppressed
 tty_init_dev: 3 callbacks suppressed

To fix this we need to look at condition before calling __ratelimit in
the WARN_RATELIMIT macro. While at it remove the superfluous
__WARN_RATELIMIT macros.

Original patch is from Joe Perches and Jiri Slaby.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>
---
 include/linux/ratelimit.h | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index e11ccb4..0a260d8 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, format, ...)			\
 ({								\
 	static DEFINE_RATELIMIT_STATE(_rs,			\
 				      DEFAULT_RATELIMIT_INTERVAL,	\
 				      DEFAULT_RATELIMIT_BURST);	\
-	__WARN_RATELIMIT(condition, &_rs, format);		\
+	int rtn = !!(condition);				\
+								\
+	if (unlikely(rtn && __ratelimit(&_rs)))			\
+		WARN(rtn, format, ##__VA_ARGS__);		\
+								\
+	rtn;							\
 })
 
 #else
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #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...)			\
+#define WARN_RATELIMIT(condition, format, ...)			\
 ({								\
-	int rtn = WARN(condition, format);			\
+	int rtn = WARN(condition, format, ##__VA_ARGS__);	\
 	rtn;							\
 })
 
-- 
Markus

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 12:57             ` [PATCH] Fix bogus "callbacks suppressed" messages Markus Trippelsdorf
@ 2012-10-05 14:26               ` Greg Kroah-Hartman
  2012-10-05 15:28                 ` Markus Trippelsdorf
  2012-10-05 15:29                 ` Borislav Petkov
  2012-10-05 18:06               ` Jiri Slaby
  1 sibling, 2 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-05 14:26 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Borislav Petkov, Jiri Slaby, Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 02:57:17PM +0200, Markus Trippelsdorf wrote:
> On the current git tree one sees messages such as:
>  tty_init_dev: 24 callbacks suppressed
>  tty_init_dev: 3 callbacks suppressed
> 
> To fix this we need to look at condition before calling __ratelimit in
> the WARN_RATELIMIT macro. While at it remove the superfluous
> __WARN_RATELIMIT macros.
> 
> Original patch is from Joe Perches and Jiri Slaby.
> 
> Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>
> ---
>  include/linux/ratelimit.h | 27 +++++++++------------------
>  1 file changed, 9 insertions(+), 18 deletions(-)

I don't have a problem with this patch, but I don't understand why it's
now showing up.  There haven't been any changes in the ratelimit.h area
recently that I can see, so why is this change needed now?  What is in
the tty layer that is causing this, just the fact that it's actually
being used now?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 14:26               ` Greg Kroah-Hartman
@ 2012-10-05 15:28                 ` Markus Trippelsdorf
  2012-10-05 15:29                 ` Borislav Petkov
  1 sibling, 0 replies; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-05 15:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Borislav Petkov, Jiri Slaby, Alan Cox, LKML, Joe Perches

On 2012.10.05 at 07:26 -0700, Greg Kroah-Hartman wrote:
> On Fri, Oct 05, 2012 at 02:57:17PM +0200, Markus Trippelsdorf wrote:
> > On the current git tree one sees messages such as:
> >  tty_init_dev: 24 callbacks suppressed
> >  tty_init_dev: 3 callbacks suppressed
> > 
> > To fix this we need to look at condition before calling __ratelimit in
> > the WARN_RATELIMIT macro. While at it remove the superfluous
> > __WARN_RATELIMIT macros.
> > 
> > Original patch is from Joe Perches and Jiri Slaby.
> > 
> > Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> > Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>
> > ---
> >  include/linux/ratelimit.h | 27 +++++++++------------------
> >  1 file changed, 9 insertions(+), 18 deletions(-)
> 
> I don't have a problem with this patch, but I don't understand why it's
> now showing up.  There haven't been any changes in the ratelimit.h area
> recently that I can see, so why is this change needed now?  What is in
> the tty layer that is causing this, just the fact that it's actually
> being used now?

See Jiri's recent commit:

commit 5d4121c04b3577e37e389b3553d442f44bb346d7
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Fri Aug 17 14:27:52 2012 +0200

    TTY: check if tty->port is assigned
    
    And if not, complain loudly. None in-kernel module should trigger
    that, but let us find out for sure. On the other hand, all the
    out-of-tree modules will hit that. Give them some time (maybe one
    release) to catch up.
    
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 28c3e86..41e42f1 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1415,6 +1415,10 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx)
 	if (!tty->port)
 		tty->port = driver->ports[idx];
 
+	WARN_RATELIMIT(!tty->port,
+			"%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n",
+			__func__, tty->driver->name);
+
 	/*
 	 * Structures all installed ... call the ldisc open routines.
 	 * If we fail here just call release_tty to clean up.  No need

-- 
Markus

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 14:26               ` Greg Kroah-Hartman
  2012-10-05 15:28                 ` Markus Trippelsdorf
@ 2012-10-05 15:29                 ` Borislav Petkov
  2012-10-05 15:37                   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 20+ messages in thread
From: Borislav Petkov @ 2012-10-05 15:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Markus Trippelsdorf, Borislav Petkov, Jiri Slaby, Alan Cox, LKML,
	Joe Perches

On Fri, Oct 05, 2012 at 07:26:39AM -0700, Greg Kroah-Hartman wrote:
> I don't have a problem with this patch, but I don't understand why
> it's now showing up. There haven't been any changes in the ratelimit.h
> area recently that I can see, so why is this change needed now? What
> is in the tty layer that is causing this, just the fact that it's
> actually being used now?

>From my quick semi-skilled git history browsing, I'd say it's
5d4121c04b357 which added the WARN_RATELIMIT to tty_init_dev during the
current merge window.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: tty_init_dev: 24 callbacks suppressed
  2012-10-05 11:17         ` Jiri Slaby
  2012-10-05 11:25           ` Alan Cox
  2012-10-05 12:27           ` Borislav Petkov
@ 2012-10-05 15:33           ` Joe Perches
  2 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2012-10-05 15:33 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Markus Trippelsdorf, Borislav Petkov, Greg Kroah-Hartman, Alan Cox, LKML

On Fri, 2012-10-05 at 13:17 +0200, Jiri Slaby wrote:
> CCing Joe.
[]
> > I'll let Jiri handle this :). It's his patch anyway.
> 
> Actually this is Joe's version of the patch. Joe, people started hitting
> the bug [1]. Could you resend your patch?

> [1] https://patchwork.kernel.org/patch/1339221/

Markus already did that.

I think it'd be fine if someone picked it up.

> BTW what scares me that nobody noticed that bug until this is in the
> Linus's tree. Do people use -next at all or am I the only one user? (I
> didn't hit it as I have the patch in my local queue.)

I think you're the only actual user.

Does anyone else really use it as more than a tree
integration compilation testbed?



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:29                 ` Borislav Petkov
@ 2012-10-05 15:37                   ` Greg Kroah-Hartman
  2012-10-05 15:41                     ` Markus Trippelsdorf
  2012-10-05 15:43                     ` Borislav Petkov
  0 siblings, 2 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-05 15:37 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Markus Trippelsdorf, Jiri Slaby, Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 05:29:48PM +0200, Borislav Petkov wrote:
> On Fri, Oct 05, 2012 at 07:26:39AM -0700, Greg Kroah-Hartman wrote:
> > I don't have a problem with this patch, but I don't understand why
> > it's now showing up. There haven't been any changes in the ratelimit.h
> > area recently that I can see, so why is this change needed now? What
> > is in the tty layer that is causing this, just the fact that it's
> > actually being used now?
> 
> >From my quick semi-skilled git history browsing, I'd say it's
> 5d4121c04b357 which added the WARN_RATELIMIT to tty_init_dev during the
> current merge window.

So WARN_RATELIMIT was never working properly?  If so, how far back does
it go in kernel releases that this should be fixed?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:37                   ` Greg Kroah-Hartman
@ 2012-10-05 15:41                     ` Markus Trippelsdorf
  2012-10-05 15:43                     ` Borislav Petkov
  1 sibling, 0 replies; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-05 15:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Borislav Petkov, Jiri Slaby, Alan Cox, LKML, Joe Perches

On 2012.10.05 at 08:37 -0700, Greg Kroah-Hartman wrote:
> On Fri, Oct 05, 2012 at 05:29:48PM +0200, Borislav Petkov wrote:
> > On Fri, Oct 05, 2012 at 07:26:39AM -0700, Greg Kroah-Hartman wrote:
> > > I don't have a problem with this patch, but I don't understand why
> > > it's now showing up. There haven't been any changes in the ratelimit.h
> > > area recently that I can see, so why is this change needed now? What
> > > is in the tty layer that is causing this, just the fact that it's
> > > actually being used now?
> > 
> > >From my quick semi-skilled git history browsing, I'd say it's
> > 5d4121c04b357 which added the WARN_RATELIMIT to tty_init_dev during the
> > current merge window.
> 
> So WARN_RATELIMIT was never working properly?  If so, how far back does
> it go in kernel releases that this should be fixed?

The only user until this merge window was net/core/filter.c. The
WARN_RATELIMIT is used there since v3.0.

-- 
Markus

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:37                   ` Greg Kroah-Hartman
  2012-10-05 15:41                     ` Markus Trippelsdorf
@ 2012-10-05 15:43                     ` Borislav Petkov
  2012-10-05 15:48                       ` Markus Trippelsdorf
  1 sibling, 1 reply; 20+ messages in thread
From: Borislav Petkov @ 2012-10-05 15:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Markus Trippelsdorf, Jiri Slaby, Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 08:37:06AM -0700, Greg Kroah-Hartman wrote:
> So WARN_RATELIMIT was never working properly? If so, how far back does
> it go in kernel releases that this should be fixed?

Since b3eec79b0776e which added it in May 2011. But the only one other
user is net/core/filter.c.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:43                     ` Borislav Petkov
@ 2012-10-05 15:48                       ` Markus Trippelsdorf
  2012-10-05 16:03                         ` Borislav Petkov
  2012-10-05 16:06                         ` Greg Kroah-Hartman
  0 siblings, 2 replies; 20+ messages in thread
From: Markus Trippelsdorf @ 2012-10-05 15:48 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Greg Kroah-Hartman, Jiri Slaby, Alan Cox, LKML, Joe Perches

On 2012.10.05 at 17:43 +0200, Borislav Petkov wrote:
> On Fri, Oct 05, 2012 at 08:37:06AM -0700, Greg Kroah-Hartman wrote:
> > So WARN_RATELIMIT was never working properly? If so, how far back does
> > it go in kernel releases that this should be fixed?
> 
> Since b3eec79b0776e which added it in May 2011. But the only one othe r
> user is net/core/filter.c.

But it doesn't matter, because the WARN_RATELIMIT in net/core/filter.c
is guarded by a switch statement and uses WARN_RATELIMIT(1,...). So it
could never trigger the bug.

-- 
Markus

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:48                       ` Markus Trippelsdorf
@ 2012-10-05 16:03                         ` Borislav Petkov
  2012-10-05 16:06                         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Borislav Petkov @ 2012-10-05 16:03 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Greg Kroah-Hartman, Jiri Slaby, Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 05:48:47PM +0200, Markus Trippelsdorf wrote:
> On 2012.10.05 at 17:43 +0200, Borislav Petkov wrote:
> > On Fri, Oct 05, 2012 at 08:37:06AM -0700, Greg Kroah-Hartman wrote:
> > > So WARN_RATELIMIT was never working properly? If so, how far back does
> > > it go in kernel releases that this should be fixed?
> > 
> > Since b3eec79b0776e which added it in May 2011. But the only one othe r
> > user is net/core/filter.c.
> 
> But it doesn't matter, because the WARN_RATELIMIT in net/core/filter.c
> is guarded by a switch statement and uses WARN_RATELIMIT(1,...). So it
> could never trigger the bug.

Yes, but you should say "it covers the bug with a brown paper bag
because the condition is always true."

:-)

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 15:48                       ` Markus Trippelsdorf
  2012-10-05 16:03                         ` Borislav Petkov
@ 2012-10-05 16:06                         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 20+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-05 16:06 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Borislav Petkov, Jiri Slaby, Alan Cox, LKML, Joe Perches

On Fri, Oct 05, 2012 at 05:48:47PM +0200, Markus Trippelsdorf wrote:
> On 2012.10.05 at 17:43 +0200, Borislav Petkov wrote:
> > On Fri, Oct 05, 2012 at 08:37:06AM -0700, Greg Kroah-Hartman wrote:
> > > So WARN_RATELIMIT was never working properly? If so, how far back does
> > > it go in kernel releases that this should be fixed?
> > 
> > Since b3eec79b0776e which added it in May 2011. But the only one othe r
> > user is net/core/filter.c.
> 
> But it doesn't matter, because the WARN_RATELIMIT in net/core/filter.c
> is guarded by a switch statement and uses WARN_RATELIMIT(1,...). So it
> could never trigger the bug.

Ok, thanks for digging that all up, I'll just merge this in for 3.7.

greg k-h

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] Fix bogus "callbacks suppressed" messages
  2012-10-05 12:57             ` [PATCH] Fix bogus "callbacks suppressed" messages Markus Trippelsdorf
  2012-10-05 14:26               ` Greg Kroah-Hartman
@ 2012-10-05 18:06               ` Jiri Slaby
  1 sibling, 0 replies; 20+ messages in thread
From: Jiri Slaby @ 2012-10-05 18:06 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Borislav Petkov, Greg Kroah-Hartman, Alan Cox, LKML, Joe Perches

On 10/05/2012 02:57 PM, Markus Trippelsdorf wrote:
> On the current git tree one sees messages such as:
>  tty_init_dev: 24 callbacks suppressed
>  tty_init_dev: 3 callbacks suppressed
> 
> To fix this we need to look at condition before calling __ratelimit in
> the WARN_RATELIMIT macro. While at it remove the superfluous
> __WARN_RATELIMIT macros.
> 
> Original patch is from Joe Perches and Jiri Slaby.
> 
> Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Acked-and-tested-by: Borislav Petkov <borislav.petkov@amd.com>

Acked-by: Jiri Slaby <jslaby@suse.cz>

Thanks.

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-10-05 18:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04  9:20 tty_init_dev: 24 callbacks suppressed Borislav Petkov
2012-10-04 11:23 ` Markus Trippelsdorf
2012-10-04 11:51   ` Markus Trippelsdorf
2012-10-04 12:40     ` Borislav Petkov
2012-10-04 13:11       ` Markus Trippelsdorf
2012-10-05 11:17         ` Jiri Slaby
2012-10-05 11:25           ` Alan Cox
2012-10-05 12:27           ` Borislav Petkov
2012-10-05 12:57             ` [PATCH] Fix bogus "callbacks suppressed" messages Markus Trippelsdorf
2012-10-05 14:26               ` Greg Kroah-Hartman
2012-10-05 15:28                 ` Markus Trippelsdorf
2012-10-05 15:29                 ` Borislav Petkov
2012-10-05 15:37                   ` Greg Kroah-Hartman
2012-10-05 15:41                     ` Markus Trippelsdorf
2012-10-05 15:43                     ` Borislav Petkov
2012-10-05 15:48                       ` Markus Trippelsdorf
2012-10-05 16:03                         ` Borislav Petkov
2012-10-05 16:06                         ` Greg Kroah-Hartman
2012-10-05 18:06               ` Jiri Slaby
2012-10-05 15:33           ` tty_init_dev: 24 callbacks suppressed Joe Perches

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).