linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hao Lee <haolee.swjtu@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: use the existing variable instead of a duplicate statement
Date: Tue, 26 Nov 2019 22:33:10 +0800	[thread overview]
Message-ID: <CA+PpKPkW-BAdct2M+HsnM=SR3CNdiFkBP1ROokSJyY6=HvjWuA@mail.gmail.com> (raw)
In-Reply-To: <bbc278b2-d897-5a43-befd-7be8dacd8495@redhat.com>

On Tue, 26 Nov 2019 at 20:13, David Hildenbrand <david@redhat.com> wrote:
>
> On 25.11.19 15:53, Hao Lee wrote:
> > The address of zone has been stored in variable 'zone', so there is no need
> > to get it again with a duplicate statement.
> >
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -363,22 +363,21 @@ unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone
> >       for (zid = zone_idx + 1; zid < MAX_NR_ZONES; zid++) {
> >               struct zone *zone = &lruvec_pgdat(lruvec)->node_zones[zid];
> >               unsigned long size;
> >
> >               if (!managed_zone(zone))
> >                       continue;
> >
> >               if (!mem_cgroup_disabled())
> >                       size = mem_cgroup_get_zone_lru_size(lruvec, lru, zid);
> >               else
> > -                     size = zone_page_state(&lruvec_pgdat(lruvec)->node_zones[zid],
> > -                                    NR_ZONE_LRU_BASE + lru);
> > +                     size = zone_page_state(zone, NR_ZONE_LRU_BASE + lru);
> >               lru_size -= min(size, lru_size);
> >       }
> >
> >       return lru_size;
> >
> >  }
>
> Maybe tweak the subject to something meaningful:
>
> "mm/vmscan: reuse stored zone in lruvec_lru_size()"
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
Thanks. I get it!

Regards,
Hao Lee


  reply	other threads:[~2019-11-26 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 14:53 [PATCH] mm: use the existing variable instead of a duplicate statement Hao Lee
2019-11-25 15:18 ` Mel Gorman
2019-11-26 12:13 ` David Hildenbrand
2019-11-26 14:33   ` Hao Lee [this message]
2019-11-28 10:02 ` Anshuman Khandual
2019-11-28 15:12   ` Hao Lee

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='CA+PpKPkW-BAdct2M+HsnM=SR3CNdiFkBP1ROokSJyY6=HvjWuA@mail.gmail.com' \
    --to=haolee.swjtu@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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).