Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/12/18 09:53), Petr Mladek wrote: > > > > True, but at the same time nobody complained that we didn't have those > > extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there > > is probably some value in those extra WARN-s. > > I agree that there is some value in the extra WARN's. Also it seems > that it is useful to disable them for debugging purposes. I do not > see a better solution. Therefore I am fine with this one. Good. > Yes, this extra comment would be appreciated. Yep. > If you send v2, please, break also the WARN definition to 80-chars's > per line ;-) Yeah, I noticed that too. Acked-by: Sergey Senozhatsky -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/12/18 09:53), Petr Mladek wrote: > > > > True, but at the same time nobody complained that we didn't have those > > extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there > > is probably some value in those extra WARN-s. > > I agree that there is some value in the extra WARN's. Also it seems > that it is useful to disable them for debugging purposes. I do not > see a better solution. Therefore I am fine with this one. Good. > Yes, this extra comment would be appreciated. Yep. > If you send v2, please, break also the WARN definition to 80-chars's > per line ;-) Yeah, I noticed that too. Acked-by: Sergey Senozhatsky -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On Thu 2018-07-12 13:25:52, Sergey Senozhatsky wrote: > On (07/11/18 23:09), Steven Rostedt wrote: > > > On (07/11/18 15:17), Steven Rostedt wrote: > > > > +bool ignore_console_lock_warning __read_mostly; > > > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > > > > > OK. So, to recap, > > > We made is_console_locked() EXPORT_SYMBOL recently [it's still in > > > linux-next], > > > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > > > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which > > > will > > > disable those newly added WARN_CONSOLE_UNLOCKED and make other people > > > happy > > > again. > > > > Note, it only made people that added a module parameter that disables > > grabbing the console lock in the first place for debugging purposes > > only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining > > that they exist. They are complaining that it breaks one of their > > debugging work flows, and need to disable it when they are doing so. > > True, but at the same time nobody complained that we didn't have those > extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there > is probably some value in those extra WARN-s. I agree that there is some value in the extra WARN's. Also it seems that it is useful to disable them for debugging purposes. I do not see a better solution. Therefore I am fine with this one. > > I could add a comment explaining why it exists. Something like: > > > > /* > > * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging > > * purposes. > > */ > > s/is you/if you/ Yes, this extra comment would be appreciated. If you send v2, please, break also the WARN definition to 80-chars's per line ;-) > Suggested-by: one-of-those-commit...@youknowwhoyouare.org ;) AFAIK, the change was actually suggested by Steven. The inspiration is described by the line: Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Finally, IMHO, it would make sense to push this change together with the fbcon/vt side. Best Regards, Petr
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On Thu 2018-07-12 13:25:52, Sergey Senozhatsky wrote: > On (07/11/18 23:09), Steven Rostedt wrote: > > > On (07/11/18 15:17), Steven Rostedt wrote: > > > > +bool ignore_console_lock_warning __read_mostly; > > > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > > > > > OK. So, to recap, > > > We made is_console_locked() EXPORT_SYMBOL recently [it's still in > > > linux-next], > > > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > > > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which > > > will > > > disable those newly added WARN_CONSOLE_UNLOCKED and make other people > > > happy > > > again. > > > > Note, it only made people that added a module parameter that disables > > grabbing the console lock in the first place for debugging purposes > > only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining > > that they exist. They are complaining that it breaks one of their > > debugging work flows, and need to disable it when they are doing so. > > True, but at the same time nobody complained that we didn't have those > extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there > is probably some value in those extra WARN-s. I agree that there is some value in the extra WARN's. Also it seems that it is useful to disable them for debugging purposes. I do not see a better solution. Therefore I am fine with this one. > > I could add a comment explaining why it exists. Something like: > > > > /* > > * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging > > * purposes. > > */ > > s/is you/if you/ Yes, this extra comment would be appreciated. If you send v2, please, break also the WARN definition to 80-chars's per line ;-) > Suggested-by: one-of-those-commit...@youknowwhoyouare.org ;) AFAIK, the change was actually suggested by Steven. The inspiration is described by the line: Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Finally, IMHO, it would make sense to push this change together with the fbcon/vt side. Best Regards, Petr
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/11/18 23:09), Steven Rostedt wrote: > > On (07/11/18 15:17), Steven Rostedt wrote: > > > +bool ignore_console_lock_warning __read_mostly; > > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > > > OK. So, to recap, > > We made is_console_locked() EXPORT_SYMBOL recently [it's still in > > linux-next], > > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which > > will > > disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy > > again. > > Note, it only made people that added a module parameter that disables > grabbing the console lock in the first place for debugging purposes > only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining > that they exist. They are complaining that it breaks one of their > debugging work flows, and need to disable it when they are doing so. True, but at the same time nobody complained that we didn't have those extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there is probably some value in those extra WARN-s. > I could add a comment explaining why it exists. Something like: > > /* > * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging > * purposes. > */ s/is you/if you/ Suggested-by: one-of-those-commit...@youknowwhoyouare.org ;) -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/11/18 23:09), Steven Rostedt wrote: > > On (07/11/18 15:17), Steven Rostedt wrote: > > > +bool ignore_console_lock_warning __read_mostly; > > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > > > OK. So, to recap, > > We made is_console_locked() EXPORT_SYMBOL recently [it's still in > > linux-next], > > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which > > will > > disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy > > again. > > Note, it only made people that added a module parameter that disables > grabbing the console lock in the first place for debugging purposes > only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining > that they exist. They are complaining that it breaks one of their > debugging work flows, and need to disable it when they are doing so. True, but at the same time nobody complained that we didn't have those extra WARN_CONSOLE_UNLOCKED()-s. Just saying. Over all I agree that there is probably some value in those extra WARN-s. > I could add a comment explaining why it exists. Something like: > > /* > * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging > * purposes. > */ s/is you/if you/ Suggested-by: one-of-those-commit...@youknowwhoyouare.org ;) -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On Thu, 12 Jul 2018 10:58:48 +0900 Sergey Senozhatsky wrote: > On (07/11/18 15:17), Steven Rostedt wrote: > > +bool ignore_console_lock_warning __read_mostly; > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > OK. So, to recap, > We made is_console_locked() EXPORT_SYMBOL recently [it's still in linux-next], > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which will > disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy > again. Note, it only made people that added a module parameter that disables grabbing the console lock in the first place for debugging purposes only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining that they exist. They are complaining that it breaks one of their debugging work flows, and need to disable it when they are doing so. > > This makes me wonder - do we want to add more WARN_CONSOLE_UNLOCKED in the > first place? :) I would say yes. > > Other than that, the patch looks OK to me I guess. I'm not super happy with > more printk EXPORT_SYMBOL-s, frankly speaking, I'm not entirely in love with > the "add a bool flag to suppress warn print outs which we added in the > previous patch" direction, but if you guys want/need it... I could add a comment explaining why it exists. Something like: /* * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging * purposes. */ > Probably I'm just dramatizing it, as usual ;) > The removal of "#if 1" is definitely nice. Yeah, that had to go regardless. > > Let's hear from Petr. Sure. -- Steve
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On Thu, 12 Jul 2018 10:58:48 +0900 Sergey Senozhatsky wrote: > On (07/11/18 15:17), Steven Rostedt wrote: > > +bool ignore_console_lock_warning __read_mostly; > > +EXPORT_SYMBOL(ignore_console_lock_warning); > > OK. So, to recap, > We made is_console_locked() EXPORT_SYMBOL recently [it's still in linux-next], > so people could use WARN_CONSOLE_UNLOCKED in more places; this made other > people unhappy, so now we add another EXPORT_SYMBOL to the picture, which will > disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy > again. Note, it only made people that added a module parameter that disables grabbing the console lock in the first place for debugging purposes only. The added WARN_CONSOLE_UNLOCKED() are good. Nobody complaining that they exist. They are complaining that it breaks one of their debugging work flows, and need to disable it when they are doing so. > > This makes me wonder - do we want to add more WARN_CONSOLE_UNLOCKED in the > first place? :) I would say yes. > > Other than that, the patch looks OK to me I guess. I'm not super happy with > more printk EXPORT_SYMBOL-s, frankly speaking, I'm not entirely in love with > the "add a bool flag to suppress warn print outs which we added in the > previous patch" direction, but if you guys want/need it... I could add a comment explaining why it exists. Something like: /* * Set this is you need to quiet WARN_CONSOLE_UNLOCKED() for debugging * purposes. */ > Probably I'm just dramatizing it, as usual ;) > The removal of "#if 1" is definitely nice. Yeah, that had to go regardless. > > Let's hear from Petr. Sure. -- Steve
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/11/18 15:17), Steven Rostedt wrote: > +bool ignore_console_lock_warning __read_mostly; > +EXPORT_SYMBOL(ignore_console_lock_warning); OK. So, to recap, We made is_console_locked() EXPORT_SYMBOL recently [it's still in linux-next], so people could use WARN_CONSOLE_UNLOCKED in more places; this made other people unhappy, so now we add another EXPORT_SYMBOL to the picture, which will disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy again. This makes me wonder - do we want to add more WARN_CONSOLE_UNLOCKED in the first place? :) Other than that, the patch looks OK to me I guess. I'm not super happy with more printk EXPORT_SYMBOL-s, frankly speaking, I'm not entirely in love with the "add a bool flag to suppress warn print outs which we added in the previous patch" direction, but if you guys want/need it... Probably I'm just dramatizing it, as usual ;) The removal of "#if 1" is definitely nice. Let's hear from Petr. -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
On (07/11/18 15:17), Steven Rostedt wrote: > +bool ignore_console_lock_warning __read_mostly; > +EXPORT_SYMBOL(ignore_console_lock_warning); OK. So, to recap, We made is_console_locked() EXPORT_SYMBOL recently [it's still in linux-next], so people could use WARN_CONSOLE_UNLOCKED in more places; this made other people unhappy, so now we add another EXPORT_SYMBOL to the picture, which will disable those newly added WARN_CONSOLE_UNLOCKED and make other people happy again. This makes me wonder - do we want to add more WARN_CONSOLE_UNLOCKED in the first place? :) Other than that, the patch looks OK to me I guess. I'm not super happy with more printk EXPORT_SYMBOL-s, frankly speaking, I'm not entirely in love with the "add a bool flag to suppress warn print outs which we added in the previous patch" direction, but if you guys want/need it... Probably I'm just dramatizing it, as usual ;) The removal of "#if 1" is definitely nice. Let's hear from Petr. -ss
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
Hi, On 11-07-18 21:17, Steven Rostedt wrote: From: Steven Rostedt (VMware) There's been discussion on the fb list about the addition of WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when the fb module is loaded with lockless_register_fb the console lock is not taken for debugging reasons. With the addition of WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to fill up with warnings when trying to debug the fb driver. There's also a #if 1 that enables the warning which was added before git history, and we look down on constant #if's in the kernel nowadays anyway. Remove the #if 1 and add a ignore_console_lock_warning boolean that can be set by drivers to ignore the warning in order to do debugging. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Signed-off-by: Steven Rostedt (VMware) Based on the fbdev discussion this seems a good idea to me and codewise this looks good to: Reviewed-by: Hans de Goede Regards, Hans --- diff --git a/include/linux/console.h b/include/linux/console.h index dfd6b0e97855..9d4a6b985154 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -200,11 +200,9 @@ void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); /* Some debug stub to catch some of the obvious races in the VT code */ -#if 1 -#define WARN_CONSOLE_UNLOCKED()WARN_ON(!is_console_locked() && !oops_in_progress) -#else -#define WARN_CONSOLE_UNLOCKED() -#endif +extern bool ignore_console_lock_warning; +#define WARN_CONSOLE_UNLOCKED() \ + WARN_ON(!ignore_console_lock_warning && !is_console_locked() && !oops_in_progress) /* VESA Blanking Levels */ #define VESA_NO_BLANKING0 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 247808333ba4..d9056efc3739 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -66,6 +66,9 @@ int console_printk[4] = { CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ }; +bool ignore_console_lock_warning __read_mostly; +EXPORT_SYMBOL(ignore_console_lock_warning); + /* * Low level drivers may need that to know if they can schedule in * their unblank() callback or not. So let's export it.
Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
Hi, On 11-07-18 21:17, Steven Rostedt wrote: From: Steven Rostedt (VMware) There's been discussion on the fb list about the addition of WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when the fb module is loaded with lockless_register_fb the console lock is not taken for debugging reasons. With the addition of WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to fill up with warnings when trying to debug the fb driver. There's also a #if 1 that enables the warning which was added before git history, and we look down on constant #if's in the kernel nowadays anyway. Remove the #if 1 and add a ignore_console_lock_warning boolean that can be set by drivers to ignore the warning in order to do debugging. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Signed-off-by: Steven Rostedt (VMware) Based on the fbdev discussion this seems a good idea to me and codewise this looks good to: Reviewed-by: Hans de Goede Regards, Hans --- diff --git a/include/linux/console.h b/include/linux/console.h index dfd6b0e97855..9d4a6b985154 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -200,11 +200,9 @@ void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); /* Some debug stub to catch some of the obvious races in the VT code */ -#if 1 -#define WARN_CONSOLE_UNLOCKED()WARN_ON(!is_console_locked() && !oops_in_progress) -#else -#define WARN_CONSOLE_UNLOCKED() -#endif +extern bool ignore_console_lock_warning; +#define WARN_CONSOLE_UNLOCKED() \ + WARN_ON(!ignore_console_lock_warning && !is_console_locked() && !oops_in_progress) /* VESA Blanking Levels */ #define VESA_NO_BLANKING0 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 247808333ba4..d9056efc3739 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -66,6 +66,9 @@ int console_printk[4] = { CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ }; +bool ignore_console_lock_warning __read_mostly; +EXPORT_SYMBOL(ignore_console_lock_warning); + /* * Low level drivers may need that to know if they can schedule in * their unblank() callback or not. So let's export it.
[PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
From: Steven Rostedt (VMware) There's been discussion on the fb list about the addition of WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when the fb module is loaded with lockless_register_fb the console lock is not taken for debugging reasons. With the addition of WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to fill up with warnings when trying to debug the fb driver. There's also a #if 1 that enables the warning which was added before git history, and we look down on constant #if's in the kernel nowadays anyway. Remove the #if 1 and add a ignore_console_lock_warning boolean that can be set by drivers to ignore the warning in order to do debugging. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Signed-off-by: Steven Rostedt (VMware) --- diff --git a/include/linux/console.h b/include/linux/console.h index dfd6b0e97855..9d4a6b985154 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -200,11 +200,9 @@ void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); /* Some debug stub to catch some of the obvious races in the VT code */ -#if 1 -#define WARN_CONSOLE_UNLOCKED()WARN_ON(!is_console_locked() && !oops_in_progress) -#else -#define WARN_CONSOLE_UNLOCKED() -#endif +extern bool ignore_console_lock_warning; +#define WARN_CONSOLE_UNLOCKED() \ + WARN_ON(!ignore_console_lock_warning && !is_console_locked() && !oops_in_progress) /* VESA Blanking Levels */ #define VESA_NO_BLANKING0 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 247808333ba4..d9056efc3739 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -66,6 +66,9 @@ int console_printk[4] = { CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ }; +bool ignore_console_lock_warning __read_mostly; +EXPORT_SYMBOL(ignore_console_lock_warning); + /* * Low level drivers may need that to know if they can schedule in * their unblank() callback or not. So let's export it.
[PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
From: Steven Rostedt (VMware) There's been discussion on the fb list about the addition of WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when the fb module is loaded with lockless_register_fb the console lock is not taken for debugging reasons. With the addition of WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to fill up with warnings when trying to debug the fb driver. There's also a #if 1 that enables the warning which was added before git history, and we look down on constant #if's in the kernel nowadays anyway. Remove the #if 1 and add a ignore_console_lock_warning boolean that can be set by drivers to ignore the warning in order to do debugging. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a2569...@suse.de Signed-off-by: Steven Rostedt (VMware) --- diff --git a/include/linux/console.h b/include/linux/console.h index dfd6b0e97855..9d4a6b985154 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -200,11 +200,9 @@ void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); /* Some debug stub to catch some of the obvious races in the VT code */ -#if 1 -#define WARN_CONSOLE_UNLOCKED()WARN_ON(!is_console_locked() && !oops_in_progress) -#else -#define WARN_CONSOLE_UNLOCKED() -#endif +extern bool ignore_console_lock_warning; +#define WARN_CONSOLE_UNLOCKED() \ + WARN_ON(!ignore_console_lock_warning && !is_console_locked() && !oops_in_progress) /* VESA Blanking Levels */ #define VESA_NO_BLANKING0 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 247808333ba4..d9056efc3739 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -66,6 +66,9 @@ int console_printk[4] = { CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ }; +bool ignore_console_lock_warning __read_mostly; +EXPORT_SYMBOL(ignore_console_lock_warning); + /* * Low level drivers may need that to know if they can schedule in * their unblank() callback or not. So let's export it.