2012-03-15 00:52:36

by Yongqiang Yang

[permalink] [raw]
Subject: [RFC] enable ext4 allocate blocks across group boundary

Hello List,

Here is a proposal to enable ext4 allocate blocks across group boundary.

Now ext4 allocates blocks within a single block group by locking a
group. Flex_bg puts metadata blocks together, as a result,it
enlarges contiguous blocks. So we can enable ext4 allocate blocks
within a flex block group. Inode allocation takes group lock as block
allocation, I am not sure if we should allocate inode within single
group as before.

If we do this, then the new group boundary will be flex block group
boundary. I am not sure if it is worth doing.


Any ideas?

--
Best Wishes
Yongqiang Yang


2012-03-15 02:33:48

by Andreas Dilger

[permalink] [raw]
Subject: Re: [RFC] enable ext4 allocate blocks across group boundary

On 2012-03-14, at 6:52 PM, Yongqiang Yang wrote:
> Here is a proposal to enable ext4 allocate blocks across group boundary.
>
> Now ext4 allocates blocks within a single block group by locking a
> group. Flex_bg puts metadata blocks together, as a result,it
> enlarges contiguous blocks. So we can enable ext4 allocate blocks
> within a flex block group. Inode allocation takes group lock as block
> allocation, I am not sure if we should allocate inode within single
> group as before.
>
> If we do this, then the new group boundary will be flex block group
> boundary. I am not sure if it is worth doing.

The maximum extent size is the same as a single block group, so there
is relatively little value in doing this, IMHO.

Cheers, Andreas






2012-03-15 02:36:25

by Robin Dong

[permalink] [raw]
Subject: Re: [RFC] enable ext4 allocate blocks across group boundary

?? 2012??3??15?? ????8:52??Yongqiang Yang <[email protected]> д????
> Hello List,
>
> Here is a proposal to enable ext4 allocate blocks across group boundary.
>
> Now ext4 allocates blocks within a single block group by locking a
> group. Flex_bg puts metadata blocks together, as a result,it
> enlarges contiguous blocks. So we can enable ext4 allocate blocks
> within a flex block group. Inode allocation takes group lock as block
> allocation, I am not sure if we should allocate inode within single
> group as before.
>
> If we do this, then the new group boundary will be flex block group
> boundary. I am not sure if it is worth doing.

IMO, since the max size of one ext4-extent is just 128MB, maybe a
contiguous space
beyond a single block group can not be used efficiently.

>
>
> Any ideas?
>
> --
> Best Wishes
> Yongqiang Yang
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
--
Best Regard
Robin Dong

2012-03-15 02:49:20

by Yongqiang Yang

[permalink] [raw]
Subject: Re: [RFC] enable ext4 allocate blocks across group boundary

On Thu, Mar 15, 2012 at 10:34 AM, Andreas Dilger <[email protected]> wrote:
> On 2012-03-14, at 6:52 PM, Yongqiang Yang wrote:
>> Here is a proposal to enable ext4 allocate blocks across group boundary.
>>
>> Now ext4 allocates blocks within a single block group by locking a
>> group. ? Flex_bg puts metadata blocks together, as a result,it
>> enlarges contiguous blocks. ?So we can enable ext4 allocate blocks
>> within a flex block group. Inode allocation takes group lock as block
>> allocation, ?I am not sure if we should allocate inode within single
>> group as before.
>>
>> If we do this, then the new group boundary will be flex block group
>> boundary. ?I am not sure if it is worth doing.
>
> The maximum extent size is the same as a single block group, so there
> is relatively little value in doing this, IMHO.
nope. The value comes from 2 aspects: 1. the preallocation can
preallocate much more space , 2. if tail blocks of a group and head
blocks of the next group is free, then they can be treated as
contiguous blocks.

I had a rough look at the code, current code does not handle the situation.

Yongqiang.
>
> Cheers, Andreas
>
>
>
>
>



--
Best Wishes
Yongqiang Yang

2012-03-15 02:57:50

by Yongqiang Yang

[permalink] [raw]
Subject: Re: [RFC] enable ext4 allocate blocks across group boundary

2012/3/15 Robin Dong <[email protected]>:
> ?? 2012??3??15?? ????8:52??Yongqiang Yang <[email protected]> д????
>> Hello List,
>>
>> Here is a proposal to enable ext4 allocate blocks across group boundary.
>>
>> Now ext4 allocates blocks within a single block group by locking a
>> group. Flex_bg puts metadata blocks together, as a result,it
>> enlarges contiguous blocks. So we can enable ext4 allocate blocks
>> within a flex block group. Inode allocation takes group lock as block
>> allocation, I am not sure if we should allocate inode within single
>> group as before.
>>
>> If we do this, then the new group boundary will be flex block group
>> boundary. I am not sure if it is worth doing.
>
> IMO, since the max size of one ext4-extent is just 128MB, maybe a
> contiguous space
> beyond a single block group can not be used efficiently.
I do not think maximum of extent size limits the value of block
allocation across group boundary.

Actually, maximum of contiguous blocks is determined by block
allocation strategy(multi block allocation, preallocation, group
selection ...) rather than others. Given that ext4 is indirect
mapped and uses current block allocation strategy, contiguous blocks
is still same.

Yongqiang.
>
>>
>>
>> Any ideas?
>>
>> --
>> Best Wishes
>> Yongqiang Yang
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> --
> Best Regard
> Robin Dong



--
Best Wishes
Yongqiang Yang

2012-03-15 04:15:22

by Yongqiang Yang

[permalink] [raw]
Subject: Re: [RFC] enable ext4 allocate blocks across group boundary

On Thu, Mar 15, 2012 at 10:49 AM, Yongqiang Yang <[email protected]> wrote:
> On Thu, Mar 15, 2012 at 10:34 AM, Andreas Dilger <[email protected]> wrote:
>> On 2012-03-14, at 6:52 PM, Yongqiang Yang wrote:
>>> Here is a proposal to enable ext4 allocate blocks across group boundary.
>>>
>>> Now ext4 allocates blocks within a single block group by locking a
>>> group. ? Flex_bg puts metadata blocks together, as a result,it
>>> enlarges contiguous blocks. ?So we can enable ext4 allocate blocks
>>> within a flex block group. Inode allocation takes group lock as block
>>> allocation, ?I am not sure if we should allocate inode within single
>>> group as before.
>>>
>>> If we do this, then the new group boundary will be flex block group
>>> boundary. ?I am not sure if it is worth doing.
>>
>> The maximum extent size is the same as a single block group, so there
>> is relatively little value in doing this, IMHO.
> nope. ?The value comes from 2 aspects: 1. the preallocation can
> preallocate much more space , 2. if ?tail blocks of a group and head
> blocks of the next group is free, then they can be treated as
> contiguous blocks.
Here I meant they can be seen in buddy allocator.

Yongqiang.
>
> ?I had a rough look at the code, current code does not handle the situation.
>
> Yongqiang.
>>
>> Cheers, Andreas
>>
>>
>>
>>
>>
>
>
>
> --
> Best Wishes
> Yongqiang Yang



--
Best Wishes
Yongqiang Yang