Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp607264lqh; Fri, 31 May 2024 10:33:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/OW0ZF350I/GXR7EuhgfAI7CmOcnFmVfpStA633Ij8isPY5o9+F/BHvkG4AJGu6j19orZr5lByJuAVHN1wH94sWh9xuNRyWoDVuU3Ig== X-Google-Smtp-Source: AGHT+IFbsu01pCbh8ViJN0aUWPsmcL85FTj0EASGI4ctKoD7Ql46klN4L1/ibowsZfVEAytmwdHj X-Received: by 2002:a05:620a:2151:b0:792:bb79:8c8d with SMTP id af79cd13be357-794f5ee0b17mr252526485a.66.1717176829984; Fri, 31 May 2024 10:33:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717176829; cv=pass; d=google.com; s=arc-20160816; b=fewZrSgaCv9Ah1iv8rr8n01BwGcVS4E0O7v3ugrSbAEYMMrW+IdRL9Hpt+5SiPXKu3 cxhk3yWcWTd5yVVghZotdXwgClXAu5tgTJaElvefKQhzm8ycClFVtmrF6CsEQDDsm75O pCyKQb3i6m5Ka0myYIGmqdxTbRs8s0HMbHKbY2hyrInE090CpfT+lWuav9Sxaa/fktLL UdSV08li28+OKh+kbUiurGhlExkyq1YTP0TZslc7xUOYZcg8EPBpXPKaNmBKlrCC8MK6 B2HCSeL5zG4OsRzUACJ11CahU9hc3m2qOULA0pfNRKU3OGv8jQeHj2xuQbXQMAbx4KGt nBjA== 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=T0o85Dh6Rf+KB5Efb2D+maZs/SPUfL+PFS9preD6H9k=; fh=sPKrtYcvfYrx0SMCKkPItgREgastrob9cURc2UNAf8I=; b=ohuPdLgVbVdMgBXGCVkVv2IUdEMK8rbqQ7Rd8tJbGkuWeOSu/Q7ajKnH0n+h+UGkUG MSvBwb6OdXsURFqBSGGC6tAgMsQl+8i72RsE8S6XxloYrijEJKkSs+d1VO8b2bFsknTM +t47teVzpT3pV0E+xpc1GDHBRkAzRt2TdDjn7ImPJmKh0rMuC+yH86LovcTkRok/8v7p BZtDhar71bDh2zTej3CPqC4pAEpFKQqq675Sdfuhlx6eCPu+/Mw/nSvI9qvz6C3qPaKp ONmXlMZPKKPd0FqvbAvC4aFxFFc7p93OKJ5dfNuFq3xHT28Lcr8kUGs4YnZyE4BrvVa+ CKpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=my6Ym7N5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196908-linux.lists.archive=gmail.com@vger.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-794f2f173e5si271990085a.190.2024.05.31.10.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 10:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196908-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=@infradead.org header.s=bombadil.20210309 header.b=my6Ym7N5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196908-linux.lists.archive=gmail.com@vger.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 EE2621C2660A for ; Fri, 31 May 2024 13:46:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9E0915B578; Fri, 31 May 2024 13:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="my6Ym7N5" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8D2D5158D94; Fri, 31 May 2024 13:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717163174; cv=none; b=B0xy9t76AfZv2mo9NHrIEjFI24aXU3d58hLE/OCS0mB17XtQbCNsY1NZn8xcernfiAdbrt2ZefeEhoL9cjQA+SPIDyPojgtoCBebIToWn/XdwBxLkg33nptZT5UhEKwKBl2LKjjQpSN1o4zzTOnJy0OGC44bgaW/k81MWIQCLLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717163174; c=relaxed/simple; bh=/LONncp3AO+tmHozqvhG1bzguZyRoNp3DcO5tp/CUxU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rgmxwC0sB0SQ4Zd2Agrov4xW00wP2YDbCpEzIJ3mLTctT5GAAvnaFlDZdPDrojc59gFkFUPmzidPoGyYR5QuDnd6et7vz4Kge992ebGwvKNF1KXq0G080xoIzflidHUYmnqfGDGOqqxGEGeJRXG52sYI8Li867epCo9QJkRWoXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=my6Ym7N5; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=T0o85Dh6Rf+KB5Efb2D+maZs/SPUfL+PFS9preD6H9k=; b=my6Ym7N5mT5q5HFeIxdeZEM4FJ /ipgy1rFUaARDe+xigX/P2IyDdk9ZtNrPhNC1YWFivCv0lcwPPBK23PSJMZfU+AP1Dt6xheE2m4OR s3Xi7MmsYtciHW5wREALG5lyM7uIrSGp34HmDESqTlg+LoXjFGUPRbhx2xeS/TEIVDNq8XpZk4dgS gZXpV16iu8UeS6ADCb3fN89KY5XKMaURL37u4en/I4co+5jEFbRC1X3k1z8yji/Fgb8pE3Ku1ieOp +vXDUmLjZ05tVGvNeNOwNWcV3gxHX9gwKaJ007z9dyhStCOpMjEhIq6eDw76EPVnEGW+qwLs8Tksl IGppF6+w==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD2aA-0000000AOUG-3RUm; Fri, 31 May 2024 13:46:11 +0000 Date: Fri, 31 May 2024 06:46:10 -0700 From: Christoph Hellwig To: Zhang Yi Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.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: 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: <20240529095206.2568162-9-yi.zhang@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html > +/* > + * 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.