linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrea Argangeli <andrea@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [RFC PATCH -v2] mm, oom: introduce oom reaper
Date: Fri, 27 Nov 2015 16:39:00 +0000	[thread overview]
Message-ID: <20151127163900.GY19677@suse.de> (raw)
In-Reply-To: <1448640772-30147-1-git-send-email-mhocko@kernel.org>

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-11-27 16:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 15:56 [RFC PATCH] " Michal Hocko
2015-11-25 20:08 ` Johannes Weiner
2015-11-26 11:08   ` Michal Hocko
2015-11-26 15:24     ` Tetsuo Handa
2015-11-26 16:34       ` Michal Hocko
2015-11-26 17:31         ` Michal Hocko
2015-11-27 11:29         ` Tetsuo Handa
2015-11-27 12:35           ` Michal Hocko
2015-11-27 16:12 ` [RFC PATCH -v2] " Michal Hocko
2015-11-27 16:39   ` Mel Gorman [this message]
2015-12-01 13:07     ` Michal Hocko
2015-11-28  4:39   ` Tetsuo Handa
2015-11-28 16:10     ` Tetsuo Handa
2015-12-01 13:29       ` Michal Hocko
2015-12-05 12:33         ` Tetsuo Handa
2015-12-07 16:07           ` Michal Hocko
2015-12-07 22:19             ` Tetsuo Handa
2015-12-08 11:06               ` Michal Hocko
2015-12-01 13:22     ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151127163900.GY19677@suse.de \
    --to=mgorman@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox