public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* changing stride and stripe_width post-fs-creation?
@ 2009-10-20 17:32 Doug Hunley
  2009-10-20 21:08 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Hunley @ 2009-10-20 17:32 UTC (permalink / raw)
  To: linux-ext4

Is it safe to use tune2fs to alter stride and stripe_width on an ext4
fs once it has been created? Any caveats I should know about? Thanks

-- 
Douglas J Hunley, RHCT
doug.hunley@gmail.com : http://douglasjhunley.com : Twitter: @hunleyd

Obsessively opposed to the typical.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing stride and stripe_width post-fs-creation?
  2009-10-20 17:32 changing stride and stripe_width post-fs-creation? Doug Hunley
@ 2009-10-20 21:08 ` Andreas Dilger
  2009-10-20 21:16   ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2009-10-20 21:08 UTC (permalink / raw)
  To: Doug Hunley; +Cc: linux-ext4

On 20-Oct-09, at 11:32, Doug Hunley wrote:
> Is it safe to use tune2fs to alter stride and stripe_width on an ext4
> fs once it has been created? Any caveats I should know about? Thanks


The stride is mostly used at fs creation time, but there is no problem
with changing it.  The stripe_width is used by the allocator to align
file allocations with the RAID layout.

One question for Eric is whether the new libdisk patches he made will  
set
the stripe_width to something ridiculous like 512 or 4096 bytes, or if  
it
just leaves that field unset in that case.  I suspect it would be bad  
for
mballoc to see the stripe_width be such a small value.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing stride and stripe_width post-fs-creation?
  2009-10-20 21:08 ` Andreas Dilger
@ 2009-10-20 21:16   ` Eric Sandeen
  2009-10-20 21:30     ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-10-20 21:16 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Doug Hunley, linux-ext4

Andreas Dilger wrote:
> On 20-Oct-09, at 11:32, Doug Hunley wrote:
>> Is it safe to use tune2fs to alter stride and stripe_width on an ext4
>> fs once it has been created? Any caveats I should know about? Thanks
> 
> 
> The stride is mostly used at fs creation time, but there is no problem
> with changing it.  The stripe_width is used by the allocator to align
> file allocations with the RAID layout.
> 
> One question for Eric is whether the new libdisk patches he made will set
> the stripe_width to something ridiculous like 512 or 4096 bytes, or if it
> just leaves that field unset in that case.  I suspect it would be bad for
> mballoc to see the stripe_width be such a small value.

well... yes, it does set it to whatever is reported:

+       min_io = blkid_topology_get_minimum_io_size(tp);
+       opt_io = blkid_topology_get_optimal_io_size(tp);
+       blocksize = EXT2_BLOCK_SIZE(fs_param);
+
+       fs_param->s_raid_stride = min_io / blocksize;
+       fs_param->s_raid_stripe_width = opt_io / blocksize;


if mballoc can't handle certain values then maybe the kernel code should 
be changed to ignore it?  Small values could just as easily come from a 
user too ...

-Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing stride and stripe_width post-fs-creation?
  2009-10-20 21:16   ` Eric Sandeen
@ 2009-10-20 21:30     ` Andreas Dilger
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Dilger @ 2009-10-20 21:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Doug Hunley, linux-ext4

On 20-Oct-09, at 15:16, Eric Sandeen wrote:
> Andreas Dilger wrote:
>> The stride is mostly used at fs creation time, but there is no  
>> problem
>> with changing it.  The stripe_width is used by the allocator to align
>> file allocations with the RAID layout.
>> One question for Eric is whether the new libdisk patches he made  
>> will set
>> the stripe_width to something ridiculous like 512 or 4096 bytes, or  
>> if it
>> just leaves that field unset in that case.  I suspect it would be  
>> bad for
>> mballoc to see the stripe_width be such a small value.
>
> well... yes, it does set it to whatever is reported:
>
> +       min_io = blkid_topology_get_minimum_io_size(tp);
> +       opt_io = blkid_topology_get_optimal_io_size(tp);
> +       blocksize = EXT2_BLOCK_SIZE(fs_param);
> +
> +       fs_param->s_raid_stride = min_io / blocksize;
> +       fs_param->s_raid_stripe_width = opt_io / blocksize;
>
>
> if mballoc can't handle certain values then maybe the kernel code  
> should be changed to ignore it?  Small values could just as easily  
> come from a user too

That probably makes the most sense to have the kernel ignore the  
value.  It's
not that it can't "handle" it, just that I suspect mballoc will work  
poorly if
it is trying to align the allocations to 1-block values (i.e. no  
alignment at
all).  Even with regular disks, reading in 64kB-aligned chunks is more  
efficient
than reading misaligned chunks because of the track buffer.

Probably ignoring anything below 64kB makes sense, or possibly using  
some
multiple of the specified size until it is larger than 64kB is better  
(in
case someone formats their RAID-5 with 5 disks * 8kB chunk size or  
similar).

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-20 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20 17:32 changing stride and stripe_width post-fs-creation? Doug Hunley
2009-10-20 21:08 ` Andreas Dilger
2009-10-20 21:16   ` Eric Sandeen
2009-10-20 21:30     ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox