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]
Message-Id: <20090730190216.5aae685a.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Thu, 30 Jul 2009 19:02:16 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>,
	Paul Menage <menage@...gle.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [patch -mm v2] mm: introduce oom_adj_child

On Thu, 30 Jul 2009 02:31:04 -0700 (PDT)
David Rientjes <rientjes@...gle.com> wrote:

> On Thu, 30 Jul 2009, KAMEZAWA Hiroyuki wrote:
> 
> > 1. IIUC, the name is strange.
> > 
> > At job scheduler, which does this.
> > 
> > if (vfork() == 0) {
> > 	/* do some job */
> > 	execve(.....)
> > }
> > 
> > Then, when oom_adj_child can be effective is after execve().
> > IIUC, the _child_ means a process created by vfork().
> > 
> 
> It's certainly a difficult thing to name and I don't claim that "child" is 
> completely accurate since, as you said, vfork'd tasks are also children 
> of the parent yet they share the same oom_adj value since it's an 
> attribute of the shared mm.
> 
> If you have suggestions for a better name, I'd happily ack it.
> 

Simply, reset_oom_adj_at_new_mm_context or some.

> > 2. More simple plan is like this, IIUC.
> > 
> >   fix oom-killer's select_bad_process() not to be in deadlock.
> > 
> 
> Alternate ideas?
> 
At brief thiking.

1. move oom_adj from mm_struct to signal struct. or somewhere.
   (see copy_signal())
   Then,
    - all threads in a process will have the same oom_adj.
    - vfork()'ed thread will inherit its parent's oom_adj.   
    - vfork()'ed thread can override oom_adj of its own.

    In other words, oom_adj is shared when CLONE_PARENT is not set.

2. rename  mm_struct's oom_adj as shadow_oom_adj.

   update this shadow_oom_adj as the highest oom_adj among
   the values all threads share this mm_struct have.
   This update is done when
   - mm_init()
   - oom_adj is written.

   User's 
   # echo XXXX > /proc/<x>/oom_adj
   is not necessary to be very very fast.

   I don't think a process which calls vfork() is multi-threaded.

3. use shadow_oom_adj in select_bad_process().



> > rather than this new stupid interface.
> > 
> 
> Well, thank you.  Regardless of whether you think it's stupid or not, it 
> doesn't allow you to livelock the kernel in a very trivial way when the 
> oom killer gets invoked prior to execve() and the parent is OOM_DISABLE.
> 


just plz consider more.

Thanks,
-Kame

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