Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp127589imm; Tue, 16 Oct 2018 19:35:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV60kaOsiUThE8p3KK5r9o8deRfnyRZSus1zcnDXRHoaJREw5tT5dEXN23fDVZG1TGLze7sxS X-Received: by 2002:a63:9855:: with SMTP id l21-v6mr22685643pgo.162.1539743723166; Tue, 16 Oct 2018 19:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539743723; cv=none; d=google.com; s=arc-20160816; b=lX98EQX9M6HNYJ4RMrM7H90T6YLHtnVnERgbTurxadwy62Lo+h7uDxF4Btvon9qDFz D0VqvOorDw8COXagvVtYu8vtL1J2fob6MbB3f7xGZrgYKuZYg32fP/ETlrOpKMx4jw+E FnM256JFmyFm5s2EX+bjMQwwqyfSsZ08YiWQg4XsrW1pbHoXYbDQP821kkkmeSZhZfsl Vf0t4h6juQ/16IGMdxEW9v9dVgOViV0gG13WY4zWZ3MjVudU8ozYupC/xTnwF/iopQdg ZHawtw+t12J7YL8scS5ok0PaD5Kh0c5bwltkf2p4fSgBZ6Q68oda6keCgUf95I9xUqek Gt6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=f5xo2sWff3iyZohzQAwZIOgBwDbqi2p68FL18/SJLBI=; b=YxTF+imSiBfaNk711lMwy8BNmy6s/U394OsQeWsC2wjLmX/LXHD178t7jZdFPHtzpW 5QJ7bm2XtjWyAGOx8GrmKUg/pVgs70Gh8TIA3o/iTS4+apvTgOELDmob/74onk1I286N PLiKh3wuf547316/8vSKreEhvC1ilM0xpDgOhC6VAQT0lvPEBjgfk1+yQMhJNr+DsOsm ywj0hacYBt7xi1E9T4DTUrHPW3nsFqhyT5uWIfZet9uBt6O6AxWj4Apm1TmKM4nV7VKr aCvgpx9l1/CpXra/zYC5pX2SM89s+3KMCY0vHIxEzM6n5gF13ngXe2S5BfOPLMHvGfEZ ZI0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UY95/Gn0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si15604122plr.153.2018.10.16.19.34.54; Tue, 16 Oct 2018 19:35:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UY95/Gn0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbeJQK12 (ORCPT + 99 others); Wed, 17 Oct 2018 06:27:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:59586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbeJQK12 (ORCPT ); Wed, 17 Oct 2018 06:27:28 -0400 Received: from localhost (unknown [104.132.1.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 020F5214C3; Wed, 17 Oct 2018 02:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539743645; bh=ylB1CfOTRjXtiDjQJHzt6mfOLd+Wg+0+SAOkM2JZPxA=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UY95/Gn0pLrWyo1hZu5muoIL5NK7VTbU6ZhGMG6LVRCdT6bULppjCjEUwEAYRH7lK OmBfwOdrVz5/TZeAwj7aK/mJDf0GBCIK7jbtSPQp6DVXAwwfs42IOlsqoEo18aRyH3 SJQi38I0j5t2Wn6BRUfrN792zgdRsS1A55EqH4pM= Date: Tue, 16 Oct 2018 19:34:04 -0700 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH v2] f2fs: clear cold data flag if IO is not counted Message-ID: <20181017023404.GB77619@jaegeuk-macbookpro.roam.corp.google.com> References: <20181010212217.52289-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181010212217.52289-1-jaegeuk@kernel.org> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 66110abc4c931f879d70e83e1281f891699364bf. If we clear the cold data flag out of the writeback flow, we can miscount -1 by end_io. Balancing F2FS Async: - IO (CP: 1, Data: -1, Flush: ( 0 0 1), Discard: ( ... GC thread: IRQ - move_data_page() - set_page_dirty() - clear_cold_data() - f2fs_write_end_io() - type = WB_DATA_TYPE(page); here, we get wrong type - dec_page_count(sbi, type); - f2fs_wait_on_page_writeback() Cc: Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3f272c18fb61..0d0b4dd55b04 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2650,10 +2650,6 @@ static int f2fs_set_data_page_dirty(struct page *page) if (!PageUptodate(page)) SetPageUptodate(page); - /* don't remain PG_checked flag which was set during GC */ - if (is_cold_data(page)) - clear_cold_data(page); - if (f2fs_is_atomic_file(inode) && !f2fs_is_commit_atomic_write(inode)) { if (!IS_ATOMIC_WRITTEN_PAGE(page)) { f2fs_register_inmem_page(inode, page); -- 2.19.0.605.g01d371f741-goog