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


Groups > linux.kernel > #1408963

Re: [PATCH 4/6] mm, oom: skip over vforked tasks

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4/6] mm, oom: skip over vforked tasks
Date 2016-05-30 12:00 +0200
Message-ID <rEs9k-2s5-35@gated-at.bofh.it> (permalink)
References <rD2TD-6uy-5@gated-at.bofh.it> <rD2TE-6uy-13@gated-at.bofh.it> <rDt7s-5Rp-7@gated-at.bofh.it> <rEpEu-11J-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon 30-05-16 09:13:57, Michal Hocko wrote:
> On Fri 27-05-16 19:48:30, Vladimir Davydov wrote:
> > On Thu, May 26, 2016 at 02:40:13PM +0200, Michal Hocko wrote:
> [...]
> > > @@ -839,6 +841,13 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
> > >  	for_each_process(p) {
> > >  		if (!process_shares_mm(p, mm))
> > >  			continue;
> > > +		/*
> > > +		 * vforked tasks are ignored because they will drop the mm soon
> > > +		 * hopefully and even if not they will not mind being oom
> > > +		 * reaped because they cannot touch any memory.
> > 
> > They shouldn't modify memory, but they still can touch it AFAIK.
> 
> You are right. This means that the vforked child might see zero pages.
> Let me think whether this is acceptable or not.

OK, I was thinking about it some more and I think you have a good point
here. I can see two options here:
- keep vforked task alive and skip the oom reaper. If the victim exits
  normally and the oom wouldn't get resolved the vforked task will be
  selected in the next round because the victim would clean up
  vfork_done state in  wait_for_vfork_done. We are still risking that
  the victim gets stuck though
- kill vforked task and so it would be reapable.

The later sounds more robust to me because we invoke the oom_reaper and
the side effect shouldn't be really a problem because the vforked task
couldn't have done a lot of useful work anyway. So I will drop this
patch and update "mm, oom: fortify task_will_free_mem" to skip the
the vfork check as well.
-- 
Michal Hocko
SUSE Labs

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


Thread

[PATCH 4/6] mm, oom: skip over vforked tasks Michal Hocko <mhocko@kernel.org> - 2016-05-26 14:50 +0200
  Re: [PATCH 4/6] mm, oom: skip over vforked tasks Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-05-27 18:50 +0200
    Re: [PATCH 4/6] mm, oom: skip over vforked tasks Michal Hocko <mhocko@kernel.org> - 2016-05-30 09:20 +0200
      Re: [PATCH 4/6] mm, oom: skip over vforked tasks Michal Hocko <mhocko@kernel.org> - 2016-05-30 12:00 +0200
        Re: [PATCH 4/6] mm, oom: skip over vforked tasks Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-05-30 12:50 +0200
          Re: [PATCH 4/6] mm, oom: skip over vforked tasks Michal Hocko <mhocko@kernel.org> - 2016-05-30 13:00 +0200
  Re: [PATCH 4/6] mm, oom: skip over vforked tasks Michal Hocko <mhocko@kernel.org> - 2016-05-30 14:10 +0200

csiph-web