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


Groups > linux.kernel > #1411085

Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check
Date 2016-06-01 12:50 +0200
Message-ID <rFbSN-7iv-7@gated-at.bofh.it> (permalink)
References (1 earlier) <rEzu9-7mv-5@gated-at.bofh.it> <rEMrn-83O-17@gated-at.bofh.it> <rF0NH-8W-13@gated-at.bofh.it> <rF8ie-51y-27@gated-at.bofh.it> <rFbSN-7iv-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 01-06-16 19:41:09, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > On Wed 01-06-16 00:53:03, Oleg Nesterov wrote:
> > > On 05/31, Michal Hocko wrote:
> > > >
> > > > Oleg has pointed out that can simplify both oom_adj_write and
> > > > oom_score_adj_write even further and drop the sighand lock. The only
> > > > purpose of the lock was to protect p->signal from going away but this
> > > > will not happen since ea6d290ca34c ("signals: make task_struct->signal
> > > > immutable/refcountable").
> > > 
> > > Sorry for confusion, I meant oom_adj_read() and oom_score_adj_read().
> > > 
> > > As for oom_adj_write/oom_score_adj_write we can remove it too, but then
> > > we need to ensure (say, using cmpxchg) that unpriviliged user can not
> > > not decrease signal->oom_score_adj_min if its oom_score_adj_write()
> > > races with someone else (say, admin) which tries to increase the same
> > > oom_score_adj_min.
> > 
> > I am introducing oom_adj_mutex in a later patch so I will move it here.
> 
> Can't we reuse oom_lock like
> 
> 	if (mutex_lock_killable(&oom_lock))
> 		return -EINTR;
> 
> ? I think that updating oom_score_adj unlikely races with OOM killer
> invocation, and updating oom_score_adj should be a killable operation.

We could but what would be an advantage? Do we really need a full oom
exclusion?

-- 
Michal Hocko
SUSE Labs

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


Thread

Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check Oleg Nesterov <oleg@redhat.com> - 2016-06-01 01:00 +0200
  Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check Michal Hocko <mhocko@kernel.org> - 2016-06-01 09:00 +0200
    Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check Michal Hocko <mhocko@kernel.org> - 2016-06-01 12:50 +0200
    Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-06-01 12:50 +0200

csiph-web