lkml.org 
[lkml]   [2024]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 07/21] fs: xfs: align args->minlen for forced allocation alignment
From
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.


\
 
 \ /
  Last update: 2024-06-07 08:05    [W:0.066 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site