Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753765AbbGXK1M (ORCPT ); Fri, 24 Jul 2015 06:27:12 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:56818 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbbGXK1I (ORCPT ); Fri, 24 Jul 2015 06:27:08 -0400 X-AuditID: cbfee61b-f79416d0000014c0-bd-55b212fa4078 From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] f2fs: fix to build free nids from readaheaded nat pages Date: Fri, 24 Jul 2015 18:26:26 +0800 Message-id: <006001d0c5fb$4a25f890$de71e9b0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdDF+xFKLuuX7lCLQZSgoK7qwT8pxw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jAd1fQptCDf7c0rV4sn4Ws8WlRe4W l3fNYXNg9ti0qpPNY/eCz0wenzfJBTBHcdmkpOZklqUW6dslcGXMef+LteAae8WLV2cZGxi7 2boYOTkkBEwk1m/tZYSwxSQu3FsPFOfiEBJYxCjx7/JaFgjnFaPEvL8vWECq2ARUJJZ3/GcC sUWA7EOLLrOD2MwCHhKNHd9ZQWxhAR+J9SeWMoPYLAKqEpenPgar4RWwlFgzYQkjhC0o8WPy PRaIXi2J9TuPM0HY8hKb17xlhrhIQWLH2deMELv0JA7dWAxVLy6x8cgtlgmMArOQjJqFZNQs JKNmIWlZwMiyilE0tSC5oDgpPddIrzgxt7g0L10vOT93EyM4gJ9J72Bc1WBxiFGAg1GJhzdj wsZQIdbEsuLK3EOMEhzMSiK8DMeAQrwpiZVVqUX58UWlOanFhxilOViUxHlP5vuECgmkJ5ak ZqemFqQWwWSZODilGhgZz9Tva/Ixi+JK91z56aqBiMLV1v8McYUqd1+ulPP+ohGvqGXYqx1Y Gb7zZM5WP58LoYpenJGrhWsKi13XT/lykflk3Jd7YVZc0fxe/nfDot/4b108y+qJewj3FG1O 0fdrHm+cIM51estBw90Lruv4i8Vm/yxlCIpOy5ubWC+qanpG7AfrVCWW4oxEQy3mouJEAE6f mf5cAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 39 When there is no enough free nids in free nid cache, we will try to readahead FREE_NID_PAGES:4 nat pages into page cache of meta_inode, then, reading nat entries in nat page for adding free nids to free nid cache. But when traversing all nat pages we readaheaded in a circulation, our exit condition is not set right, one more nat page will be scanned without readaheading, resulting worse read performance. This patch fixes to read the correct number nat pages to avoid bad performance. Signed-off-by: Chao Yu --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 7dd2b9d..ac91107 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1532,7 +1532,7 @@ static void build_free_nids(struct f2fs_sb_info *sbi) if (unlikely(nid >= nm_i->max_nid)) nid = 0; - if (i++ == FREE_NID_PAGES) + if (++i >= FREE_NID_PAGES) break; } -- 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/