xfs
[Top] [All Lists]

Re: [PATCH 01/17] xfsprogs: use common code for multi-disk detection

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: [PATCH 01/17] xfsprogs: use common code for multi-disk detection
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Fri, 3 Jul 2015 06:06:06 -0400 (EDT)
Cc: xfs@xxxxxxxxxxx, Dave Chinner <dchinner@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20150702141403.GA61817@xxxxxxxxxxxxxxx>
References: <1434711726-13092-1-git-send-email-jtulak@xxxxxxxxxx> <1434711726-13092-2-git-send-email-jtulak@xxxxxxxxxx> <20150625193748.GE36162@xxxxxxxxxxxxxxx> <413545489.22844725.1435841273912.JavaMail.zimbra@xxxxxxxxxx> <20150702141403.GA61817@xxxxxxxxxxxxxxx>
Thread-index: XEa/ruCK3fMb45NwAlT4vA8Mzw5LZQ==
Thread-topic: xfsprogs: use common code for multi-disk detection

----- Original Message -----
> From: "Brian Foster" <bfoster@xxxxxxxxxx>
> On Thu, Jul 02, 2015 at 08:47:53AM -0400, Jan Tulak wrote:
> >
> > When I look on the code, where did you got the 4 vs 5? In the old code, for
> > 512GB and bigger is assigned shift=5 directly. In the new one, shift is
> > set to XFS_MULTIDISK_AGLOG which is 5, and then, if the disk is smaller
> > than 512GB, it decrements the value. But unless I'm missing something, the
> > multidisk configuration is not changing anything, there is just a
> > different syntax.
> > 
> 
> I was referring to the multidisk case. The old code looks like this:
> 
>         if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) {
>               ...
>         } else if (dblocks > GIGABYTES(512, blocklog))
>                 shift = 5;
>         else if (dblocks > GIGABYTES(8, blocklog))
>                 shift = 4;
> 
> ... which means if multidisk && dblocks == 512GB, then shift is set to
> 4. With the new code, we set XFS_MULTIDISK_AGLOG as you noted and then
> execute:
> 
>       if (dblocks < GIGABYTES(512, blocklog))
>               shift--;
>       ...
> 
> ... which will not decrement shift if dblocks == 512GB (i.e., shift is
> 5).
> 
> If you're still not convinced, create an exact sized 512GB file, mkfs it
> (with the su/sw options set for multidisk) with and without this change
> and observe agcount. :)
> 
> Brian
> 

Ah, mea culpa, I didn't thought about what happens when the size is exactly 512 
GB when I wrote the reply. :-) You are right, I'll fix it.

Jan

-- 
Jan Tulak
jtulak@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>