Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp537636pxb; Tue, 3 Nov 2020 06:15:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDvFrjHLXbDdltmqbLyGukzIMPDVIHnW5kPqWB9370HgQQRzC0fWXNg9+0Gte5TlnNstRF X-Received: by 2002:a17:907:7244:: with SMTP id ds4mr20072257ejc.172.1604412940214; Tue, 03 Nov 2020 06:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604412940; cv=none; d=google.com; s=arc-20160816; b=qDcKDEqCdYKPeDTRqkKQE4aKT6WlWGxdX3CuK0tKN1ijBfM01e710u/VwRJRUGfuol Wgpu1JbuI1FBYVsLeTbXxdy/h9MlrKY/PkZMELAuZ09tBTxsy9VMSKffELZVCmkuAjQe koVcw8vjfXYQ0fOYzcKE9UQMNw9//fvGYtVluMQkJmdiS0m0IRx/gjXMsUR2vngQO8fH xHhzwdywk001sZ1gIf/qt14do9Rg88f4U1sd22hreZ17QygILwgUSuK/yTySVCMAYW+e f1dxRcOOzxYFIYVPPcMGHR5uKyu8c84juI3dZ98mw5/iqzc5ORK7svyJdmB91xllNhYg Jr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ONVnWQAVoTuTE9MdUGAPS/9z6gttDBNwQ9Q5Tji/BHU=; b=efCRlcP49yo9mkZh+te0NUwxBnGWyCwJ6wX3zkHjax2dbfgdTeShkzcV7TDjW6SgXJ EUMVfl/jgSdHaasJrWmi+wttGC6ABAJ9oAcmqundJOxt89mXydybIehr22QviooxftsF Jd/UgV+lNeyvL+wdP8iVuHD3ahpxrWWqR9yIqWOQmpoLU+74DSs61Czla/2bV03L9udm o2KpYJfc7RboAEHgPwld26sjzzMEMtwbZyMSU7KiU/ZTjiLc4nkpbQ8/Dp755vPfNW2z OxF96EMOGXvRaWK9zFpuFn2dBIsZwjzWFI2thjUME/7nwUvXkczD+efiZYA/BK41ix0M neng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k22si13845149edr.463.2020.11.03.06.15.16; Tue, 03 Nov 2020 06:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729163AbgKCOPE (ORCPT + 99 others); Tue, 3 Nov 2020 09:15:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:56422 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729663AbgKCONc (ORCPT ); Tue, 3 Nov 2020 09:13:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9A456ABF4; Tue, 3 Nov 2020 14:13:31 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 5DDA61E12FB; Tue, 3 Nov 2020 15:13:31 +0100 (CET) Date: Tue, 3 Nov 2020 15:13:31 +0100 From: Jan Kara To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz Subject: Re: [PATCH 02/10] ext4: mark fc ineligible if inode gets evictied due to mem pressure Message-ID: <20201103141331.GF3440@quack2.suse.cz> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-3-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031200518.4178786-3-harshadshirwadkar@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 31-10-20 13:05:10, Harshad Shirwadkar wrote: > If inode gets evicted due to memory pressure, we have to remove it > from the fast commit list. However, that inode may have uncommitted > changes that fast commits will lose. So, just fall back to full > commits in this case. Also, rename the fast commit ineligiblity reason > from "EXT4_FC_REASON_MEM" to "EXT4_FC_REASON_MEM_CRUNCH" for better > expression. > > Suggested-by: Jan Kara > Signed-off-by: Harshad Shirwadkar ... > diff --git a/fs/ext4/fast_commit.h b/fs/ext4/fast_commit.h > index 06907d485989..cde86747faf8 100644 > --- a/fs/ext4/fast_commit.h > +++ b/fs/ext4/fast_commit.h > @@ -100,7 +100,7 @@ enum { > EXT4_FC_REASON_XATTR = 0, > EXT4_FC_REASON_CROSS_RENAME, > EXT4_FC_REASON_JOURNAL_FLAG_CHANGE, > - EXT4_FC_REASON_MEM, > + EXT4_FC_REASON_MEM_CRUNCH, Well MEM_CRUNCH doesn't really sound more understandable to me :). I'd rather call it MEM_RECLAIM or ENOMEM or something like that... > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index b96a18679a27..52ff71236290 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -327,6 +327,7 @@ void ext4_evict_inode(struct inode *inode) > ext4_xattr_inode_array_free(ea_inode_array); > return; > no_delete: > + ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_MEM_CRUNCH); > ext4_clear_inode(inode); /* We must guarantee clearing of inode... */ > } This will make fs ineligible on every inode reclaim. Even if the inode was clean, not part of any FC. I guess this is too aggressive... Honza -- Jan Kara SUSE Labs, CR