Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415AbaDPFM5 (ORCPT ); Wed, 16 Apr 2014 01:12:57 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:50957 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbaDPFMy (ORCPT ); Wed, 16 Apr 2014 01:12:54 -0400 X-AuditID: cbfee68f-b7f156d00000276c-3d-534e11557941 Message-id: <1397625052.7727.8.camel@kjgkr> Subject: Re: [PATCH 2/3 v2] f2fs: fix to decrease the number of dirty dentry page From: Jaegeuk Kim Reply-to: jaegeuk.kim@samsung.com To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Date: Wed, 16 Apr 2014 14:10:52 +0900 In-reply-to: <1397559423-27411-2-git-send-email-jaegeuk.kim@samsung.com> References: <1397559423-27411-1-git-send-email-jaegeuk.kim@samsung.com> <1397559423-27411-2-git-send-email-jaegeuk.kim@samsung.com> Organization: Samsung Content-type: text/plain; charset=UTF-8 X-Mailer: Evolution 3.2.3-0ubuntu6 Content-transfer-encoding: 7bit MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsVy+t8zY91QQb9gg7bTohaXFrlb7Nl7ksXi 8q45bA7MHrsXfGby+LxJLoApissmJTUnsyy1SN8ugSvjz4q9jAXNohVbZ39ha2CcI9jFyMEh IWAisXcLdxcjJ5ApJnHh3nq2LkYuDiGBZYwSdx9PY4JImEhcOH+MESKxiFFiXdcLFgjnFaPE 0i0/2EGqeAW0JbpmH2MGsYUFgiWmv9rIDLKBDSi+eb8BSFhIQFHi7f67rCBhESD78nsnEJNZ wENi17FSkAoWAVWJrqvdbCA2J1D4xr+TUPe0Mkqc+T6XESTBLyAqcXjhdrBNzALqEpPmLWKG uFNJYnd7JztEXF5i85q3zBCXCUr8mHwP7GQJgU3sEqcW7GeD2CYg8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UKD5Zwmvzhw6vHbDTZidwOW2fW8t+D9eSku6uqv iMyVVgXhbPEX75zaZbn13kdrt3kveIw2vtNsPsDZV19pXrx45V2m40uEVrz4HjB3digj2/Xi S2WvovfbpK89Z1lm4rx/luNcPm3VWNelpXJbpux6+cRl28wZK9UuXPU/+IF/4qq5+rxKLMUZ iYZazEXFiQBL+iziIQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change log from v1: o change the patch, which includes this bug fix >From 0f3b8427b40b9ace829ba0b16336d5cd67589022 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 15 Apr 2014 16:04:15 +0900 Subject: [PATCH] f2fs: call redirty_page_for_writepage This patch replace some general codes with redirty_page_for_writepage, which can be enabled after consideration on additional procedure like counting dirty pages appropriately. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 5 +---- fs/f2fs/data.c | 10 +++------- fs/f2fs/node.c | 5 +---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 890e23d..2902f7d 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -174,10 +174,7 @@ no_write: return 0; redirty_out: - dec_page_count(sbi, F2FS_DIRTY_META); - wbc->pages_skipped++; - account_page_redirty(page); - set_page_dirty(page); + redirty_page_for_writepage(wbc, page); return AOP_WRITEPAGE_ACTIVATE; } diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 45abd60..b5cd6d1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -798,10 +798,8 @@ static int f2fs_write_data_page(struct page *page, * this page does not have to be written to disk. */ offset = i_size & (PAGE_CACHE_SIZE - 1); - if ((page->index >= end_index + 1) || !offset) { - inode_dec_dirty_dents(inode); + if ((page->index >= end_index + 1) || !offset) goto out; - } zero_user_segment(page, offset, PAGE_CACHE_SIZE); write: @@ -810,7 +808,6 @@ write: /* Dentry blocks are controlled by checkpoint */ if (S_ISDIR(inode->i_mode)) { - inode_dec_dirty_dents(inode); err = do_write_data_page(page, &fio); goto done; } @@ -832,15 +829,14 @@ done: clear_cold_data(page); out: + inode_dec_dirty_dents(inode); unlock_page(page); if (need_balance_fs) f2fs_balance_fs(sbi); return 0; redirty_out: - wbc->pages_skipped++; - account_page_redirty(page); - set_page_dirty(page); + redirty_page_for_writepage(wbc, page); return AOP_WRITEPAGE_ACTIVATE; } diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a161e95..f760793 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1227,10 +1227,7 @@ static int f2fs_write_node_page(struct page *page, return 0; redirty_out: - dec_page_count(sbi, F2FS_DIRTY_NODES); - wbc->pages_skipped++; - account_page_redirty(page); - set_page_dirty(page); + redirty_page_for_writepage(wbc, page); return AOP_WRITEPAGE_ACTIVATE; } -- 1.8.4.474.g128a96c -- Jaegeuk Kim Samsung -- 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/