Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp476094lqh; Fri, 31 May 2024 07:12:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUK7IoClCnaZkAG+wlWZ0PeFW38ilMKo1pP55/fYpkV9COlFZyuNae0w9OVY2+4CYn17HHMbpjQFfCgS1QBJioaHkXrVIaOAXpPVWUC3w== X-Google-Smtp-Source: AGHT+IFcu6nRXWOzxOKzvBBjYuINnksHIcAfKIhWjlCO/WJ/Bj7yarbuXmx8GzQDS6hbQHCKhjBZ X-Received: by 2002:a05:6359:d15:b0:194:801b:151d with SMTP id e5c5f4694b2df-19b48adabb4mr188814355d.7.1717164742914; Fri, 31 May 2024 07:12:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717164742; cv=pass; d=google.com; s=arc-20160816; b=c0sj2VZzCvDpbYFTD16jTmeTUsfCqAdXpw/X4dBUl/JxAEMbDULh6t4fDL5iQbriwT /PjF/AqYSU28OWeT0+EygsktOesdasI7pmkZLSriQ6m7gq0fh8WR64CKcXwDNSZxOndR 9xFjfcCaiNZPEYvuc3pjM8PUYmttM9+xZwZ7uUwsHJkePBbVHvTp5nt0csyIx+8mQD2N Sfu0M4KfmhV6W/8E4AUeXNLwV84RPLrX1cf8BRbjYy0PKOFHcv2N4Q8sh9/aZkKGHTKu Crp9DmwPVIFnIiC9fOv61v9POM89rcJLAbgCwhstG9srMZkoV8M/SNYLwaJ1BZnKylLQ 576g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kJhacJUqVWvRrJaYwadWN3pbhymDS3Ize8VzGsCOBFI=; fh=/+oJP8T5Dkpuf5Cn3AdmJIb4b6f4Vsc2mL9mQYxwkNg=; b=qgiHSeYlKAQE1mbH012Wzp/IMbMp1cA9W3ighygiyQu22swf7d0y9EH4vOpVDBwLUY IhlFu73zCjSDIvhIhMmKp4Ya1coyck3F8jYZabGVzgzmXj4utQmJGUix2mPWL1ed5x+E 9aVZsw1a4OtWW4Bh3PJaeGCw34uMia/Puhwj0SQHmJ0aSod6jhJUziuUZ2UxaJNwCZCv oRhb4DdL1/tpSAj2wvm2DUzlH8fBndpo6UJuk889NYc2aWU+PlGxBPPUnU1UIqPDZlgC VR2gfCIQgIbCVl8bQmttQ3Y32mqd3ZDfE/MROSFOGrRxZ8tZMAMswJfgSrFW5+KAql9/ 0G+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ipt8Aw2T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f2f04e96si232393185a.56.2024.05.31.07.12.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ipt8Aw2T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 84A671C24843 for ; Fri, 31 May 2024 14:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 956A215D5A0; Fri, 31 May 2024 14:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ipt8Aw2T" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B98731E51E; Fri, 31 May 2024 14:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717164731; cv=none; b=feOQy+AYUXfyxKp2C7BjBEG9F242geWjklfi5mQYVQZyGiT0xBIJ+j82hX7y+9yApXpYUi5CJHNVuhFT6A6kUWCDAC3ipSght6zBdknbV1BgpcyN+UGXXjM6uV6vRg5C37UTAp0FyiKrMPJO2Rz6DwnXwWnt19chPQTa6k+byxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717164731; c=relaxed/simple; bh=ltHQlzja/oVvYD/+bUKbl1gFLeTZuZ0V+xk4C4XpYsY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FyqHwdBN63YXg+jbg3UzRDAHJcptL/Tr9+5LpvdMzekkb1yRj2ec5ADmNdKowpD7v39AQjdM67GEZ+nMk7Yn0Kszl2MWHhHEqVNmZo3f2rzv9daQM4JBKIHMWnb9zwdCZpYsH+iEHbOCjvR/FMOGxS497AqqhVD4+tLHro5r8Ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ipt8Aw2T; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56106C116B1; Fri, 31 May 2024 14:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717164731; bh=ltHQlzja/oVvYD/+bUKbl1gFLeTZuZ0V+xk4C4XpYsY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ipt8Aw2TzmRuDmdOoYNqsQiFNcBXqqFslWMSSzSYtO9O4I3VaKYWQ+xnCFBvjzFHr C6G6QYYd3MsrqsAhElhOiAcShArkFaeG1I15kY2wQ5n86i7UIgKb/n2Jiv8jH9VFsk vZzrtjtmtHJvGBUAN+96TQeZQ3Aff5ltpFUR0a8BkN0AawQ1NoXXQuFjSO3TLNfIQu dFi+Y4EtUQxLIZ/tDW10QnAMeu1nHDh7UYuD2vjfAglRi1pXi67SGvnoKAq2M5hfok Sgo1RiLAThJUSAolfcLILS88aQ9KiqhoDHNRv6N/0UC6+mmxF7o6/e8Fd42zvmS7Pf jmelPNTJt6XfQ== Date: Fri, 31 May 2024 07:12:10 -0700 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Zhang Yi , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, jack@suse.cz, willy@infradead.org, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [RFC PATCH v4 8/8] xfs: improve truncate on a realtime inode with huge extsize Message-ID: <20240531141210.GI52987@frogsfrogsfrogs> References: <20240529095206.2568162-1-yi.zhang@huaweicloud.com> <20240529095206.2568162-9-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 31, 2024 at 06:46:10AM -0700, Christoph Hellwig wrote: > > +/* > > + * Decide if this file is a realtime file whose data allocation unit is larger > > + * than default. > > + */ > > +static inline bool xfs_inode_has_hugertalloc(struct xfs_inode *ip) > > +{ > > + struct xfs_mount *mp = ip->i_mount; > > + > > + return XFS_IS_REALTIME_INODE(ip) && > > + mp->m_sb.sb_rextsize > XFS_B_TO_FSB(mp, XFS_DFL_RTEXTSIZE); > > +} > > The default rtextsize is actually a single FSB unless we're on a striped > volume in which case it is increased. > > I'll take care of removing the unused and confusing XFS_DFL_RTEXTSIZE, > but for this patch we'd need to know the trade-off of when to just > convert to unwritten. For single-fsb rtextents we obviously don't need > any special action. But do you see a slowdown when converting to > unwritten for small > 1 rtextsizes? Because if not we could just > always use that code path, which would significantly simplify things > and remove yet another different to test code path. There are some users that want 1G extents. For the rest of us who don't live in the stratosphere, it's convenient for fsdax to have rt extents that match the PMD size, which could be large on arm64 (e.g. 512M, or two smr sectors). --D