[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <98828510-8eab-4a82-872c-6643bef06da3@oracle.com>
Date: Fri, 7 Jun 2024 07:04:41 +0100
From: John Garry <john.g.garry@...cle.com>
To: Dave Chinner <david@...morbit.com>
Cc: djwong@...nel.org, hch@....de, viro@...iv.linux.org.uk, brauner@...nel.org,
jack@...e.cz, chandan.babu@...cle.com, willy@...radead.org,
axboe@...nel.dk, martin.petersen@...cle.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
tytso@....edu, jbongio@...gle.com, ojaswin@...ux.ibm.com,
ritesh.list@...il.com, mcgrof@...nel.org, p.raghav@...sung.com,
linux-xfs@...r.kernel.org, catherine.hoang@...cle.com,
Dave Chinner <dchinner@...hat.com>
Subject: Re: [PATCH v3 07/21] fs: xfs: align args->minlen for forced
allocation alignment
On 06/06/2024 17:22, John Garry wrote:
>
>> i.e. why didn't it round the start offset down to 48?
>> Answering that question will tell you where the bug is.
>
> After xfs_bmap_compute_alignments() -> xfs_bmap_extsize_align(),
> ap->offset=48 - that seems ok.
>
> Maybe the problem is in xfs_bmap_process_allocated_extent(). For the
> problematic case when calling that function:
>
> args->fsbno=7840 args->len=16 ap->offset=48 orig_offset=56 orig_length=24
>
> So, as the comment reads there, we could not satisfy the original length
> request, so we move up the position of the extent.
>
> I assume that we just don't want to do that for forcealign, correct?
>
JFYI, after making this following change, my stress test ran overnight:
@@ -3506,13 +3513,15 @@ xfs_bmap_process_allocated_extent(
* very fragmented so we're unlikely to be able to satisfy the
* hints anyway.
*/
+ if (!xfs_inode_has_forcealign(ap->ip)) {
if (ap->length <= orig_length)
ap->offset = orig_offset;
else if (ap->offset + ap->length < orig_offset + orig_length)
ap->offset = orig_offset + orig_length - ap->length;
-
+ }
+
>>
>> Of course, if the allocation start is rounded down to 48, then
>> the length should be rounded up to 32 to cover the entire range we
>> are writing new data to.
Powered by blists - more mailing lists