Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1702307rdb; Mon, 2 Oct 2023 20:00:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1JmThwl0jT1DYjDHyJU0iF3Xb47iASQSF/A6+P6vdqMW+nj7vzp3qrbNspTFB2k7y8sJx X-Received: by 2002:a17:902:ec91:b0:1c3:9bce:817 with SMTP id x17-20020a170902ec9100b001c39bce0817mr12677459plg.3.1696302050975; Mon, 02 Oct 2023 20:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696302050; cv=none; d=google.com; s=arc-20160816; b=EcKvr9uJsLBTx7wvGWnIiZ3j+QpqZjCtL85DbQc5/flEZvkA9lJpu22I0y7sA+2V4q qw7pEXKlPU7sW7Qu8u7xbEV/zVVz58WmyWpJ2+9tPrrslNetuXVQ+HRU5lwZnjtRXkii iRDPSz9RWdGrZvPtkAo7BpYHuFqPtPkB/xEsxyA8JeoFEQVenAE6tDOC1ucJRFOVjpWe J6cgH8u/UYzd/kdzXc26V/oDxhtBTvEnVmjnmVtHQTAlr7Q2H4qKMSGhgQk3nfb66aKf 55aiDnNFa9fd18rbQqzbGr352n+pjbLNx6YXvew6Ufd/iL5FwCcg7YzMTlB2BtDcI/iS j0DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ooj5opOVHIwgURbYHsqEuHjzPOZm9+/sqc6i3NhKBcw=; fh=m09aiYd+XB84D8HTs2+v6ZerlEOS3akXq5JpeK52MS4=; b=DneemnclD2KifGjqAlvps1YuXLHtBVl0yb5bWkIS3QWh/YhsfqoQXoNd3Lrxzw4YXJ jPqIfeGOArYr6guw9TrY/M0kj67KrGtn4QhEOq3pkG5yfie3B3MGYs3yw9tBYt/7oJuL r95Ut/T0SlM6n4eYte8O7dS3VHEuSHsFP2MFWxUjrzc/tFB5d62vQN9CM0Pz9d0ia02F AfdOgBf9N+xyCPxB/h2jzOfO/68gEM93azqHx8OvVJxhfv6tiWtcVAVTOSrlUr6EbsG1 aEeX5uCmnxMlJOy+lTYHh8GhMRngia6/RsxQrT7+V6Qj+VoW43uhXGhY8KhTAY07OAhP 3XKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DmJCYlni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id lh11-20020a170903290b00b001c74d1da69csi373663plb.362.2023.10.02.20.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DmJCYlni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4AA168037AA2; Mon, 2 Oct 2023 20:00:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbjJCDAP (ORCPT + 99 others); Mon, 2 Oct 2023 23:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjJCDAP (ORCPT ); Mon, 2 Oct 2023 23:00:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08258AC; Mon, 2 Oct 2023 20:00:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F59DC433C8; Tue, 3 Oct 2023 03:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696302011; bh=6G/ueFuWEcQKsuh5W2JpGGX6FBNexvvd8Q/l4pQONpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DmJCYlni//qtXa3x5SP4sdoXhy9qmyQDPjVd3ebmxA+B4S9VST1efkK0rr/t+Oacz tAoY/Qma7ocW7DcbYlr5p24LZKBAekgEWj50hV9UBZ8IpXEJkYY3R7UM9EiFib36XM az/ES8zcAkj8lhqtUuJ3lXp9XaDdigowNFxcgfEETJmTvjj7Uv27TTTYhTKdrvessb sfxlxGWrcaXrGG+RoHKR7eJEMgi/j/VqRh/5QFGXJMuErowsTaKXyDaJYONyFdCQ6i j7Khz/yMEwyhtjr9riThwbcESL7OmpqTmkrHfHOlGdpz7zDX4uwkFpKnIM/V1C1Ah+ FqqNI6nnb/Ypg== Date: Mon, 2 Oct 2023 20:00:10 -0700 From: "Darrick J. Wong" To: Dave Chinner Cc: John Garry , axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org Subject: Re: [PATCH 11/21] fs: xfs: Don't use low-space allocator for alignment > 1 Message-ID: <20231003030010.GE21298@frogsfrogsfrogs> References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-12-john.g.garry@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:00:38 -0700 (PDT) On Tue, Oct 03, 2023 at 12:16:26PM +1100, Dave Chinner wrote: > On Fri, Sep 29, 2023 at 10:27:16AM +0000, John Garry wrote: > > The low-space allocator doesn't honour the alignment requirement, so don't > > attempt to even use it (when we have an alignment requirement). > > > > Signed-off-by: John Garry > > --- > > fs/xfs/libxfs/xfs_bmap.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > > index 30c931b38853..328134c22104 100644 > > --- a/fs/xfs/libxfs/xfs_bmap.c > > +++ b/fs/xfs/libxfs/xfs_bmap.c > > @@ -3569,6 +3569,10 @@ xfs_bmap_btalloc_low_space( > > { > > int error; > > > > + /* The allocator doesn't honour args->alignment */ > > + if (args->alignment > 1) > > + return 0; > > + > > How does this happen? > > The earlier failing aligned allocations will clear alignment before > we get here.... I was thinking the predicate should be xfs_inode_force_align(ip) to save me/us from thinking about all the other weird ways args->alignment could end up 1. /* forced-alignment means we don't use low mode */ if (xfs_inode_force_align(ip)) return -ENOSPC; --D > -Dave. > -- > Dave Chinner > david@fromorbit.com