linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line
@ 2018-10-24 16:53 Laurence Oberman
  2018-10-24 17:43 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laurence Oberman @ 2018-10-24 16:53 UTC (permalink / raw)
  To: linux-kernel, loberman; +Cc: rdunlap, tglx

Both graphics and serial consoles are exposed to hard lockups
when handling a large amount of messaging. The kernel watchdog_thresh
parameter up to now has not been available to be set on the kernel line for
early boot.
This patch allows the setting of watchdog_thresh to be increased
when needed to avoid the hard lockups in the console code.

Signed-off-by: Laurence Oberman <loberman@redhat.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++
 init/main.c                                     | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 4cdcd1a..cd8d588 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4932,6 +4932,14 @@
 			or other driver-specific files in the
 			Documentation/watchdog/ directory.
 
+	watchdog_thresh=
+			This parameter is now available as a kernel line
+			parameter. Use watchdog_thresh=30 as example
+			This will allow early boot changes of the current
+			default of 10s to be increased when needed to
+			avoid hard lockups.
+			Default: 10
+
 	workqueue.watchdog_thresh=
 			If CONFIG_WQ_WATCHDOG is configured, workqueue can
 			warn stall conditions and dump internal state to
diff --git a/init/main.c b/init/main.c
index 1c3f902..88cbed9 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1038,6 +1038,15 @@ static int __init set_debug_rodata(char *str)
 __setup("rodata=", set_debug_rodata);
 #endif
 
+static int __init
+is_watchdog_thresh_setup(char *str)
+{
+	get_option(&str, &watchdog_thresh);
+	return 1;
+}
+__setup("watchdog_thresh=", is_watchdog_thresh_setup);
+
+
 #ifdef CONFIG_STRICT_KERNEL_RWX
 static void mark_readonly(void)
 {
-- 
1.8.3.1


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

* Re: [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line
  2018-10-24 16:53 [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line Laurence Oberman
@ 2018-10-24 17:43 ` Randy Dunlap
  2018-10-24 18:23 ` kbuild test robot
  2018-10-24 19:58 ` kbuild test robot
  2 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2018-10-24 17:43 UTC (permalink / raw)
  To: Laurence Oberman, linux-kernel; +Cc: tglx

On 10/24/18 9:53 AM, Laurence Oberman wrote:
> Both graphics and serial consoles are exposed to hard lockups
> when handling a large amount of messaging. The kernel watchdog_thresh
> parameter up to now has not been available to be set on the kernel line for
> early boot.
> This patch allows the setting of watchdog_thresh to be increased
> when needed to avoid the hard lockups in the console code.
> 
> Signed-off-by: Laurence Oberman <loberman@redhat.com>
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++
>  init/main.c                                     | 9 +++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 4cdcd1a..cd8d588 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4932,6 +4932,14 @@
>  			or other driver-specific files in the
>  			Documentation/watchdog/ directory.
>  
> +	watchdog_thresh=
> +			This parameter is now available as a kernel line
> +			parameter. Use watchdog_thresh=30 as example
> +			This will allow early boot changes of the current
> +			default of 10s to be increased when needed to
> +			avoid hard lockups.
> +			Default: 10
> +

The first sentence isn't needed.  and s/10s/10 seconds/
How about this?

			This parameter allows early boot to change the default
			value of the watchdog timeout threshold from the default
			of 10 seconds to avoid hard lockups.  Example:
			watchdog_thresh=30

			

>  	workqueue.watchdog_thresh=
>  			If CONFIG_WQ_WATCHDOG is configured, workqueue can
>  			warn stall conditions and dump internal state to
> diff --git a/init/main.c b/init/main.c
> index 1c3f902..88cbed9 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1038,6 +1038,15 @@ static int __init set_debug_rodata(char *str)
>  __setup("rodata=", set_debug_rodata);
>  #endif
>  
> +static int __init
> +is_watchdog_thresh_setup(char *str)

No need to split that into 2 lines; just join them, please.

> +{
> +	get_option(&str, &watchdog_thresh);
> +	return 1;
> +}
> +__setup("watchdog_thresh=", is_watchdog_thresh_setup);
> +
> +
>  #ifdef CONFIG_STRICT_KERNEL_RWX
>  static void mark_readonly(void)
>  {
> 


-- 
~Randy

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

* Re: [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line
  2018-10-24 16:53 [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line Laurence Oberman
  2018-10-24 17:43 ` Randy Dunlap
@ 2018-10-24 18:23 ` kbuild test robot
  2018-10-24 18:40   ` Laurence Oberman
  2018-10-24 19:58 ` kbuild test robot
  2 siblings, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2018-10-24 18:23 UTC (permalink / raw)
  To: Laurence Oberman; +Cc: kbuild-all, linux-kernel, loberman, rdunlap, tglx

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

Hi Laurence,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux-sof-driver/master]
[also build test ERROR on v4.19 next-20181019]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Laurence-Oberman/V3-init-main-c-Enable-watchdog_thresh-control-from-kernel-line/20181025-015902
base:   https://github.com/thesofproject/linux master
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   init/main.c: In function 'is_watchdog_thresh_setup':
>> init/main.c:1037:20: error: 'watchdog_thresh' undeclared (first use in this function); did you mean 'proc_watchdog_thresh'?
     get_option(&str, &watchdog_thresh);
                       ^~~~~~~~~~~~~~~
                       proc_watchdog_thresh
   init/main.c:1037:20: note: each undeclared identifier is reported only once for each function it appears in

vim +1037 init/main.c

  1033	
  1034	static int __init
  1035	is_watchdog_thresh_setup(char *str)
  1036	{
> 1037		get_option(&str, &watchdog_thresh);
  1038		return 1;
  1039	}
  1040	__setup("watchdog_thresh=", is_watchdog_thresh_setup);
  1041	
  1042	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6302 bytes --]

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

* Re: [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line
  2018-10-24 18:23 ` kbuild test robot
@ 2018-10-24 18:40   ` Laurence Oberman
  0 siblings, 0 replies; 5+ messages in thread
From: Laurence Oberman @ 2018-10-24 18:40 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, tglx

On Thu, 2018-10-25 at 02:23 +0800, kbuild test robot wrote:
> Hi Laurence,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on linux-sof-driver/master]
> [also build test ERROR on v4.19 next-20181019]
> [if your patch is applied to the wrong git tree, please drop us a
> note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Laurence-Oberman/V3-
> init-main-c-Enable-watchdog_thresh-control-from-kernel-line/20181025-
> 015902
> base:   https://github.com/thesofproject/linux master
> config: i386-tinyconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
>    init/main.c: In function 'is_watchdog_thresh_setup':
> > > init/main.c:1037:20: error: 'watchdog_thresh' undeclared (first
> > > use in this function); did you mean 'proc_watchdog_thresh'?
> 
>      get_option(&str, &watchdog_thresh);
>                        ^~~~~~~~~~~~~~~
>                        proc_watchdog_thresh
>    init/main.c:1037:20: note: each undeclared identifier is reported
> only once for each function it appears in
> 
> vim +1037 init/main.c
> 
>   1033	
>   1034	static int __init
>   1035	is_watchdog_thresh_setup(char *str)
>   1036	{
> > 1037		get_option(&str, &watchdog_thresh);
> 
>   1038		return 1;
>   1039	}
>   1040	__setup("watchdog_thresh=", is_watchdog_thresh_setup);
>   1041	
>   1042	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source
> Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel
> Corporation

Hello Randy

So I have tested this with no issues, it built clean multiple times
no errors and I was able to set the parameter and I have been using it
for days.

BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.x86_64
root=/dev/mapper/rhel_segstorage3-root ro crashkernel=512M@64M
resume=/dev/mapper/rhel_segstorage3-swap
rd.lvm.lv=rhel_segstorage3/root rd.lvm.lv=rhel_segstorage3/swap
memmap=128G!385G watchdog_thresh=60

[root@segstorage3 ~]# cd /proc/sys/kernel
[root@segstorage3 kernel]# cat watchdog_thresh
60

Do I maybe need the below to avoid the warning
extern int watchdog_thresh;

Thanks
Laurence

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

* Re: [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line
  2018-10-24 16:53 [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line Laurence Oberman
  2018-10-24 17:43 ` Randy Dunlap
  2018-10-24 18:23 ` kbuild test robot
@ 2018-10-24 19:58 ` kbuild test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2018-10-24 19:58 UTC (permalink / raw)
  To: Laurence Oberman; +Cc: kbuild-all, linux-kernel, loberman, rdunlap, tglx

[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]

Hi Laurence,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux-sof-driver/master]
[also build test ERROR on v4.19 next-20181019]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Laurence-Oberman/V3-init-main-c-Enable-watchdog_thresh-control-from-kernel-line/20181025-015902
base:   https://github.com/thesofproject/linux master
config: i386-randconfig-s1-201842 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   init/main.c: In function 'is_watchdog_thresh_setup':
>> init/main.c:1037:20: error: 'watchdog_thresh' undeclared (first use in this function)
     get_option(&str, &watchdog_thresh);
                       ^~~~~~~~~~~~~~~
   init/main.c:1037:20: note: each undeclared identifier is reported only once for each function it appears in

vim +/watchdog_thresh +1037 init/main.c

  1033	
  1034	static int __init
  1035	is_watchdog_thresh_setup(char *str)
  1036	{
> 1037		get_option(&str, &watchdog_thresh);
  1038		return 1;
  1039	}
  1040	__setup("watchdog_thresh=", is_watchdog_thresh_setup);
  1041	
  1042	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29606 bytes --]

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

end of thread, other threads:[~2018-10-24 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 16:53 [PATCH] V3 init/main.c Enable watchdog_thresh control from kernel line Laurence Oberman
2018-10-24 17:43 ` Randy Dunlap
2018-10-24 18:23 ` kbuild test robot
2018-10-24 18:40   ` Laurence Oberman
2018-10-24 19:58 ` kbuild test robot

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