Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1078446imu; Fri, 4 Jan 2019 12:38:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN43TCUhD48SY9UBGYpRd4pwZ3WXKx87QmzrU64ivIcd+F57T1JJpoI23Tlg5uklB+dmk5Nl X-Received: by 2002:a63:f201:: with SMTP id v1mr2671838pgh.232.1546634282085; Fri, 04 Jan 2019 12:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546634282; cv=none; d=google.com; s=arc-20160816; b=qiF8d8XJ0daPqEaXwndBRHpM+P2jHn7MFz441z5+W+hAlArkTpLhdNs12YTCuGAN1i mrTVe2nLMBmu7JYj/GQhjIQQi0SpLbCEyoR+9e8QzrjIIZb7NOY6zNq7zUAGiFQWNu0T xMGcyEc7SzwvCacmmGHy5J0Qg3ydlIKSmsHG6VnYhhOP5IFFIEZ7r9V05rLB2APQGZkk HlpdzL4F6Od6qK4YJoj0FZVfDBiMJcA40ritcOJEnd+RUtWhx4DUATbwLky9qrsR+gK7 8Gj6qbCF7r3uvWeBAkx42Z41XODhyV3X5/y3T01vQ+gMMHHcPEtZ31GJ0NLeUsF4doOY xsng== 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:cc :to:from:date:dkim-signature; bh=+eb9cZ3TEcLIyORTtJ7t/e6AUEP72mmWhj6miGqDUas=; b=L/PqZYOpLYIWqsrNnL7tCvjjyIwOdk045tR/0ssEoFYQc5sxdpHIx6C7GlCz5lhdRF CKhU8KLJl+BXWL/3Y4wV8PjZHa0COsSlZjnsRFOZwlljvugBXcVvrIAq+vBAnPfrSwhw Y55GDcPKUf92GNCi7G+SWSN8UGID6yDDScx7BONj6WFSGQ8BXLk4gGKHwGUnQcjVJ9LV YN5Cw3CITRppo4B/F0D7du13M0ybm6bJ7/K+zWtmqxoyUdoCFBt5GeehXoATvXaiNpQB /1qSlsuen0MQOyO91f55TVNwTnId3sPFSRAK9Mg1WLokpCXEFxHv3NGT4dvI6NmkFTdN N2Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=11UqKqZa; 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 e25si39294350pgv.486.2019.01.04.12.37.46; Fri, 04 Jan 2019 12:38:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b=11UqKqZa; 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 S1726105AbfADUgG (ORCPT + 99 others); Fri, 4 Jan 2019 15:36:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:50808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbfADUgF (ORCPT ); Fri, 4 Jan 2019 15:36:05 -0500 Received: from localhost (unknown [104.132.1.71]) (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 33776218D3; Fri, 4 Jan 2019 20:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546634165; bh=JKx3cZD1oZYappQUp47+Xy5vkaB31SxGgskwAGCBHX4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=11UqKqZawsTWTxk3xN49tBeJXkunuRY5RsBOewIyEqoRHmwtutI1tCutZsrwF4dls tHz89j/xAWjjLU1vhOjx/OI/i6OvjKGT25Yw2OIiwCCy74kUDqjjGxSnxBJpBCtSHx QeOfcP1R6QvEMnWcymDmenMqotMUNyFEqa9K4lXs= Date: Fri, 4 Jan 2019 12:36:04 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, stable@vger.kernel.org Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: wait on atomic writes to count F2FS_CP_WB_DATA Message-ID: <20190104203604.GC57873@jaegeuk-macbookpro.roam.corp.google.com> References: <20190104042025.31982-1-jaegeuk@kernel.org> <3e50bcd6-1730-c28d-2d28-7a8e57f456cf@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e50bcd6-1730-c28d-2d28-7a8e57f456cf@huawei.com> 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 On 01/04, Chao Yu wrote: > 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, added the comment. :P > > Thanks, >