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


Groups > linux.kernel > #1241364

Re: can't oom-kill zap the victim's memory?

From Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Newsgroups linux.kernel
Subject Re: can't oom-kill zap the victim's memory?
Date 2015-10-07 13:10 +0200
Message-ID <qgULE-2Y1-1@gated-at.bofh.it> (permalink)
References <qbbma-2la-21@gated-at.bofh.it> <qbbYS-3k6-5@gated-at.bofh.it> <qbyiM-1PH-77@gated-at.bofh.it> <qbZiX-72w-7@gated-at.bofh.it> <qgFtg-648-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Oleg Nesterov wrote:
> > > Hmm. If we already have mmap_sem and started zap_page_range() then
> > > I do not think it makes sense to stop until we free everything we can.
> >
> > Zapping a huge address space can take quite some time
> 
> Yes, and this is another reason we should do this asynchronously.
> 
> > and we really do
> > not have to free it all on behalf of the killer when enough memory is
> > freed to allow for further progress and the rest can be done by the
> > victim. If one batch doesn't seem sufficient then another retry can
> > continue.
> >
> > I do not think that a limited scan would make the implementation more
> > complicated
> 
> But we can't even know much memory unmap_single_vma() actually frees.
> Even if we could, how can we know we freed enough?
> 
> Anyway. Perhaps it makes sense to abort the for_each_vma() loop if
> freed_enough_mem() == T. But it is absolutely not clear to me how we
> should define this freed_enough_mem(), so I think we should do this
> later.

Maybe

  bool freed_enough_mem(void) { !atomic_read(&oom_victims); }

if we change to call mark_oom_victim() on all threads which should be
killed as OOM victims.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: can't oom-kill zap the victim's memory? Oleg Nesterov <oleg@redhat.com> - 2015-10-06 20:50 +0200
  Re: can't oom-kill zap the victim's memory? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-07 13:10 +0200
    Re: can't oom-kill zap the victim's memory? Oleg Nesterov <oleg@redhat.com> - 2015-10-07 14:10 +0200
      Re: can't oom-kill zap the victim's memory? Michal Hocko <mhocko@kernel.org> - 2015-10-08 16:10 +0200
  Re: can't oom-kill zap the victim's memory? Michal Hocko <mhocko@kernel.org> - 2015-10-08 16:10 +0200

csiph-web