Re: [PATCH] mm/memcontrol: avoid unnecessary PageTransHuge() when counting compound page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon 06-05-19 23:22:11, Yafang Shao wrote:
> On Mon, May 6, 2019 at 9:59 PM Michal Hocko <mhocko@xxxxxxxx> 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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux