linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Howto tell kernel to use 4096 as granularity & minimum size?
@ 2014-07-20 18:47 Linda A. Walsh
  2014-07-20 22:28 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Linda A. Walsh @ 2014-07-20 18:47 UTC (permalink / raw)
  To: Linux-Kernel

I have a hard disk with a "512e" sector size: emulated 512, really 4096.

The disk returns a 512-byte size to drivers for compatibility.

I can partition the disk and setup the allocation size
to 4096, but I'd like to tell the kernel to use a
virtual-size of 4096 for the sector as an additional
performance 'hint', so nothing will even try to use
smaller i/o's than that.

However, this doesn't seem to work ("# prompt" does mean root):

/sys/block/sdd/queue#   echo 4096 >minimum_io_size    
bash: minimum_io_size: Permission denied

I realize this is probably implemented as a R-O value,
but it there a reason it needs to be if an admin
wants to increase it to a multiple of an emulated
I/O size so as to have it represent the physical
sector size?

I.e. if the "/sys" code was patched to allow modification
of this variable, would it work for the purpose
I am describing (i.e. ignoring emulated 512 size and
using the real 4096 size as a minimum (I wouldn't
intend or want this to affect the sector# addressing,
which would still be done using 512B sector blocks.

Thanks!



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

* Re: Howto tell kernel to use 4096 as granularity & minimum size?
  2014-07-20 18:47 Howto tell kernel to use 4096 as granularity & minimum size? Linda A. Walsh
@ 2014-07-20 22:28 ` Dave Chinner
  2014-07-21 20:45   ` Linda Walsh
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2014-07-20 22:28 UTC (permalink / raw)
  To: Linda A. Walsh; +Cc: Linux-Kernel

On Sun, Jul 20, 2014 at 11:47:06AM -0700, Linda A. Walsh wrote:
> I have a hard disk with a "512e" sector size: emulated 512, really 4096.
> 
> The disk returns a 512-byte size to drivers for compatibility.
> 
> I can partition the disk and setup the allocation size
> to 4096, but I'd like to tell the kernel to use a
> virtual-size of 4096 for the sector as an additional
> performance 'hint', so nothing will even try to use
> smaller i/o's than that.

Just format the filesystem with 4k sector size.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: Howto tell kernel to use 4096 as granularity & minimum size?
  2014-07-20 22:28 ` Dave Chinner
@ 2014-07-21 20:45   ` Linda Walsh
  2014-07-23 13:17     ` One Thousand Gnomes
  0 siblings, 1 reply; 4+ messages in thread
From: Linda Walsh @ 2014-07-21 20:45 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Linux-Kernel

Dave Chinner wrote:
>
>> I can partition the disk and setup the allocation size
>> to 4096, but I'd like to tell the kernel to use a
>> virtual-size of 4096 for the sector as an additional
>> performance 'hint', so nothing will even try to use
>> smaller i/o's than that.
>>     
>
> Just format the filesystem with 4k sector size.
---
    Good idea,  though.. I wanted to set it for the whole "disk"(array)
as it (multiple 4T drives) will be subdivided into multiple filesystems
and have lvm and a partition table under the file system(s),
so telling the kernel to only do 4K alloc+io's to the whole thing
would cover the most with the least.





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

* Re: Howto tell kernel to use 4096 as granularity & minimum size?
  2014-07-21 20:45   ` Linda Walsh
@ 2014-07-23 13:17     ` One Thousand Gnomes
  0 siblings, 0 replies; 4+ messages in thread
From: One Thousand Gnomes @ 2014-07-23 13:17 UTC (permalink / raw)
  To: Linda Walsh; +Cc: Dave Chinner, Linux-Kernel

On Mon, 21 Jul 2014 13:45:22 -0700
Linda Walsh <lkml@tlinx.org> wrote:

> Dave Chinner wrote:
> >
> >> I can partition the disk and setup the allocation size
> >> to 4096, but I'd like to tell the kernel to use a
> >> virtual-size of 4096 for the sector as an additional
> >> performance 'hint', so nothing will even try to use
> >> smaller i/o's than that.
> >>     
> >
> > Just format the filesystem with 4k sector size.
> ---
>     Good idea,  though.. I wanted to set it for the whole "disk"(array)
> as it (multiple 4T drives) will be subdivided into multiple filesystems
> and have lvm and a partition table under the file system(s),
> so telling the kernel to only do 4K alloc+io's to the whole thing
> would cover the most with the least.

Also before you format it read the specification if you are using SATA
drives. The disk is not necessarily aligned so that the physical/logical
block boundary is as you'd expect. Some devices have a partial physical
sector at the start in order to make it happen to work nicely with legacy
software.

Good fdisk tools know about this. It's in the ATA8 specification for
identify.

Alan

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

end of thread, other threads:[~2014-07-23 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-20 18:47 Howto tell kernel to use 4096 as granularity & minimum size? Linda A. Walsh
2014-07-20 22:28 ` Dave Chinner
2014-07-21 20:45   ` Linda Walsh
2014-07-23 13:17     ` One Thousand Gnomes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).