From: Hugh Dickins <hughd@google.com>
To: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <jweiner@redhat.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/7 v2] mm: rework __isolate_lru_page() file/anon filter
Date: Thu, 15 Mar 2012 16:58:31 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1203151618150.1291@eggly.anvils> (raw)
In-Reply-To: <4F618645.8020507@openvz.org>
On Thu, 15 Mar 2012, Konstantin Khlebnikov wrote:
> Hugh Dickins wrote:
> > On Sat, 10 Mar 2012, Konstantin Khlebnikov wrote:
> > > Konstantin Khlebnikov wrote:
> > >
> > > Heh, looks like we don't need these checks at all:
> > > without RECLAIM_MODE_LUMPYRECLAIM we isolate only pages from right lru,
> > > with RECLAIM_MODE_LUMPYRECLAIM we isolate pages from all evictable lru.
> > > Thus we should check only PageUnevictable() on lumpy reclaim.
> >
> > Yes, those were great simplfying insights: I'm puzzling over why you
> > didn't follow through on them in your otherwise nice 4.5/7, which
> > still involves lru bits in the isolate mode?
>
> Actually filter is required for single case: lumpy isolation for
> shrink_active_list().
> Maybe I'm wrong,
You are right. I thought you were wrong, but testing proved you right.
> or this is bug, but I don't see any reasons why this can not happen:
It's very close to being a bug: perhaps I'd call it overlooked silliness.
> sc->reclaim_mode manipulations are very tricky.
And you are right on that too. Particularly those reset_reclaim_mode()s
in shrink_page_list(), when the set_reclaim_mode() is done at the head of
shrink_inactive_list().
With no set_reclaim_mode() or reset_reclaim_mode() in shrink_active_list(),
so its isolate_lru_pages() test for RECLAIM_MODE_LUMPYRECLAIM just picks up
whatever sc->reclaim_mode was left over from earlier shrink_inactive_list().
Or none: the age_active_anon() call to shrink_active_list() never sets
sc->reclaim_mode, and is lucky that the only test for RECLAIM_MODE_SINGLE
is in code that it won't reach.
(Or maybe I've got some of those details wrong again, it's convoluted.)
I contend that what we want is
--- next/mm/vmscan.c 2012-03-13 03:52:15.360030839 -0700
+++ linux/mm/vmscan.c 2012-03-15 14:53:47.035519540 -0700
@@ -1690,6 +1690,8 @@ static void shrink_active_list(unsigned
lru_add_drain();
+ reset_reclaim_mode(sc);
+
if (!sc->may_unmap)
isolate_mode |= ISOLATE_UNMAPPED;
if (!sc->may_writepage)
but admit that's a slight change in behaviour - though I think only
a sensible one. It's silly to embark upon lumpy reclaim of adjacent
pages, while tying your hands to pull only from file for file or from
anon for anon (though not so silly to restrict in/activity).
Shrinking the active list is about repopulating an inactive list when
it's low: shrinking the active list is not going to free any pages
(except when they're concurrently freed while it holds them isolated),
it's just going to move them to inactive; so aiming for adjacency at
this stage is pointless. Counter-productive even: if it's going to
make any contribution to the lumpy reclaim, it should be populating
the inactive list with a variety of good candidates to seed the next
lump (whose adjacent pages will be isolated whichever list they're on):
by populating with adjacent pages itself, it lowers the chance of
later success, and increases the perturbation of lru-ness.
And if we do a reset_reclaim_mode(sc) in shrink_active_list(), then you
can remove the leftover lru stuff which spoils the simplicity of 4.5/7.
But you are right not to mix such a change in with your reorganization:
would you like to add the patch above into your series as a separate
patch (Cc Rik and Mel), or would you like me to send it separately
for discusssion, or do you see reason to disagree with it?
Hugh
--
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-03-15 23:59 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 9:15 [PATCH v4 ch1 0/7] mm: some cleanup/rework before lru_lock splitting Konstantin Khlebnikov
2012-02-29 9:15 ` [PATCH 1/7] mm/memcg: scanning_global_lru means mem_cgroup_disabled Konstantin Khlebnikov
2012-03-02 5:12 ` KAMEZAWA Hiroyuki
2012-03-06 11:46 ` Glauber Costa
2012-02-29 9:15 ` [PATCH 2/7] mm/memcg: move reclaim_stat into lruvec Konstantin Khlebnikov
2012-03-02 5:14 ` KAMEZAWA Hiroyuki
2012-02-29 9:15 ` [PATCH 3/7] mm: rework __isolate_lru_page() file/anon filter Konstantin Khlebnikov
2012-03-02 5:17 ` KAMEZAWA Hiroyuki
2012-03-02 5:51 ` Konstantin Khlebnikov
2012-03-02 8:17 ` KAMEZAWA Hiroyuki
2012-03-02 8:53 ` Konstantin Khlebnikov
2012-03-06 11:57 ` Glauber Costa
2012-03-06 12:53 ` Konstantin Khlebnikov
2012-03-03 0:22 ` Hugh Dickins
2012-03-03 8:27 ` Konstantin Khlebnikov
2012-03-03 9:20 ` Konstantin Khlebnikov
2012-03-03 9:16 ` [PATCH 3/7 v2] " Konstantin Khlebnikov
2012-03-05 0:27 ` KAMEZAWA Hiroyuki
2012-03-07 3:22 ` Hugh Dickins
2012-03-08 5:30 ` KAMEZAWA Hiroyuki
2012-03-09 2:06 ` Hugh Dickins
2012-03-09 7:16 ` Konstantin Khlebnikov
2012-03-10 0:04 ` Hugh Dickins
2012-03-10 6:55 ` Konstantin Khlebnikov
2012-03-10 9:46 ` Konstantin Khlebnikov
2012-03-15 1:47 ` Hugh Dickins
2012-03-15 6:03 ` Konstantin Khlebnikov
2012-03-15 23:58 ` Hugh Dickins [this message]
2012-02-29 9:15 ` [PATCH 4/7] mm: push lru index into shrink_[in]active_list() Konstantin Khlebnikov
2012-03-02 5:21 ` KAMEZAWA Hiroyuki
2012-03-03 0:24 ` Hugh Dickins
2012-02-29 9:15 ` [PATCH 5/7] mm: rework reclaim_stat counters Konstantin Khlebnikov
2012-03-02 5:28 ` KAMEZAWA Hiroyuki
2012-03-02 6:11 ` Konstantin Khlebnikov
2012-03-02 8:03 ` KAMEZAWA Hiroyuki
2012-02-29 9:16 ` [PATCH 6/7] mm/memcg: rework inactive_ratio calculation Konstantin Khlebnikov
2012-03-02 5:31 ` KAMEZAWA Hiroyuki
2012-03-02 6:24 ` Konstantin Khlebnikov
2012-03-08 5:36 ` KAMEZAWA Hiroyuki
2012-02-29 9:16 ` [PATCH 7/7] mm/memcg: use vm_swappiness from target memory cgroup Konstantin Khlebnikov
2012-03-02 5:32 ` KAMEZAWA Hiroyuki
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.1203151618150.1291@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=jweiner@redhat.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--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