All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, Zheng Liu <wenqing.lz@taobao.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Jan Kara <jack@suse.cz>
Subject: Re: [RFC PATCH v2 0/4] ext4: extents status tree shrinker improvement
Date: Mon, 21 Apr 2014 22:46:46 +0800	[thread overview]
Message-ID: <20140421144646.GB19966@gmail.com> (raw)
In-Reply-To: <20140421140523.GF14869@thunk.org>

On Mon, Apr 21, 2014 at 10:05:23AM -0400, Theodore Ts'o wrote:
[...]
> > Second question is about your deeply thought.  From your comment, it
> > seems that now we need a replacement algorithm that looks like we do in
> > memory management subsystem.  Now in memory management subsystem, we
> > have an active list and an inactive list which tracks some pages.  When
> > the system read/write some pages, these pages will be put on inactive
> > list.  Then if some pages are accessed again, they will be promoted into
> > active list.  When 'kswapd' thread tries to reclaim some pages, it will
> > drop some pages from inactive list and demote some pages from active
> > list to inactive list.  I am happy to give it a try later.
> 
> Yes, although we'll need to be careful that we don't introduce
> scalability problems caused by needing to take too many locks.  So I
> don't think we want to move items from the inactive to active list
> when the extent cache is referenced.  Instead, we'll probably want to
> bump a ref count in the cache entry, and then in the shrinker, when we
> scan the inactive list, we can check the ref count and decide then to
> move the item to the active list.  That way, only the shrinker needs
> to take the global lock.

I am not sure that I fully understand your meaning.  AFAIU, we have a
list which uses RR scheme to shrink extent caches.  In this list it
tracks written/unwrittten/hole extent caches.  When the shrinker tries
to reclaim some objects, it will scan this list and reclaim all extent
caches whose ref count are less than a number.  Meanwhile the ref count
of rest caches will be decreased and moved into active list.  In active
list it tracks all delayed extent caches, precached extent caches and
other caches that have been promoted.  The shrinker uses LRU algorithm
to reclaim objects from active list.  Please let me know if I miss
something.

Regards,
                                                - Zheng

  reply	other threads:[~2014-04-21 14:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 11:30 [RFC PATCH v2 0/4] ext4: extents status tree shrinker improvement Zheng Liu
2014-04-16 11:30 ` [RFC PATCH v2 1/4] ext4: improve extents status tree trace point Zheng Liu
2014-04-16 11:30 ` [RFC PATCH v2 2/4] ext4: track extent status tree shrinker delay statictics Zheng Liu
2014-04-16 11:30 ` [RFC PATCH v2 3/4] ext4: improve extents status tree shrinker lru algorithm Zheng Liu
2014-04-16 11:30 ` [RFC PATCH v2 4/4] ext4: use a round-robin algorithm to shrink extent cache Zheng Liu
2014-04-16 15:19 ` [RFC PATCH v2 0/4] ext4: extents status tree shrinker improvement Theodore Ts'o
2014-04-16 15:42   ` Theodore Ts'o
2014-04-17 15:35     ` Theodore Ts'o
2014-04-21 13:50       ` Zheng Liu
2014-04-21 14:05         ` Theodore Ts'o
2014-04-21 14:46           ` Zheng Liu [this message]
2014-04-21 14:54             ` Theodore Ts'o
2014-04-21 23:10       ` Dave Chinner
2014-04-23  5:35         ` Zheng Liu
2014-04-24  1:46           ` Dave Chinner

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=20140421144646.GB19966@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.