From: John Garry <john.g.garry@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>,
Christoph Hellwig <hch@infradead.org>
Cc: brauner@kernel.org, cem@kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
ojaswin@linux.ibm.com, ritesh.list@gmail.com,
martin.petersen@oracle.com
Subject: Re: [PATCH v5 09/10] xfs: Allow block allocator to take an alignment hint
Date: Wed, 12 Mar 2025 16:28:28 +0000 [thread overview]
Message-ID: <74d22f33-83c8-40b2-a8c7-a034f5970669@oracle.com> (raw)
In-Reply-To: <20250312160027.GY2803749@frogsfrogsfrogs>
On 12/03/2025 16:00, Darrick J. Wong wrote:
> On Wed, Mar 12, 2025 at 06:45:12AM -0700, Christoph Hellwig wrote:
>> On Wed, Mar 12, 2025 at 08:05:14AM +0000, John Garry wrote:
>>>> Shouldn't we be doing this by default for any extent size hint
>>>> based allocations?
>>>
>>> I'm not sure.
>>>
>>> I think that currently users just expect extszhint to hint at the
>>> granularity only.
>
> Yes, the current behavior is that extszhint only affects the granularity
> of the file range that's passed into the allocator. To align the actual
> space, you have to set the raid stripe parameters.
>
> I can see how that sorta made sense in the old days -- the fs could get
> moved between raid arrays (or the raid array gets reconfigured), so you
> want the actual allocations to be aligned to whatever the current
> hardware config advertises. The extent size hint is merely a means to
> amortize the cost of allocation/second-guess the delalloc machinery.
>
>>> Maybe users don't require alignment and adding an alignment requirement just
>>> leads to more fragmentation.
>>
>> But does it? Once an extsize hint is set I'd expect that we keep
>> getting more allocation with it. And keeping the aligned is the concept
>> of a buddy allocator which reduces fragmentation. Because of that I
>> wonder why we aren't doing that by default.
>
> Histerical raisins?
>
> We /could/ let extszhint influence allocation alignment by default, but
> then anyone who had (say) a 8k hint on a 32k raid stripe might be
> surprised when the allocator behavior changes.
>
> What do you say about logic like this?
>
> if (software_atomic) {
> /*
> * align things so we can use hw atomic on the next
> * overwrite, no matter what hw says
> */
> args->alignment = ip->i_extsize;
> } else if (raid_stripe) {> /* otherwise try to align for better
raid performance */
> args->alignment = mp->m_dalign;
> } else if (ip->i_extsize) {
> /* if no raid, align to the hint provided */
> args->alignment = ip->i_extsize;
> } else {
> args->alignment = 1;
> }
>
> Hm? (I'm probably forgetting something...)
>
note that for forcealign support, there was a prep patch to do something
similar to this:
https://lore.kernel.org/linux-xfs/20240429174746.2132161-5-john.g.garry@oracle.com/
> --D
next prev parent reply other threads:[~2025-03-12 16:29 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 18:39 [PATCH v5 00/10] large atomic writes for xfs with CoW John Garry
2025-03-10 18:39 ` [PATCH v5 01/10] xfs: Pass flags to xfs_reflink_allocate_cow() John Garry
2025-03-12 7:15 ` Christoph Hellwig
2025-03-12 8:19 ` John Garry
2025-03-10 18:39 ` [PATCH v5 02/10] xfs: Switch atomic write size check in xfs_file_write_iter() John Garry
2025-03-12 7:17 ` Christoph Hellwig
2025-03-12 8:21 ` John Garry
2025-03-10 18:39 ` [PATCH v5 03/10] xfs: Refactor xfs_reflink_end_cow_extent() John Garry
2025-03-12 7:24 ` Christoph Hellwig
2025-03-12 8:27 ` John Garry
2025-03-12 8:35 ` Christoph Hellwig
2025-03-12 15:46 ` Darrick J. Wong
2025-03-12 22:06 ` John Garry
2025-03-12 23:22 ` Darrick J. Wong
2025-03-13 1:25 ` Dave Chinner
2025-03-13 4:51 ` Darrick J. Wong
2025-03-13 6:11 ` John Garry
2025-03-18 0:43 ` Dave Chinner
2025-03-13 7:21 ` Dave Chinner
2025-03-22 5:19 ` Darrick J. Wong
2025-03-10 18:39 ` [PATCH v5 04/10] xfs: Reflink CoW-based atomic write support John Garry
2025-03-12 7:27 ` Christoph Hellwig
2025-03-12 9:13 ` John Garry
2025-03-12 13:45 ` Christoph Hellwig
2025-03-12 14:48 ` John Garry
2025-03-10 18:39 ` [PATCH v5 05/10] xfs: Iomap SW-based " John Garry
2025-03-12 7:37 ` Christoph Hellwig
2025-03-12 9:00 ` John Garry
2025-03-12 13:52 ` Christoph Hellwig
2025-03-12 14:57 ` John Garry
2025-03-12 15:55 ` Christoph Hellwig
2025-03-12 16:11 ` John Garry
2025-03-10 18:39 ` [PATCH v5 06/10] xfs: Add xfs_file_dio_write_atomic() John Garry
2025-03-10 18:39 ` [PATCH v5 07/10] xfs: Commit CoW-based atomic writes atomically John Garry
2025-03-12 7:39 ` Christoph Hellwig
2025-03-12 9:04 ` John Garry
2025-03-12 13:54 ` Christoph Hellwig
2025-03-12 15:01 ` John Garry
2025-03-10 18:39 ` [PATCH v5 08/10] xfs: Update atomic write max size John Garry
2025-03-11 14:40 ` Carlos Maiolino
2025-03-12 7:41 ` Christoph Hellwig
2025-03-12 8:09 ` John Garry
2025-03-12 8:13 ` Christoph Hellwig
2025-03-12 8:14 ` John Garry
2025-03-10 18:39 ` [PATCH v5 09/10] xfs: Allow block allocator to take an alignment hint John Garry
2025-03-12 7:42 ` Christoph Hellwig
2025-03-12 8:05 ` John Garry
2025-03-12 13:45 ` Christoph Hellwig
2025-03-12 14:47 ` John Garry
2025-03-12 16:00 ` Darrick J. Wong
2025-03-12 16:28 ` John Garry [this message]
2025-03-10 18:39 ` [PATCH RFC v5 10/10] iomap: Rename ATOMIC flags again John Garry
2025-03-12 7:13 ` Christoph Hellwig
2025-03-12 23:59 ` Dave Chinner
2025-03-13 6:28 ` John Garry
2025-03-13 7:02 ` Christoph Hellwig
2025-03-13 7:41 ` John Garry
2025-03-13 7:49 ` Christoph Hellwig
2025-03-13 7:53 ` John Garry
2025-03-13 8:09 ` Christoph Hellwig
2025-03-13 8:18 ` Christoph Hellwig
2025-03-13 8:24 ` John Garry
2025-03-13 8:28 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=74d22f33-83c8-40b2-a8c7-a034f5970669@oracle.com \
--to=john.g.garry@oracle.com \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).