lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+PpKPkW-BAdct2M+HsnM=SR3CNdiFkBP1ROokSJyY6=HvjWuA@mail.gmail.com>
Date:   Tue, 26 Nov 2019 22:33:10 +0800
From:   Hao Lee <haolee.swjtu@...il.com>
To:     David Hildenbrand <david@...hat.com>
Cc:     akpm@...ux-foundation.org, Mel Gorman <mgorman@...e.de>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: use the existing variable instead of a duplicate statement

On Tue, 26 Nov 2019 at 20:13, David Hildenbrand <david@...hat.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@...hat.com>
>
Thanks. I get it!

Regards,
Hao Lee

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ