From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [RFC PATCH 2/2] ext4: improve extents status tree shrinker to avoid scanning delayed entries
Date: Tue, 31 Dec 2013 10:50:52 +0800 [thread overview]
Message-ID: <20131231025052.GA6936@gmail.com> (raw)
In-Reply-To: <20131230210917.GD5457@quack.suse.cz>
On Mon, Dec 30, 2013 at 10:09:17PM +0100, Jan Kara wrote:
> On Wed 25-12-13 11:34:48, Zheng Liu wrote:
> > On Mon, Dec 23, 2013 at 09:54:19AM +0100, Jan Kara wrote:
> > > On Fri 20-12-13 18:42:45, Zheng Liu wrote:
> > > > From: Zheng Liu <wenqing.lz@taobao.com>
> > > >
> > > > The extents status tree shrinker will scan all inodes on sbi->s_es_lru
> > > > under heavy memory pressure, and try to reclaim the entry from extents
> > > > status tree. During this process it couldn't reclaim the delayed entry
> > > > because ext4 needs to use these entries to do delayed allocation space
> > > > reservation, seek_data/hole, etc.... So if a system has done a huge
> > > > number of writes and these dirty pages don't be written out. There will
> > > > be a lot of delayed entries on extents status tree. If shrinker tries
> > > > to reclaim memory from the tree, it will burn some CPU time to iterate
> > > > on these non-reclaimable entries. At some circumstances it could cause
> > > > excessive stall time.
> > > >
> > > > In this commit a new list is used to track reclaimable entries of extent
> > > > status tree (e.g. written/unwritten/hole entries). The shrinker will
> > > > scan reclaimable entry on this list. So it won't encouter any delayed
> > > > entry and don't need to take too much time to spin. But the defect is
> > > > that we need to cost extra 1/3 memory space for one entry. Before this
> > > > commit, 'struct extent_status' occupies 48 bytes on a 64bits platform.
> > > > After that it will occupy 64 bytes. :(
> > > This looks sensible. I was just wondering about one thing: One incorrect
> > > thing the old extent shrinker does is that it tries to reclaim 'nr_to_scan'
> > > objects. That is wrong - it should *scan* 'nr_to_scan' objects and reclaim
> > > objects it can find. Now we shouldn't always start scanning at the end of
> > > the LRU because if delayed extents accumulate there we would never reclaim
> > > anything. Rather we should cycle through the list of entries we have. But
> > > that doesn't play well with the fact we have LRU list and thus want to
> > > reclaim from the end of the list. In the end what you do might be the best
> > > we can do but I wanted to mention the above just in case someone has some
> > > idea.
> >
> > Ah, thanks for pointing it out. So maybe we can fix this issue before
> > we are sure that the new improvement is acceptable because it makes us
> > avoid scanning too many objects. What do you think?
> I'm sorry but I'm not sure I understand. By 'fix this issue' do you mean
> using your patch or somehow fixing the problem that we try to reclaim
> 'nr_to_scan' objects instead of just trying to scan that many objects?
Sorry, let me clarify it please. I mean that we can have a patch to fix
the issue that we try to reclaim 'nr_to_scan' objects. After this we
could avoid scanning too much objects in extent status tree. My idea is
that we use a single patch to fix this issue. That means that we don't
need to wait other improvements because we still needs to take some time
verifing these improvements useful.
Thanks for the reply and happy new year :)!
- Zheng
next prev parent reply other threads:[~2013-12-31 2:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 10:42 [RFC PATCH 0/2] ext4: extents status tree shrinker improvement Zheng Liu
2013-12-20 10:42 ` [RFC PATCH 1/2] ext4: improve extents status tree trace point Zheng Liu
2013-12-23 8:39 ` Jan Kara
2013-12-25 3:23 ` Zheng Liu
2013-12-20 10:42 ` [RFC PATCH 2/2] ext4: improve extents status tree shrinker to avoid scanning delayed entries Zheng Liu
2013-12-23 8:54 ` Jan Kara
2013-12-25 3:34 ` Zheng Liu
2013-12-30 21:09 ` Jan Kara
2013-12-31 2:50 ` Zheng Liu [this message]
2013-12-31 8:20 ` [PATCH] ext4: make es shrinker handle nr_to_scan correctly (Re: [RFC PATCH 2/2] ext4: improve ...) Zheng Liu
2013-12-31 10:59 ` Jan Kara
2014-01-15 3:02 ` Zheng Liu
2013-12-23 9:03 ` [RFC PATCH 0/2] ext4: extents status tree shrinker improvement Jan Kara
2013-12-25 3:21 ` Zheng Liu
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=20131231025052.GA6936@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wenqing.lz@taobao.com \
/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).