linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux MM <linux-mm@kvack.org>,
	shaoyafang@didiglobal.com
Subject: Re: [PATCH] mm/memcontrol: avoid unnecessary PageTransHuge() when counting compound page
Date: Mon, 6 May 2019 21:19:56 +0200	[thread overview]
Message-ID: <20190506191956.GF31017@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbAM26MTZ075OThmLtv+q_cCs_DDGVWW_GpycxWEDTydCA@mail.gmail.com>

On Mon 06-05-19 23:22:11, Yafang Shao wrote:
> On Mon, May 6, 2019 at 9:59 PM Michal Hocko <mhocko@suse.com> wrote:
> >
> > On Sun 05-05-19 14:40:57, Yafang Shao wrote:
> > > If CONFIG_TRANSPARENT_HUGEPAGE is not set, hpage_nr_pages() is always 1;
> > > if CONFIG_TRANSPARENT_HUGEPAGE is set, hpage_nr_pages() will
> > > call PageTransHuge() to judge whether the page is compound page or not.
> > > So we can use the result of hpage_nr_pages() to avoid uneccessary
> > > PageTransHuge().
> >
> > The changelog doesn't describe motivation. Does this result in a better
> > code/performance?
> >
> 
> It is a better code, I think.
> Regarding the performance, I don't think it is easy to measure.

I am not convinced the patch is worth it. The code aesthetic is a matter
of taste. On the other hand, the change will be an additional step in
the git history so git blame take an additional step to get to the
original commit which is a bit annoying. Also every change, even a
trivially looking one, can cause surprising side effects. These are all
arguments make a change to the code.

So unless the resulting code is really much more cleaner, easier to read
or maintain, or it is a part of a larger series that makes further steps
easier,then I would prefer not touching the code.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-05-06 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05  6:40 Yafang Shao
2019-05-06 13:59 ` Michal Hocko
2019-05-06 15:22   ` Yafang Shao
2019-05-06 19:19     ` Michal Hocko [this message]
2019-05-07 14:21       ` Chris Down
2019-05-07 15:00         ` Yafang Shao

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=20190506191956.GF31017@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=shaoyafang@didiglobal.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