lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Apr 2014 15:34:10 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Chiang <pchiang@...dia.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Balbir Singh <bsingharora@...il.com>,
	Johannes Weiner <hannes@...xchg.org>,
	"ccross@...roid.com" <ccross@...roid.com>,
	"lizefan@...wei.com" <lizefan@...wei.com>,
	"tj@...nel.org" <tj@...nel.org>, "pavel@....cz" <pavel@....cz>,
	"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
	"guillaume@...infr.org" <guillaume@...infr.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] memcg: kill start_kernel()->mm_init_owner(init_mm)

On Fri 18-04-14 21:13:22, Oleg Nesterov wrote:
> Remove start_kernel()->mm_init_owner(&init_mm, &init_task).
> 
> This doesn't really hurt but unnecessary and misleading. init_task
> is the "swapper" thread == current, its ->mm is always NULL. And
> init_mm can only be used as ->active_mm, not as ->mm.

OK, this should work because mem_cgroup_from_task can handle NULL
task so even if somebody provided init_mm it will work properly.

But to be honest, I have no idea why mm_init_owner was called here.

> mm_init_owner() has a single caller with this patch, perhaps it
> should die. mm_init() can initialize ->owner under #ifdef.
> 
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>

Reviewed-by: Michal Hocko <mhocko@...e.cz>

> ---
>  init/main.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/init/main.c b/init/main.c
> index 3815895..17090bb 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -507,7 +507,6 @@ asmlinkage void __init start_kernel(void)
>  	page_address_init();
>  	pr_notice("%s", linux_banner);
>  	setup_arch(&command_line);
> -	mm_init_owner(&init_mm, &init_task);
>  	mm_init_cpumask(&init_mm);
>  	setup_command_line(command_line);
>  	setup_nr_cpu_ids();
> -- 
> 1.5.5.1
> 
> 

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ