From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH next 00/12] mm: replace struct mem_cgroup_zone with struct lruvec
Date: Tue, 1 May 2012 21:09:58 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1205012005390.1293@eggly.anvils> (raw)
In-Reply-To: <4F9A4E8E.4040700@openvz.org>
On Fri, 27 Apr 2012, Konstantin Khlebnikov wrote:
> Andrew Morton wrote:
> > On Thu, 26 Apr 2012 11:53:44 +0400
> > Konstantin Khlebnikov<khlebnikov@openvz.org> wrote:
> >
> > > This patchset depends on Johannes Weiner's patch
> > > "mm: memcg: count pte references from every member of the reclaimed
> > > hierarchy".
> > >
> > > bloat-o-meter delta for patches 2..12
> > >
> > > add/remove: 6/6 grow/shrink: 6/14 up/down: 4414/-4625 (-211)
> >
> > That's the sole effect and intent of the patchset? To save 211 bytes?
I am surprised it's not more: it feels like more.
>
> This is almost last bunch of cleanups for lru_lock splitting,
> code reducing is only nice side-effect.
> Also this patchset removes many redundant lruvec relookups.
>
> Now mostly all page-to-lruvec translations are located at the same level
> as zone->lru_lock locking. So lru-lock splitting patchset can something like
> this:
>
> -zone = page_zone(page)
> -spin_lock_irq(&zone->lru_lock)
> -lruvec = mem_cgroup_page_lruvec(page)
> +lruvec = lock_page_lruvec_irq(page)
>
> >
> > > ...
> > >
> > > include/linux/memcontrol.h | 16 +--
> > > include/linux/mmzone.h | 14 ++
> > > mm/memcontrol.c | 33 +++--
> > > mm/mmzone.c | 14 ++
> > > mm/page_alloc.c | 8 -
> > > mm/vmscan.c | 277
> > > ++++++++++++++++++++------------------------
> > > 6 files changed, 177 insertions(+), 185 deletions(-)
> >
> > If so, I'm not sure that it is worth the risk and effort?
I'm pretty sure that it is worth the effort, and see very little risk.
It's close to my "[PATCH 3/10] mm/memcg: add zone pointer into lruvec"
posted 20 Feb (after Konstantin posted his set a few days earlier),
which Kamezawa-san Acked with "I like this cleanup". But this goes
a little further (e.g. 01/12 saving an arg by moving priority into sc,
that's nice; and v2 05/12 removing update_isolated_counts(), great).
Konstantin and I came independently to this simplification, or
generalization, from zone to lruvec: we're confident that it is the
right direction, that it's a good basis for further work. Certainly
neither of us have yet posted numbers to justify per-memcg per-zone
locking (and I expect split zone locking to need more justification
than it's had); but we both think these patches are a worthwhile
cleanup on their own.
I don't think it was particularly useful to split this into all of
12 pieces! But never mind, that's a trivial detail, not worth undoing.
There's a few by-the-by bits and pieces I liked in my version that are
not here, but nothing important: if I care enough, I can always send a
little cleanup afterwards.
The only change I'd ask for is in the commit comment on 02/12: it
puzzlingly says "page_zone()" where it means to say "lruvec_zone()".
I think if I'd been doing 04/12, I'd have resented passing "zone" to
shrink_page_list(), would have deleted its VM_BUG_ON, and used a
page_zone() for ZONE_CONGESTED: but that's just me being mean.
I've gone through and compared the result of these 12 against my own
tree updated to next-20120427. We come out much the same: the only
divergence which worried me was that my mem_cgroup_zone_lruvec() says
IF (!memcg || mem_cgroup_disabled())
return &zone->lruvec;
and although I'm sure I had a reason for adding that "!memcg || ",
I cannot now see why. Maybe it was for some intermediate use that went
away (but I mention it in the hope that Konstantin will double check).
To each one of the 12 (with lruvec_zone in 02/12, and v2 of 05/12):
Acked-by: Hugh Dickins <hughd@google.com>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-05-02 4:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 7:53 Konstantin Khlebnikov
2012-04-26 7:53 ` [PATCH 01/12] mm/vmscan: store "priority" in struct scan_control Konstantin Khlebnikov
2012-04-26 7:53 ` [PATCH 02/12] mm: add link from struct lruvec to struct zone Konstantin Khlebnikov
2012-05-02 5:52 ` [PATCH v2 " Konstantin Khlebnikov
2012-04-26 7:53 ` [PATCH 03/12] mm/vmscan: push lruvec pointer into isolate_lru_pages() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 04/12] mm/vmscan: push zone pointer into shrink_page_list() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 05/12] mm/vmscan: push zone pointer into update_isolated_counts() Konstantin Khlebnikov
2012-04-26 13:17 ` [PATCH v2 05/12] mm/vmscan: remove update_isolated_counts() Konstantin Khlebnikov
2012-04-27 10:28 ` Mel Gorman
2012-04-26 7:54 ` [PATCH 06/12] mm/vmscan: push lruvec pointer into putback_inactive_pages() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 07/12] mm/vmscan: replace zone_nr_lru_pages() with get_lruvec_size() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 08/12] mm/vmscan: push lruvec pointer into inactive_list_is_low() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 09/12] mm/vmscan: push lruvec pointer into shrink_list() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 10/12] mm/vmscan: push lruvec pointer into get_scan_count() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 11/12] mm/vmscan: push lruvec pointer into should_continue_reclaim() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 12/12] mm/vmscan: kill struct mem_cgroup_zone Konstantin Khlebnikov
2012-04-26 23:25 ` [PATCH next 00/12] mm: replace struct mem_cgroup_zone with struct lruvec Andrew Morton
2012-04-27 7:45 ` Konstantin Khlebnikov
2012-05-02 4:09 ` Hugh Dickins [this message]
2012-05-02 6:13 ` Konstantin Khlebnikov
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=alpine.LSU.2.00.1205012005390.1293@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=khlebnikov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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