Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp797813lqm; Wed, 1 May 2024 16:45:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcaSN2Ok+Tl3dp5DLKLcwIESzSZto08dnbymtXrjFJgrPDLA64odpsHWewQN0n+lgBKbNT1Ga/Tid/STdoptafaycblrGzYProxCKKPw== X-Google-Smtp-Source: AGHT+IF/kKiCvre+wMw0i3pu+CWR76uHjXcBcTqOV3WIaAOCiFCqRe8VChv/A7lkf1o3tOSUsaKL X-Received: by 2002:a17:902:ce81:b0:1e5:562d:425b with SMTP id f1-20020a170902ce8100b001e5562d425bmr4827049plg.22.1714607141911; Wed, 01 May 2024 16:45:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714607141; cv=pass; d=google.com; s=arc-20160816; b=aN7IsL61T7ImS9u6pEw3L4OAY/kRtXYK5PaAYPLRq9BHxbs+KpQrE9xc9LEwLy0nUQ iVJmDWndWHDvq3KEoq+5OWyZQFzdnW7NXF53nD2n+981Vqxe/bDTIoT4vMEZ1pCzHvhS JUIcrnNeIshLWAcX8e1sygu51AphikRFPZQjPc5/NJ2dvJzG8cSVrsdI1P7OrSLjuVlj EUBkfliPYUyOI5jdTpHn3H8tuVCujat7eXpWjO3Lz8Cp2GcPzW0+6PUspe2NQVgfHMnH UzGmR5m7tKCpmBItw0RVibLv/Bi/I3IAN5vyW8jsuloQR9D2UCtO5MyBxoBcvOcFuyl5 AnZw== 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=Mm8L6FFt9mSB7zIB+Z3XauZIbCGroxiBEBOuM/dDGxU=; fh=YB5XNvbWzxvfwhxcOtmMlxa6dRVDtPSYm/6So/TQNmo=; b=HcT8lzDBHEAIdjH54EU5TCyD1Fj/SEiHN8+Pw9VWUv6Dzl/yGdH/UABi4cclXr0gQ8 3ikrBJ6DB0Y4a0atV8DnkFUBxoLDrImed+SCPPKkavc2JZF+MFtto8uaLKxDc48UKpAq Syz1bjn+JVXAJpQg3tAkBPCKuYFWNicajG5YeRqYIQ3uRUn6OChAmkHu2zVoHQ44//NJ lax1VUckcF/w6k9d3cQtMFTBgm3QIIdlicuQjutLUEmYg6RFAujNTB8L4dnmtVlkc7EB 6A+YaoJ4HSPqW8fQXn7h5V5CQ11dEgol/hASWhVM1GsbipBzCvXvQdfmGicVS5DA21bD U7Kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S3vbD+96; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165859-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165859-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c17-20020a170902d49100b001ead2e6f531si12413637plg.220.2024.05.01.16.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 16:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165859-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S3vbD+96; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165859-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165859-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C7EE82829FD for ; Wed, 1 May 2024 23:45:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1B3816C44F; Wed, 1 May 2024 23:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S3vbD+96" 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 0D39016ABEA; Wed, 1 May 2024 23:45:19 +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=1714607120; cv=none; b=p4fY7CXHnFWcLuzUsdj0d+WQkL1cfnrC7lwISq7dUtDzU3AkyH6Xd8+PcgELcry/QtygutpXJ6xJh58Hxl/DY0+jRLUniILRahsvtBW66xDiKOCJ2dBvuWv1D/KxiikzoGrYm+JDZYngBK4+KQ1WrV2rYNRXE8nq81dswNO7hxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714607120; c=relaxed/simple; bh=JqsnPMx+K0Fb9o3uuuX18tWIg4pXD/BhCsys1itl9Ds=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fOFuNSetxE6Sm9AFGw27MyHtqDBWyitB+NXoZjpUFFm4Dch8fjyofNlYSBSm5eIqlud1KKY2KnIOXy/BxYkKhQ6Vp9kVE2gieXLjIK1CQoQWDdj3naOeLFRfKGAZgf8cPjNiwWVcfJGeqffSX1jNlzcrg2JE4GLxT2TnX3PDzLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S3vbD+96; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8313CC072AA; Wed, 1 May 2024 23:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714607119; bh=JqsnPMx+K0Fb9o3uuuX18tWIg4pXD/BhCsys1itl9Ds=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S3vbD+96i3eyTiifGVE6VmejV/oPGXqx532ALF6Xh/weAd4m/qsVPpkdFNKX+9qpt J9ETkVfp3+juMZXflg+QajMTSmFW/C+a2xvn6l6/sXrSprM8vLpFIfT2Tad+rsNHta rnhaGd5+AVJF0WBU7uPoMkTKibHSOdmkQMkMAcOZEqDeifEp41R5L1wt909qIZT/IB yf4HTde0DJKO2aMdDF94lXs61e0LtIPazmBGTs7F4WR1JzOF7/PJHThjF7Ty1HoKeG Zk1x4JqziNdAz5ED1Tvqc4JRgHjgAN3yHvbFxeWFAmRafqrh87/A64KsKYhPm8VJ06 7VwR+oQDHLzQA== Date: Wed, 1 May 2024 16:45:18 -0700 From: "Darrick J. Wong" To: John Garry Cc: Dave Chinner , hch@lst.de, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, chandan.babu@oracle.com, willy@infradead.org, axboe@kernel.dk, martin.petersen@oracle.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, ojaswin@linux.ibm.com, ritesh.list@gmail.com, mcgrof@kernel.org, p.raghav@samsung.com, linux-xfs@vger.kernel.org, catherine.hoang@oracle.com Subject: Re: [PATCH v3 10/21] xfs: Update xfs_is_falloc_aligned() mask for forcealign Message-ID: <20240501234518.GO360919@frogsfrogsfrogs> References: <20240429174746.2132161-1-john.g.garry@oracle.com> <20240429174746.2132161-11-john.g.garry@oracle.com> <33700d9d-08d3-4fad-8ca4-e6beb3529bcb@oracle.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: <33700d9d-08d3-4fad-8ca4-e6beb3529bcb@oracle.com> On Wed, May 01, 2024 at 11:48:59AM +0100, John Garry wrote: > On 01/05/2024 00:35, Dave Chinner wrote: > > > return !((pos | len) & mask); > > I think this whole function needs to be rewritten so that > > non-power-of-2 extent sizes are supported on both devices properly. > > > > xfs_extlen_t fsbs = 1; > > u64 bytes; > > u32 mod; > > > > if (xfs_inode_has_forcealign(ip)) > > fsbs = ip->i_extsize; > > else if (XFS_IS_REALTIME_INODE(ip)) > > fsbs = mp->m_sb.sb_rextsize; > > > > bytes = XFS_FSB_TO_B(mp, fsbs); > > if (is_power_of_2(fsbs)) > > return !((pos | len) & (bytes - 1)); > > > > div_u64_rem(pos, bytes, &mod); > > if (mod) > > return false; > > div_u64_rem(len, bytes, &mod); > > return mod == 0; > > ok, but I still have a doubt about non-power-of-2 forcealign extsize > support. The trouble is, non-power-of-2 extent size hints are supported for regular and realtime files for funny cases like trying to align allocations to RAID stripes. I think it would be hard to drop support for this, given that means that old filesystems can't ever get upgraded to forcealign. --D > Thanks, > John >