* EXT4 data block allocation alignment
@ 2014-06-11 11:44 Teng-Feng Yang
2014-06-11 13:03 ` Lukáš Czerner
2014-06-11 17:58 ` Andreas Dilger
0 siblings, 2 replies; 3+ messages in thread
From: Teng-Feng Yang @ 2014-06-11 11:44 UTC (permalink / raw)
To: linux-ext4
Hi, folks,
Recently I have been working on a small project which requires data
blocks of each file to be aligned to 512KB/1MB boundary for
performance reason. As far as I know, this can be accomplished by
setting the stripe unit on XFS or enabling the "bigalloc" feature on
EXT4. However, the "bigalloc" feature has not yet been stated to be
stable in the latest release. So, this makes me wondering if I can
achieve this block allocation alignment by setting the stride-size on
EXT4. The document of mke2fs only says that this value may be used by
the block allocator, so I am not quite sure what it can offer for me
in this case.
Any help would be appreciated.
Thanks,
Dennis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: EXT4 data block allocation alignment
2014-06-11 11:44 EXT4 data block allocation alignment Teng-Feng Yang
@ 2014-06-11 13:03 ` Lukáš Czerner
2014-06-11 17:58 ` Andreas Dilger
1 sibling, 0 replies; 3+ messages in thread
From: Lukáš Czerner @ 2014-06-11 13:03 UTC (permalink / raw)
To: Teng-Feng Yang; +Cc: linux-ext4
On Wed, 11 Jun 2014, Teng-Feng Yang wrote:
> Date: Wed, 11 Jun 2014 19:44:49 +0800
> From: Teng-Feng Yang <shinrairis@gmail.com>
> To: linux-ext4@vger.kernel.org
> Subject: EXT4 data block allocation alignment
>
> Hi, folks,
>
> Recently I have been working on a small project which requires data
> blocks of each file to be aligned to 512KB/1MB boundary for
> performance reason. As far as I know, this can be accomplished by
> setting the stripe unit on XFS or enabling the "bigalloc" feature on
> EXT4. However, the "bigalloc" feature has not yet been stated to be
> stable in the latest release. So, this makes me wondering if I can
> achieve this block allocation alignment by setting the stride-size on
> EXT4. The document of mke2fs only says that this value may be used by
> the block allocator, so I am not quite sure what it can offer for me
> in this case.
Even though bigalloc will work like that it's just nice side effect
of that feature. But, yes it should work.
However please see mke2fs manual page. Ext4 also have options to
make allocations aligned (stride, stripe_width).
There is also "stripe" mount option, but you should not need to set
that it you set it on mkfs time.
Thanks!
-Lukas
>
> Any help would be appreciated.
> Thanks,
>
> Dennis
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: EXT4 data block allocation alignment
2014-06-11 11:44 EXT4 data block allocation alignment Teng-Feng Yang
2014-06-11 13:03 ` Lukáš Czerner
@ 2014-06-11 17:58 ` Andreas Dilger
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Dilger @ 2014-06-11 17:58 UTC (permalink / raw)
To: Teng-Feng Yang; +Cc: linux-ext4
[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]
On Jun 11, 2014, at 5:44 AM, Teng-Feng Yang <shinrairis@gmail.com> wrote:
> Recently I have been working on a small project which requires data
> blocks of each file to be aligned to 512KB/1MB boundary for
> performance reason. As far as I know, this can be accomplished by
> setting the stripe unit on XFS or enabling the "bigalloc" feature on
> EXT4. However, the "bigalloc" feature has not yet been stated to be
> stable in the latest release. So, this makes me wondering if I can
> achieve this block allocation alignment by setting the stride-size on
> EXT4. The document of mke2fs only says that this value may be used by
> the block allocator, so I am not quite sure what it can offer for me
> in this case.
In fact, 1MB alignment is already the default behaviour for ext4
extent-mapped allocations, though it isn't enforced for small files.
It is possible to specify the alignment with "-E stripe_width={blocks}"
(blocks=256 for 1MB and =128 for 512KB, assuming 4KB blocksize).
It might be possible to implement this alignment as required instead
of optional for data blocks, but that would need a change to the code.
It would still be more space efficient than bigalloc, since bigalloc
will allocate a full 512KB for each metadata block or directory.
Cheers, Andreas
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-11 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11 11:44 EXT4 data block allocation alignment Teng-Feng Yang
2014-06-11 13:03 ` Lukáš Czerner
2014-06-11 17:58 ` Andreas Dilger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox