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


Groups > linux.kernel > #1278879

Re: [RFC PATCH -v2] mm, oom: introduce oom reaper

From Mel Gorman <mgorman@suse.de>
Newsgroups linux.kernel
Subject Re: [RFC PATCH -v2] mm, oom: introduce oom reaper
Date 2015-11-27 17:40 +0100
Message-ID <qzudX-5jX-7@gated-at.bofh.it> (permalink)
References <qyKEb-8h2-3@gated-at.bofh.it> <qztUB-5dg-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 27, 2015 at 05:12:52PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> This is based on the idea from Mel Gorman discussed during LSFMM 2015 and
> independently brought up by Oleg Nesterov.
> 
> <SNIP>
> 
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Other than a few small issues below, I didn't spot anything out of the
ordinary so

Acked-by: Mel Gorman <mgorman@suse.de>

> +	tlb_gather_mmu(&tlb, mm, 0, -1);
> +	for (vma = mm->mmap ; vma; vma = vma->vm_next) {
> +		if (is_vm_hugetlb_page(vma))
> +			continue;
> +
> +		/*
> +		 * Only anonymous pages have a good chance to be dropped
> +		 * without additional steps which we cannot afford as we
> +		 * are OOM already.
> +		 */
> +		if (vma_is_anonymous(vma) || !(vma->vm_flags & VM_SHARED))
> +			unmap_page_range(&tlb, vma, vma->vm_start, vma->vm_end,
> +					 &details);
> +	}

Care to add a comment why clean file pages should not be discarded? I'm
assuming it's because you assume they were discarded already by normal
reclaim before OOM. There is a slightly possibility they are been kept
alive because the OOM victim is constantly referencing them so they get
activated or that there might be additional work to discard buffers but
I'm not 100% sure that's your logic.

> @@ -421,6 +528,7 @@ void mark_oom_victim(struct task_struct *tsk)
>  	/* OOM killer might race with memcg OOM */
>  	if (test_and_set_tsk_thread_flag(tsk, TIF_MEMDIE))
>  		return;
> +
>  	/*
>  	 * Make sure that the task is woken up from uninterruptible sleep
>  	 * if it is frozen because OOM killer wouldn't be able to free

Unnecessary whitespace change.

> @@ -607,15 +716,23 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
>  			continue;
>  		if (same_thread_group(p, victim))
>  			continue;
> -		if (unlikely(p->flags & PF_KTHREAD))
> -			continue;
> -		if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
> +		if (unlikely(p->flags & PF_KTHREAD) ||
> +		    p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) {
> +			/*
> +			 * We cannot usee oom_reaper for the mm shared by this process
> +			 * because it wouldn't get killed and so the memory might be
> +			 * still used.
> +			 */
> +			can_oom_reap = false;
>  			continue;

s/usee/use/

-- 
Mel Gorman
SUSE Labs
--
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

[RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-25 17:00 +0100
  Re: [RFC PATCH] mm, oom: introduce oom reaper Johannes Weiner <hannes@cmpxchg.org> - 2015-11-25 21:10 +0100
    Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 12:10 +0100
      Re: [RFC PATCH] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-26 16:30 +0100
        Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 17:40 +0100
          Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 18:40 +0100
          Re: [RFC PATCH] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-27 12:30 +0100
            Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-27 13:40 +0100
  [RFC PATCH -v2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-27 17:20 +0100
    Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Mel Gorman <mgorman@suse.de> - 2015-11-27 17:40 +0100
    Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-28 05:50 +0100
      Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-28 17:20 +0100

csiph-web