Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp595008imu; Fri, 4 Jan 2019 03:41:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4YCzGs9fpIyrMlif9YhKH/pZffX1aOSsKeDsKpbOT7xohjX/uC0OAVw/mec+MGIf5lHMER X-Received: by 2002:a63:7f4f:: with SMTP id p15mr20562211pgn.296.1546602100870; Fri, 04 Jan 2019 03:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546602100; cv=none; d=google.com; s=arc-20160816; b=ZJz6mN/e2SauwrJXxD/mzHfJmWlWw96npPoFHtSYYPe9ZanZxNeRoV1ccElk3i9npX ZODQuQFr2ToTVKr2L4//7HU8eh8u6S4JNphwhLTX6Aa0gPF21PZCK0alt4Te1gzPogvH Z4YDD5+kBRY7TyOxWCxhpKzDUQshoWrOEeRgN4Bb0FjrRu1RqCeWa+Ro7ti6ttRT3kND 4RKVKy9ioL5FsnWeZBOHLbEjfEVrd15fbDhh2q+UcafG9AzrKUQTCn+8yXscxUPqVYnd wcGBBh5xQnsv+UcGcCD4z86mzHyl67hXywTPXxPneJ6z05u9PQ9+Xvc9j1i+Jp/Q4P0J sIiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ZTWTccI5z19uae02tk+x6EKErqpJdxWvLaC2vX/Fufo=; b=swUWk8eewQZXPZoXu83ne/VCDxcE1S+sDzFBw7V0WXGtHVtUcIyGrOoIQ2hj406V2H E9ynx16Kv5j+WB0Beg+ASre229gTgIqSTDc4Xr6CW+jBpZMig/Gd9tBq6gc6sEDubIoj zeOLEKcTIWE1C/WeoH7Gnv85VH8q2FXfq+T0DTqMiyODTfR2bWK1FRU+thiDyesDEZv0 sWPTULvKQpYjShW/pfgxRpN/PUuSgthActXnepzWgpJbv1PVMaT8TSBVWYc9H6It0epO +ca5tk1VzuPO8bZaqLVDxsNwTrWLGeXaaBF+wq5YQjcdZudFVYy+QKKetLLNuMZvvZBR 5r3g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20si4833043pgi.50.2019.01.04.03.41.25; Fri, 04 Jan 2019 03:41:40 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbfADJb7 (ORCPT + 99 others); Fri, 4 Jan 2019 04:31:59 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:60759 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725958AbfADJb6 (ORCPT ); Fri, 4 Jan 2019 04:31:58 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 33FE1698C21B4; Fri, 4 Jan 2019 17:31:55 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Fri, 4 Jan 2019 17:31:53 +0800 Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: wait on atomic writes to count F2FS_CP_WB_DATA To: Jaegeuk Kim , , CC: References: <20190104042025.31982-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <3e50bcd6-1730-c28d-2d28-7a8e57f456cf@huawei.com> Date: Fri, 4 Jan 2019 17:31:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190104042025.31982-1-jaegeuk@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/1/4 12:20, Jaegeuk Kim wrote: > Otherwise, we can get wrong counts incurring checkpoint hang. > > IO_W (CP: -24, Data: 24, Flush: ( 0 0 1), Discard: ( 0 0)) > > Cc: > Signed-off-by: Jaegeuk Kim Good catch! ;) I can understand this condition, but for other new developer who reads this commit, it will be a little hard to understand situation here. How about explaining a little more about problem here, maybe: Thread A Thread B - f2fs_write_data_pages - __write_data_page - f2fs_submit_page_write - inc_page_count(F2FS_WB_DATA) type is F2FS_WB_DATA due to file is non-atomic one - f2fs_ioc_start_atomic_write - set_inode_flag(FI_ATOMIC_FILE) - f2fs_write_end_io - dec_page_count(F2FS_WB_CP_DATA) type is F2FS_WB_DATA due to file becomes atomic one Reviewed-by: Chao Yu Thanks,