linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: akpm@linux-foundation.org, hughd@google.com,
	kirill@shutemov.name, oleg@redhat.com,
	penguin-kernel@I-love.SAKURA.ne.jp, rientjes@google.com,
	mm-commits@vger.kernel.org, linux-mm@kvack.org
Subject: Re: + mm-oom-let-oom_reap_task-and-exit_mmap-to-run-concurrently.patch added to -mm tree
Date: Fri, 18 Aug 2017 09:04:44 +0200	[thread overview]
Message-ID: <20170818070444.GA9004@dhcp22.suse.cz> (raw)
In-Reply-To: <20170817171240.GB5066@redhat.com>

On Thu 17-08-17 19:12:40, Andrea Arcangeli wrote:
> On Wed, Aug 16, 2017 at 03:23:29PM +0200, Michal Hocko wrote:
> > Reviewed-by: Michal Hocko <mhocko@suse.com>
> 
> Thanks for the review!
> 
> There's this further possible microoptimization that can be folded on top.
> 
> >From 76bf017f923581d15fe01249af92b0d757752a9f Mon Sep 17 00:00:00 2001
> From: Andrea Arcangeli <aarcange@redhat.com>
> Date: Thu, 17 Aug 2017 18:39:46 +0200
> Subject: [PATCH 1/1] mm: oom: let oom_reap_task and exit_mmap run
>  concurrently, add unlikely
> 
> Microoptimization to fold before merging.
> 
> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
> ---
>  mm/mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 013170e5c8a4..ab0026a8acc4 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -3003,7 +3003,7 @@ void exit_mmap(struct mm_struct *mm)
>  	unmap_vmas(&tlb, vma, 0, -1);
>  
>  	set_bit(MMF_OOM_SKIP, &mm->flags);
> -	if (tsk_is_oom_victim(current)) {
> +	if (unlikely(tsk_is_oom_victim(current))) {

I dunno. This doesn't make any difference in the generated code for
me (with gcc 6.4). If anything we might wan't to putt unlikely inside
tsk_is_oom_victim. Or even go further and use a jump label to get any
conditional paths out of way.

>  		/*
>  		 * Wait for oom_reap_task() to stop working on this
>  		 * mm. Because MMF_OOM_SKIP is already set before
> 

-- 
Michal Hocko
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:[~2017-08-18  7:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <59936823.CQNWQErWJ8EAIG3q%akpm@linux-foundation.org>
2017-08-16 13:23 ` + mm-oom-let-oom_reap_task-and-exit_mmap-to-run-concurrently.patch added to -mm tree Michal Hocko
2017-08-17 17:12   ` Andrea Arcangeli
2017-08-18  7:04     ` Michal Hocko [this message]
2017-08-18 18:41       ` Andrea Arcangeli
2017-08-21  8:30         ` 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=20170818070444.GA9004@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rientjes@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).