lkml.org 
[lkml]   [2013]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Regression with orderly_poweroff()
On 03/12, Lucas De Marchi wrote:
>
> I have some pending patches on LKML to remove
> call_usermodehelper_fns() and export call_usermodehelper_{setup,exec}.
> Doing this we can separate the allocation part using GFP_ATOMIC

But this is pointless. Contrary, we should change __orderly_poweroff()
to do not use GFP_ATOMIC for argv_split(), see below.

> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -2194,7 +2194,8 @@ static int __orderly_poweroff(void)
> "PATH=/sbin:/bin:/usr/sbin:/usr/bin",
> NULL
> };
> - int ret;
> + struct subprocess_info *info;
> + int ret = -ENOMEM;
>
> argv = argv_split(GFP_ATOMIC, poweroff_cmd, &argc);
> if (argv == NULL) {
> @@ -2203,7 +2204,10 @@ static int __orderly_poweroff(void)
> return -ENOMEM;
> }
>
> - ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
> + info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC,
> + NULL, NULL, NULL);
> + if (info)
> + ret = call_usermodehelper_exec(info, UMH_WAIT_EXEC);

And how this can help? The real problem is not GFP_KERNEL.
call_usermodehelper_exec(UMH_WAIT_EXEC) will block.

Oleg.



\
 
 \ /
  Last update: 2013-03-12 19:41    [W:0.102 / U:2.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site