linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, linux-mm@kvack.org
Subject: Re: [PATCH] mm,oom: Reduce needless dereference.
Date: Wed, 9 Mar 2016 15:55:12 +0100	[thread overview]
Message-ID: <20160309145512.GA27011@dhcp22.suse.cz> (raw)
In-Reply-To: <20160308183032.GA9571@cmpxchg.org>

On Tue 08-03-16 13:30:32, Johannes Weiner wrote:
> On Tue, Mar 08, 2016 at 08:02:31PM +0900, Tetsuo Handa wrote:
> > Since we assigned mm = victim->mm before pr_err(),
> > we don't need to dereference victim->mm again at pr_err().
> > This saves a few instructions.
> > 
> > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> 
> Yes. Once we introduce a local variable for something, we should use
> it consistently to refer to that thing. Anything else is confusing.

The victim->mm association is stable here because of the task_lock but I
agree that this might be not obvious and reusing the local variable is
easier to read and understand. I doubt we care about the change in the
generated code as an argument though. So just for the sake of clean up

Acked-by: Michal Hocko <mhocko@suse.com>

> 
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> 
> --
> 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>

-- 
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:[~2016-03-09 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 11:02 [PATCH] mm,oom: Reduce needless dereference Tetsuo Handa
2016-03-08 13:32 ` Vlastimil Babka
2016-03-08 18:30 ` Johannes Weiner
2016-03-09 14:55   ` Michal Hocko [this message]

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=20160309145512.GA27011@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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).