Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1176892
| Path | csiph.com!aioe.org!news.glorb.com!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] f2fs: reduce lock overhead of extent node releasing |
| Date | Sun, 05 Jul 2015 11:00:03 +0200 |
| Message-ID | <pINWi-Dz-3@gated-at.bofh.it> (permalink) |
| References | <pHM6d-2Kb-17@gated-at.bofh.it> |
| X-Original-To | Chao Yu <yuchaochina@hotmail.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 74 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net |
| X-Original-Date | Sat, 4 Jul 2015 00:03:53 -0700 |
| X-Original-Message-ID | <20150704070353.GE15817@jaegeuk-mac02.hsd1.ca.comcast.net> |
| X-Original-References | <COL402-EAS176E0D9A5A44C7C97F55904AB970@phx.gbl> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1176892 |
Show key headers only | View raw
On Thu, Jul 02, 2015 at 08:40:12PM +0800, Chao Yu wrote:
> >From e5c6600d01c4462c4e1ee0c70ec1d9319862077d Mon Sep 17 00:00:00 2001
> From: Chao Yu <chao2.yu@samsung.com>
> Date: Thu, 2 Jul 2015 18:52:46 +0800
> Subject: [PATCH] f2fs: reduce lock overhead of extent node releasing
>
> Open and close critical section for each extent node when traversing rb-tree
> results in high overhead of cpu, slows thing down.
>
> This patch alternates to batch mode for removing extent nodes under spin lock.
>
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
> fs/f2fs/data.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 6a706dd..7fb56a0 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -441,19 +441,31 @@ static unsigned int __free_extent_tree(struct f2fs_sb_info *sbi,
> struct extent_node *en;
> unsigned int count = et->count;
>
> - node = rb_first(&et->root);
> - while (node) {
> - next = rb_next(node);
> - en = rb_entry(node, struct extent_node, rb_node);
> + if (!et->count)
> + return 0;
> +
> + /* 1. remove all extent nodes in global lru list */
> + if (free_all) {
> + spin_lock(&sbi->extent_lock);
> + node = rb_first(&et->root);
> + while (node) {
> + next = rb_next(node);
> + en = rb_entry(node, struct extent_node, rb_node);
>
> - if (free_all) {
> - spin_lock(&sbi->extent_lock);
> if (!list_empty(&en->list))
> list_del_init(&en->list);
> - spin_unlock(&sbi->extent_lock);
> + node = next;
> }
> + spin_unlock(&sbi->extent_lock);
> + }
> +
> + /* 2. release all extent nodes which are not in global lru list */
Hmm,
Is there any overhead to traverse the rb_tree twice and any spin_lock delay
caused by contention?
Thanks,
> + node = rb_first(&et->root);
> + while (node) {
> + next = rb_next(node);
> + en = rb_entry(node, struct extent_node, rb_node);
>
> - if (free_all || list_empty(&en->list)) {
> + if (list_empty(&en->list)) {
> __detach_extent_node(sbi, et, en);
> kmem_cache_free(extent_node_slab, en);
> }
> --
> 2.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] f2fs: reduce lock overhead of extent node releasing Chao Yu <yuchaochina@hotmail.com> - 2015-07-02 14:50 +0200 Re: [PATCH] f2fs: reduce lock overhead of extent node releasing Jaegeuk Kim <jaegeuk@kernel.org> - 2015-07-05 11:00 +0200
csiph-web