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


Groups > linux.kernel > #1644595

Re: [PATCH] mm,oom: fix oom invocation issues

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm,oom: fix oom invocation issues
Date 2017-05-18 16:30 +0200
Message-ID <tIuBb-3UN-5@gated-at.bofh.it> (permalink)
References (1 earlier) <tIfiO-x8-7@gated-at.bofh.it> <tIfiO-x8-5@gated-at.bofh.it> <tIpi9-7Qp-11@gated-at.bofh.it> <tIpBw-8eh-15@gated-at.bofh.it> <tIu89-3sl-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 18-05-17 22:57:10, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > It is racy and it basically doesn't have any allocation context so we
> > might kill a task from a different domain. So can we do this instead?
> > There is a slight risk that somebody might have returned VM_FAULT_OOM
> > without doing an allocation but from my quick look nobody does that
> > currently.
> 
> I can't tell whether it is safe to remove out_of_memory() from
> pagefault_out_of_memory().  There are VM_FAULT_OOM users in fs/
> directory. What happens if pagefault_out_of_memory() was called as a
> result of e.g. GFP_NOFS allocation failure?

Then we would bypass GFP_NOFS oom protection and could trigger a
premature OOM killer invocation.

> Is it guaranteed that all memory allocations that might occur from
> page fault event (or any action that might return VM_FAULT_OOM)
> are allowed to call oom_kill_process() from out_of_memory() before
> reaching pagefault_out_of_memory() ?

The same applies here.

> Anyway, I want
> 
> 	/* Avoid allocations with no watermarks from looping endlessly */
> -	if (test_thread_flag(TIF_MEMDIE))
> +	if (alloc_flags == ALLOC_NO_WATERMARKS && test_thread_flag(TIF_MEMDIE))
> 		goto nopage;
> 
> so that we won't see similar backtraces and memory information from both
> out_of_memory() and warn_alloc().

I do not think this is an improvement and it is unrelated to the
discussion here.

-- 
Michal Hocko
SUSE Labs

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


Thread

[PATCH] mm,oom: fix oom invocation issues Roman Gushchin <guro@fb.com> - 2017-05-17 17:30 +0200
  Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-17 18:20 +0200
    Re: [PATCH] mm,oom: fix oom invocation issues Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-05-18 00:10 +0200
      Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 10:50 +0200
        Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 11:10 +0200
          Re: [PATCH] mm,oom: fix oom invocation issues Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-05-18 16:00 +0200
            Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 16:30 +0200
              Re: [PATCH] mm,oom: fix oom invocation issues Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-05-18 17:00 +0200
                Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 17:10 +0200
              Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 17:10 +0200
    Re: [PATCH] mm,oom: fix oom invocation issues Michal Hocko <mhocko@kernel.org> - 2017-05-18 10:10 +0200

csiph-web