Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318AbbGMJoF (ORCPT ); Mon, 13 Jul 2015 05:44:05 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:51353 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbbGMJoD (ORCPT ); Mon, 13 Jul 2015 05:44:03 -0400 X-AuditID: cbfee61b-f79416d0000014c0-73-55a3886145f3 From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] f2fs: warm up cold page after mmaped write Date: Mon, 13 Jul 2015 17:43:19 +0800 Message-id: <007f01d0bd50$720a37d0$561ea770$@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: AdC9UDkGCAO1P4lkRqW4pp6kyEKfWQ== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsVy+t9jQd3EjsWhBq+7eC2erJ/FbHFpkbvF 5V1z2ByYPTat6mTz2L3gM5PH501yAcxRXDYpqTmZZalF+nYJXBlvf2xiKZjCUbHu4n/WBsYr bF2MnBwSAiYSqw92MUHYYhIX7q0HiwsJTGeUOLAru4uRC8h+xSixuesXWIJNQEViecd/sAYR IPvQosvsIDazgIdEY8d3VhBbWMBe4ub93WBxFgFViW+b3jCD2LwClhLLvz6EsgUlfky+xwLR qyWxfudxJghbXmLzmrfMEAcpSOw4+5oRYpeexMa9D6F2iUtsPHKLZQKjwCwko2YhGTULyahZ SFoWMLKsYhRNLUguKE5KzzXSK07MLS7NS9dLzs/dxAgO32fSOxhXNVgcYhTgYFTi4W3YsihU iDWxrLgy9xCjBAezkghvTvHiUCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8J/N9QoUE0hNLUrNT UwtSi2CyTBycUg2Mxufy/sanbLii7WXKvNv4h+7KR5MZfS2C09mfVf+9dIbjtfPydFHd3WUP OiWdGtP5SxiM6xe4Heydcu9dOduZp2wCB/Y+ql/0n/ukplJv8EHfBxp2PBtVuk78coh+FszF 3SjJ0xrB71me2MPRcYl/Ynm60eMZx4/4S19V0N21NYPzTeZmhnolluKMREMt5qLiRABBdB/d WwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 37 With cost-benifit method, background gc will consider old section with fewer valid blocks as candidate victim, these old blocks in section will be treated as cold data, and laterly will be moved into cold segment. But if the gcing page is attached by user through buffered or mmaped write, we should reset the page as non-cold one, because this page may have more opportunity for further updating. So fix to add clearing code for the missed 'mmap' case. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 55e8e4b..f69bcd6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -86,6 +86,8 @@ static int f2fs_vm_page_mkwrite(struct vm_area_struct *vma, mapped: /* fill the page */ f2fs_wait_on_page_writeback(page, DATA); + /* if gced page is attached, don't write to cold segment */ + clear_cold_data(page); out: sb_end_pagefault(inode->i_sb); return block_page_mkwrite_return(err); -- 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/