Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340116

Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable.

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable.
Date 2016-02-23 02:10 +0100
Message-ID <r59Ee-6jF-9@gated-at.bofh.it> (permalink)
References <r3bqO-7FR-19@gated-at.bofh.it> <r3iVj-4wq-3@gated-at.bofh.it> <r3rOV-2FS-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 18 Feb 2016, Michal Hocko wrote:

> > Anyway, this is NACK'd since task->signal->oom_score_adj is checked under 
> > task_lock() for threads with memory attached, that's the purpose of 
> > finding the correct thread in oom_badness() and taking task_lock().  We 
> > aren't going to duplicate logic in several functions that all do the same 
> > thing.
> 
> Is the task_lock really necessary, though? E.g. oom_task_origin()
> doesn't seem to depend on it for task->signal safety. If you are
> referring to races with changing oom_score_adj does such a race matter
> at all?
> 

oom_badness() ranges from 0 (don't kill) to 1000 (please kill).  It 
factors in the setting of /proc/self/oom_score_adj to change that value.  
That is where OOM_SCORE_ADJ_MIN is enforced.  It is also needed in 
oom_badness() to determine whether a child process should be sacrificed 
for its parent.  We don't add duplicate logic everywhere if you want the 
code to be maintainable; the only exception would be for performance 
critical code which the oom killer most certainly is not.

I'm simply not entertaining any patch to the oom killer that duplicates 
code everywhere, increases its complexity, makes it grow in text size, and 
makes it more difficult to maintain.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-02-17 15:40 +0100
  Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-17 15:50 +0100
  Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they  are OOM-unkillable. David Rientjes <rientjes@google.com> - 2016-02-17 23:40 +0100
    Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-18 09:10 +0100
      Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-02-18 11:40 +0100
        Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-18 13:10 +0100
          Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-18 13:20 +0100
            Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-02-19 16:10 +0100
              Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-19 16:20 +0100
      Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they  are OOM-unkillable. David Rientjes <rientjes@google.com> - 2016-02-23 02:10 +0100
        Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-23 13:40 +0100
          Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they  are OOM-unkillable. David Rientjes <rientjes@google.com> - 2016-02-23 23:40 +0100
            Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are  OOM-unkillable. Michal Hocko <mhocko@kernel.org> - 2016-02-24 11:10 +0100
              Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they  are OOM-unkillable. David Rientjes <rientjes@google.com> - 2016-02-24 22:40 +0100

csiph-web