From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEB09C43331 for ; Tue, 31 Mar 2020 03:54:38 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB5C42072D; Tue, 31 Mar 2020 03:54:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="XCtULAxb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="lWSr5Ebk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="cW8tGpMd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB5C42072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7z4-0008Qk-4m; Tue, 31 Mar 2020 03:54:38 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jJ7z2-0008Qd-Dk for linux-f2fs-devel@lists.sourceforge.net; Tue, 31 Mar 2020 03:54:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=W8K4sUyTH5nY+O4iQ0xGUcxh/+3/TigXPzNNVq7SAPY=; b=XCtULAxb67ThkT90hOWn8iomOT 8Qf1IupQVFCAx7YioduB2VqR0UlhPs3r7Cgux59qChC5TokN9zOBN8uI8Z4TDM6aX0rFu86PwLVha v0WZ1q1oegHf+VwaN0VHf41fOt8z6Cq69+Up1NM2AxMPehym8gweStopGNUpSLMikQCA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=W8K4sUyTH5nY+O4iQ0xGUcxh/+3/TigXPzNNVq7SAPY=; b=lWSr5EbkYB5z2krXkyf61dacNe f3ALky8EiL/TyvdTnz8g17KaztapoJqqOtGBzrtX0L3Wv736PwGJnpE4IvgdPrcrHQn+moKJu6KKD 9Xe6HihsVzXKslq/IbhVm/mF3h8VoIv+3m1i/vnDN2a9VUuPqvl08+SbNYEgFOuyBiXw=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jJ7yw-002OQG-7w for linux-f2fs-devel@lists.sourceforge.net; Tue, 31 Mar 2020 03:54:36 +0000 Received: from localhost (unknown [104.132.1.66]) (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 B8A412072D; Tue, 31 Mar 2020 03:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585626859; bh=TKTh/9sPD0psIzinZfSfayKwQQgwyOsyAnSJ/BrlOqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cW8tGpMd0n2m42LIs3mSyPV9ZWV48h64ZooNkJZ3pbkRkYwanhso3jeRjBAvAtFf0 81/AwUWRodIV0LkhSn60s5JyJ8BP11lAXjObarjnHMhJ0xXAA5FseeOk5ttlRACfRQ 2KmETlalnf650sJTyIqnznFmXC2Xb+0RlbDZiXKk= Date: Mon, 30 Mar 2020 20:54:19 -0700 From: Jaegeuk Kim To: Sahitya Tummala Message-ID: <20200331035419.GB79749@google.com> References: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> X-Headers-End: 1jJ7yw-002OQG-7w Subject: Re: [f2fs-dev] [PATCH] f2fs: prevent meta updates while checkpoint is in progress X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 03/26, Sahitya Tummala wrote: > allocate_segment_for_resize() can cause metapage updates if > it requires to change the current node/data segments for resizing. > Stop these meta updates when there is a checkpoint already > in progress to prevent inconsistent CP data. I'd prefer to use f2fs_lock_op() in bigger coverage. > > Signed-off-by: Sahitya Tummala > --- > fs/f2fs/gc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 5bca560..6122bad 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -1399,8 +1399,10 @@ static int free_segment_range(struct f2fs_sb_info *sbi, unsigned int start, > int err = 0; > > /* Move out cursegs from the target range */ > + f2fs_lock_op(sbi); > for (type = CURSEG_HOT_DATA; type < NR_CURSEG_TYPE; type++) > allocate_segment_for_resize(sbi, type, start, end); > + f2fs_unlock_op(sbi); > > /* do GC to move out valid blocks in the range */ > for (segno = start; segno <= end; segno += sbi->segs_per_sec) { > -- > Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11374C43331 for ; Tue, 31 Mar 2020 03:54:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D55CF20748 for ; Tue, 31 Mar 2020 03:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585626861; bh=TKTh/9sPD0psIzinZfSfayKwQQgwyOsyAnSJ/BrlOqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=nfi9bvAmwRMZ+sCfrEnfjGYSCjnXKfUKsK9MhluA5UASqhcVLmDUbu8okXZviI+1F BD4bqImmVPQxnrPrUJTtPVub6pXub6XwpNKWb8cxITLPTNykp3AAtU6uJKZg7VvRKI 0LfMqoq0Jf7difHWiEXAyuajSVjJUO3GnyQ4+M7U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729772AbgCaDyU (ORCPT ); Mon, 30 Mar 2020 23:54:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbgCaDyU (ORCPT ); Mon, 30 Mar 2020 23:54:20 -0400 Received: from localhost (unknown [104.132.1.66]) (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 B8A412072D; Tue, 31 Mar 2020 03:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585626859; bh=TKTh/9sPD0psIzinZfSfayKwQQgwyOsyAnSJ/BrlOqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cW8tGpMd0n2m42LIs3mSyPV9ZWV48h64ZooNkJZ3pbkRkYwanhso3jeRjBAvAtFf0 81/AwUWRodIV0LkhSn60s5JyJ8BP11lAXjObarjnHMhJ0xXAA5FseeOk5ttlRACfRQ 2KmETlalnf650sJTyIqnznFmXC2Xb+0RlbDZiXKk= Date: Mon, 30 Mar 2020 20:54:19 -0700 From: Jaegeuk Kim To: Sahitya Tummala Cc: Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: prevent meta updates while checkpoint is in progress Message-ID: <20200331035419.GB79749@google.com> References: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585219019-24831-1-git-send-email-stummala@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/26, Sahitya Tummala wrote: > allocate_segment_for_resize() can cause metapage updates if > it requires to change the current node/data segments for resizing. > Stop these meta updates when there is a checkpoint already > in progress to prevent inconsistent CP data. I'd prefer to use f2fs_lock_op() in bigger coverage. > > Signed-off-by: Sahitya Tummala > --- > fs/f2fs/gc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 5bca560..6122bad 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -1399,8 +1399,10 @@ static int free_segment_range(struct f2fs_sb_info *sbi, unsigned int start, > int err = 0; > > /* Move out cursegs from the target range */ > + f2fs_lock_op(sbi); > for (type = CURSEG_HOT_DATA; type < NR_CURSEG_TYPE; type++) > allocate_segment_for_resize(sbi, type, start, end); > + f2fs_unlock_op(sbi); > > /* do GC to move out valid blocks in the range */ > for (segno = start; segno <= end; segno += sbi->segs_per_sec) { > -- > Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.