Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1730464rdb; Mon, 2 Oct 2023 21:34:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpoa+62UPNfwWI7eeICGwL6in/MMz1KjoeXZmdk8J77YurwqVVqzG8nZxoTDopupes7t+t X-Received: by 2002:a17:902:e80c:b0:1c7:69a1:7524 with SMTP id u12-20020a170902e80c00b001c769a17524mr6261017plg.37.1696307677763; Mon, 02 Oct 2023 21:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696307677; cv=none; d=google.com; s=arc-20160816; b=TEkTu9T61OCI6pavqhWIFBuTSM7j1cIN+uX3smM5OgrRQWvNYj8lFFHh7U5g+DpX3d aRxGkfn1uqp9M0Y5krVGHojkAi9WkL/wEhvweaoRBQz0Ha6DhRr5wxyQMA1Lm1V9Xt7Z 8WCU43eXD5LlyRAiQUBC72MqljDn8tKbY6Hwc+QiZCBASqueXaR5WSuTDhF+TdsoShcT OaHsquAZLfANd0emZqyJh+NF0G2mvTFl7+IZlWd8N9kYqzCBYTUXQ4n8uf+xx7DY0mEK XOjY5/aFFdrOoFpEpOOwpG+Pt6U8L0MDl0XbNNSBLoaxBHAhwXkHAp41x9EJuk6Mg/RS hs7A== 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=+xysvb7UXDgrvMeyvIHjhvvDF8mxwwGkkX/MDtZn8IY=; fh=nY+ILc2cD8WNJrkA8zrzqZgHyZvs2f5Hlqn0YD5pZcA=; b=zbCacW9LuNwsLaHzRX3hJFr++nam4wGhNquxzdGKgdYgXuh2TAXO1QeWeJpxj4A3wU npCOZGE0p/jK3MVUAZrlf/l2xP9R84X7sXw8gZyUHeiXDRRlp+YQq+HNp4oD/X+Lus+f A4N7vLFjzHUqAqvpAPrQzGqgBxgfYxdugLEUbAsVq2CpLxKHk+S4lm31KhS3t0LndNTF BlDXG+Fjkk4b1HRq9Ru6dA2SW0vHuQfje2sm0AZIGEbbzdJPn63woq/h3LVZwfIw/vJA 7KbgiXVIGmabDENM33pPUZBeuIidSm455FG99kjk7QhMcjX/BMCEU+IFu+IK3DKjdZpZ ZgOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=S7JEE00g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e4-20020a170902cf4400b001c470c5906bsi540139plg.221.2023.10.02.21.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:34:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=S7JEE00g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 73865801CB71; Mon, 2 Oct 2023 21:34:35 -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 S230371AbjJCEe0 (ORCPT + 99 others); Tue, 3 Oct 2023 00:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230152AbjJCEeY (ORCPT ); Tue, 3 Oct 2023 00:34:24 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B377A4 for ; Mon, 2 Oct 2023 21:34:22 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1c724577e1fso3780115ad.0 for ; Mon, 02 Oct 2023 21:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1696307661; x=1696912461; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+xysvb7UXDgrvMeyvIHjhvvDF8mxwwGkkX/MDtZn8IY=; b=S7JEE00gjWybiT6QwjW+ygdGd47CBX16/jJy0jro/5PqFdnq6nxZQp1X3w9zE9SQD5 SvPAf2SmmGtGlI/8pPrhTlGceMP69/8Ipa9VwKamFnN+dNtYANjHLLX4C7wOGVaKLGtJ II3OhLEB0onFNn5CEk7Hi7UbTBY08+s/0kbhGX0EqmmemGgvMf8rplt9kC7vhfr7xgGx Q7eH8mGXuMO8fp4mnpCirnehS2L1VVRtIkB9TmmTYO99EoPFPKkte1s9oRRuFEJaiVbW LROhmnTM5kOeTZ1qhdhmKU72BLoytXKjgDCOuTZaUyrjaopILyMza4zScys6tNwv5ybJ 2+jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696307661; x=1696912461; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+xysvb7UXDgrvMeyvIHjhvvDF8mxwwGkkX/MDtZn8IY=; b=ZIcqYIkz5hXNZiVX5XTwzYA8hQOBCdfOm0vtuv8DA1s+qF3KpQ3UWSR034qFaEZHgq pUxObgc2IpFQC9TlqUnCkbqye8zt6k58hVRtDwOW2sxwbKsD+JClJMSwejosv+0aTHIG Oy0vz9OP75XcH5GSPaFqW2E9xxHrREACZJ3jHWK4hksdT1FWJlU2gARQHvdPk2Ns+TJx 9flJZ/GPcLzcakUpvWMgHZVMpWebb9DAeI/Q/Cl658LOhymFL4gHGZH3NQZXBm/ff/Pm CUmmVXbrZyAOTGl+rVF9990suMQnaqVkgauFUmG27zZ/u/20Us5q7d0elJkpj8TNtyFo qFUw== X-Gm-Message-State: AOJu0Yy4U2lYyQTR9KgnNeFIpAYrOus0hyr2imvso+UJd0j4VU3CoLNh 0Assu3ktabkESaHdcrvJQALMgA== X-Received: by 2002:a17:902:9b8e:b0:1c6:845:27c5 with SMTP id y14-20020a1709029b8e00b001c6084527c5mr13417148plp.61.1696307661424; Mon, 02 Oct 2023 21:34:21 -0700 (PDT) Received: from dread.disaster.area (pa49-180-20-59.pa.nsw.optusnet.com.au. [49.180.20.59]) by smtp.gmail.com with ESMTPSA id ji17-20020a170903325100b001c444106bcasm341059plb.46.2023.10.02.21.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:34:20 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qnX6w-008l4e-0d; Tue, 03 Oct 2023 15:34:18 +1100 Date: Tue, 3 Oct 2023 15:34:18 +1100 From: Dave Chinner To: "Darrick J. Wong" 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: References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-12-john.g.garry@oracle.com> <20231003030010.GE21298@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003030010.GE21298@frogsfrogsfrogs> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,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 21:34:35 -0700 (PDT) On Mon, Oct 02, 2023 at 08:00:10PM -0700, Darrick J. Wong wrote: > 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; See the email I just wrote about not needing per-inode on-disk state or even extent size hints for doing allocation for atomic IO. Atomic write unit alignment is a device parameter (similar to stripe unit) that applies to context specific allocation requests - it's not an inode property as such.... Cheers, Dave. -- Dave Chinner david@fromorbit.com