All of lore.kernel.org
 help / color / mirror / Atom feed
* WDC WD20EARS and 4k sector size
@ 2011-01-25  3:04 Herbert Poetzl
  2011-01-25  3:15 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Herbert Poetzl @ 2011-01-25  3:04 UTC (permalink / raw)
  To: linux-ide


I recently bought the WDC WD20EARS-00MVWB0 because it
was really cheap for a drive with 64 MB cache, and I
wanted to try out a 4k sector size disk ...

Now the drive performs quite well, is rather silent
and doesn't use much power or produce much heat, but
at first I didn't find anything in Linux indicating
that this drive would actually use 4k sectors.

To shorten things, I asked around on IRC, had a chat
with some other folks, found a jumper description on
the WD site talking about an 'Advanced Format' jumper
and finally contacted WD in a lengthy email thread.

The results of all this are:

 - the drive doesn't report 4k sectors at all, not
   even as physical sector size.

 - the 'Advanced Format' jumper shifts access to the
   the drive by one sector.

I did some tests to verify that, and I can confirm
the behaviour of the jumper in question with certain
benchmark tests (using dm and bonnie++) with and
without the jumper in place.

My question now is, how can I tell the kernel that
this drive actually has 4k physical sectors and that
it would be a smart thing to send requests in some 
kind of 4k I/O chunks?

Many thanks in advance,
Herbert

PS: if somebody is interested in the tests done to
verify the jumper, please let me know ...

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:04 WDC WD20EARS and 4k sector size Herbert Poetzl
@ 2011-01-25  3:15 ` Martin K. Petersen
  2011-01-25  3:32   ` Herbert Poetzl
  2011-01-25  4:09 ` Jeff Garzik
  2011-01-25  4:21 ` Mark Lord
  2 siblings, 1 reply; 11+ messages in thread
From: Martin K. Petersen @ 2011-01-25  3:15 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: linux-ide

>>>>> "Herbert" == Herbert Poetzl <herbert@13thfloor.at> writes:

Herbert>  - the drive doesn't report 4k sectors at all, not
Herbert>    even as physical sector size.

There have been numerous threads on this list about EARS not reporting
block sizes correctly. Check the archives.


Herbert> My question now is, how can I tell the kernel that this drive
Herbert> actually has 4k physical sectors and that it would be a smart
Herbert> thing to send requests in some kind of 4k I/O chunks?

Align your partitions on a 4K boundary.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:15 ` Martin K. Petersen
@ 2011-01-25  3:32   ` Herbert Poetzl
  2011-01-25  3:40     ` Greg Freemyer
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Herbert Poetzl @ 2011-01-25  3:32 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-ide

On Mon, Jan 24, 2011 at 10:15:14PM -0500, Martin K. Petersen wrote:
> >>>>> "Herbert" == Herbert Poetzl <herbert@13thfloor.at> writes:

> Herbert>  - the drive doesn't report 4k sectors at all, not
> Herbert>    even as physical sector size.

> There have been numerous threads on this list about EARS not 
> reporting block sizes correctly. Check the archives.

really? well, they probably use strange subjects or the search
function on the archives is broken ...

I did a search on the archives, and I get a totla of 30 threads
containing EARS (in linux-ide) and most of them talk about
something completely different (like rabbit ears :)

> Herbert> My question now is, how can I tell the kernel that this drive
> Herbert> actually has 4k physical sectors and that it would be a smart
> Herbert> thing to send requests in some kind of 4k I/O chunks?

> Align your partitions on a 4K boundary.

While this will ensure that the drive performance is better
than without doing so (I'm not using a partition table on that
drive anyways, but I get what you mean), this doesn't inform
the kernel about proper I/O sizes and for sure doesn't prevent
unnecessary read-change-write operations for the disc ...

best,
Herbert

> -- 
> Martin K. Petersen	Oracle Linux Engineering
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" 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] 11+ messages in thread

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:32   ` Herbert Poetzl
@ 2011-01-25  3:40     ` Greg Freemyer
  2011-01-25  3:52     ` Martin K. Petersen
  2011-01-25 10:01     ` Tejun Heo
  2 siblings, 0 replies; 11+ messages in thread
From: Greg Freemyer @ 2011-01-25  3:40 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: Martin K. Petersen, linux-ide

On Mon, Jan 24, 2011 at 10:32 PM, Herbert Poetzl <herbert@13thfloor.at> wrote:
> On Mon, Jan 24, 2011 at 10:15:14PM -0500, Martin K. Petersen wrote:
>> >>>>> "Herbert" == Herbert Poetzl <herbert@13thfloor.at> writes:
>
>> Herbert>  - the drive doesn't report 4k sectors at all, not
>> Herbert>    even as physical sector size.
>
>> There have been numerous threads on this list about EARS not
>> reporting block sizes correctly. Check the archives.
>
> really? well, they probably use strange subjects or the search
> function on the archives is broken ...
>
> I did a search on the archives, and I get a totla of 30 threads
> containing EARS (in linux-ide) and most of them talk about
> something completely different (like rabbit ears :)
>
>> Herbert> My question now is, how can I tell the kernel that this drive
>> Herbert> actually has 4k physical sectors and that it would be a smart
>> Herbert> thing to send requests in some kind of 4k I/O chunks?
>
>> Align your partitions on a 4K boundary.
>
> While this will ensure that the drive performance is better
> than without doing so (I'm not using a partition table on that
> drive anyways, but I get what you mean), this doesn't inform
> the kernel about proper I/O sizes and for sure doesn't prevent
> unnecessary read-change-write operations for the disc ...
>
> best,
> Herbert

Filesystems in general use a 4K or 8K blocksize.  Those are of course
sent to the drive in logical sector units where they get aggregated by
the drive and written to the physical media.

There is nothing more that can be done.

So if it is aligned, all is good.  If not, performance sucks.  So the
goal of supporting 4K physical sectors is primarily to ensure a
performance degradation is not introduced due to mis-alignment.

Good Luck
Greg

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:32   ` Herbert Poetzl
  2011-01-25  3:40     ` Greg Freemyer
@ 2011-01-25  3:52     ` Martin K. Petersen
  2011-01-25  4:23       ` Mark Lord
  2011-01-25 10:01     ` Tejun Heo
  2 siblings, 1 reply; 11+ messages in thread
From: Martin K. Petersen @ 2011-01-25  3:52 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: Martin K. Petersen, linux-ide

>>>>> "Herbert" == Herbert Poetzl <herbert@13thfloor.at> writes:

>> Align your partitions on a 4K boundary.

Herbert> While this will ensure that the drive performance is better
Herbert> than without doing so (I'm not using a partition table on that
Herbert> drive anyways, but I get what you mean), this doesn't inform
Herbert> the kernel about proper I/O sizes

The kernel doesn't enforce any "proper" I/O sizes at runtime other than
the logical block size.


Herbert> and for sure doesn't prevent unnecessary read-change-write
Herbert> operations for the disc ...

The other crucial component is passing the relevant options to mkfs.foo
to ensure the filesystem is formatted with 4KiB blocks.

If the drive had reported its block size correctly mkfs would have
picked this information up automatically. In this case, since the drive
doesn't indicate that it's using Advanced Format, you'll have to pass
the block size to mkfs by hand.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:04 WDC WD20EARS and 4k sector size Herbert Poetzl
  2011-01-25  3:15 ` Martin K. Petersen
@ 2011-01-25  4:09 ` Jeff Garzik
  2011-01-25  4:21 ` Mark Lord
  2 siblings, 0 replies; 11+ messages in thread
From: Jeff Garzik @ 2011-01-25  4:09 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: linux-ide, Martin K. Petersen

On 01/24/2011 10:04 PM, Herbert Poetzl wrote:
> I recently bought the WDC WD20EARS-00MVWB0 because it
> was really cheap for a drive with 64 MB cache, and I
> wanted to try out a 4k sector size disk ...
>
> Now the drive performs quite well, is rather silent
> and doesn't use much power or produce much heat, but
> at first I didn't find anything in Linux indicating
> that this drive would actually use 4k sectors.

See https://ata.wiki.kernel.org/index.php/ATA_4_KiB_sector_issues


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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:04 WDC WD20EARS and 4k sector size Herbert Poetzl
  2011-01-25  3:15 ` Martin K. Petersen
  2011-01-25  4:09 ` Jeff Garzik
@ 2011-01-25  4:21 ` Mark Lord
  2011-01-25  4:34   ` Herbert Poetzl
  2 siblings, 1 reply; 11+ messages in thread
From: Mark Lord @ 2011-01-25  4:21 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: linux-ide

On 11-01-24 10:04 PM, Herbert Poetzl wrote:
> 
> I recently bought the WDC WD20EARS-00MVWB0 because it
> was really cheap for a drive with 64 MB cache, and I
> wanted to try out a 4k sector size disk ...
> 
> Now the drive performs quite well, is rather silent
> and doesn't use much power or produce much heat, but
> at first I didn't find anything in Linux indicating
> that this drive would actually use 4k sectors.
> 
> To shorten things, I asked around on IRC, had a chat
> with some other folks, found a jumper description on
> the WD site talking about an 'Advanced Format' jumper
> and finally contacted WD in a lengthy email thread.

My understanding about that jumper is that
you DO NOT WANT THE JUMPER ON.

Without the jumper, sector 0 is 4KB aligned,
as is any sector multiple of 4.

But WITH the jumper, sector 0 is no longer 4KB aligned..
everything shifts by one (or seven) such that sector
63 ends up being the start of a 4KB low-level sector,
instead of the more sensible sector 64.

Right?

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:52     ` Martin K. Petersen
@ 2011-01-25  4:23       ` Mark Lord
  2011-01-25  8:26         ` Michael Tokarev
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Lord @ 2011-01-25  4:23 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Herbert Poetzl, linux-ide

On 11-01-24 10:52 PM, Martin K. Petersen wrote:
..
> If the drive had reported its block size correctly mkfs would have
> picked this information up automatically.

Apparently revision 00Z drives now show 4096 physical sector size,
with 512 for logical.  Can anyone out there confirm this first-hand?
(hdparm -I)

Thanks

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  4:21 ` Mark Lord
@ 2011-01-25  4:34   ` Herbert Poetzl
  0 siblings, 0 replies; 11+ messages in thread
From: Herbert Poetzl @ 2011-01-25  4:34 UTC (permalink / raw)
  To: Mark Lord; +Cc: linux-ide

On Mon, Jan 24, 2011 at 11:21:42PM -0500, Mark Lord wrote:
> On 11-01-24 10:04 PM, Herbert Poetzl wrote:

> > I recently bought the WDC WD20EARS-00MVWB0 because it
> > was really cheap for a drive with 64 MB cache, and I
> > wanted to try out a 4k sector size disk ...

> > Now the drive performs quite well, is rather silent
> > and doesn't use much power or produce much heat, but
> > at first I didn't find anything in Linux indicating
> > that this drive would actually use 4k sectors.

> > To shorten things, I asked around on IRC, had a chat
> > with some other folks, found a jumper description on
> > the WD site talking about an 'Advanced Format' jumper
> > and finally contacted WD in a lengthy email thread.

> My understanding about that jumper is that
> you DO NOT WANT THE JUMPER ON.

> Without the jumper, sector 0 is 4KB aligned,
> as is any sector multiple of 4.

> But WITH the jumper, sector 0 is no longer 4KB aligned..
> everything shifts by one (or seven) such that sector
> 63 ends up being the start of a 4KB low-level sector,
> instead of the more sensible sector 64.

> Right?

yes, that is what I found out and what got confirmed
by WD folks via E-mail, if you are using 4k aligned
partitions, DO NOT use the jumper, if you are using
DOS partitions starting at sector 63, this jumper
will improve the performance by shifting everything
by one 512 byte sector ...

why it is called 'Advanced Format' in the documentation
available from WD is beyond me.

best,
Herbert

> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" 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] 11+ messages in thread

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  4:23       ` Mark Lord
@ 2011-01-25  8:26         ` Michael Tokarev
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2011-01-25  8:26 UTC (permalink / raw)
  To: Mark Lord; +Cc: Martin K. Petersen, Herbert Poetzl, linux-ide, Jeff Garzik

25.01.2011 07:23, Mark Lord wrote:
> On 11-01-24 10:52 PM, Martin K. Petersen wrote:
> ..
>> If the drive had reported its block size correctly mkfs would have
>> picked this information up automatically.
> 
> Apparently revision 00Z drives now show 4096 physical sector size,
> with 512 for logical.  Can anyone out there confirm this first-hand?
> (hdparm -I)

There's no "00Z" revision for 20EARS, as far as I can tell.
There is, however, 00Z revision for 15EARS, which is 1.5Tb.

I've this drive:

 Model Family:     Western Digital Caviar Green (Adv. Format) family
 Device Model:     WDC WD20EARS-00MVWB0
 Serial Number:    WD-WMAZ20464440
 Firmware Version: 50.0AB50

this was the latest (the 3-platter version) of the drive
as were available ~2 months ago.

This drive does NOT report 4kb, it tells that both logical
and physical sector size is 512 bytes.  But it actually
uses 4kb sectors internally, which is visible when writing
by chunks of <4Kb with O_DIRECT: any size which is not
multiple of 4Kb and performance drops for a factor of 3..4.

Reportedly, WD15EARS with 00Z firmware does report all the
parameters correctly.  I've no idea what about WD10EARS,
more recentl 2TB+ drives and why they don't have (or do
they?) "right" firmware for 20EARS...

Thanks!

/mjt

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

* Re: WDC WD20EARS and 4k sector size
  2011-01-25  3:32   ` Herbert Poetzl
  2011-01-25  3:40     ` Greg Freemyer
  2011-01-25  3:52     ` Martin K. Petersen
@ 2011-01-25 10:01     ` Tejun Heo
  2 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2011-01-25 10:01 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: Martin K. Petersen, linux-ide

Hello,

On Tue, Jan 25, 2011 at 04:32:59AM +0100, Herbert Poetzl wrote:
> > Align your partitions on a 4K boundary.
> 
> While this will ensure that the drive performance is better
> than without doing so (I'm not using a partition table on that
> drive anyways, but I get what you mean), this doesn't inform
> the kernel about proper I/O sizes and for sure doesn't prevent
> unnecessary read-change-write operations for the disc ...

Kernel doesn't really care.  Well, the fs should align things to 4KiB
but all the modern ones already do so.  The only thing necessary is
aligning the partition table.  Whether the drive lies about physical
sector or not, most modern distros unconditionally align partitions to
1MiB.  So, as long as you use a distro which was released in the past
six month, there's nothing to worry about.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2011-01-25 10:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25  3:04 WDC WD20EARS and 4k sector size Herbert Poetzl
2011-01-25  3:15 ` Martin K. Petersen
2011-01-25  3:32   ` Herbert Poetzl
2011-01-25  3:40     ` Greg Freemyer
2011-01-25  3:52     ` Martin K. Petersen
2011-01-25  4:23       ` Mark Lord
2011-01-25  8:26         ` Michael Tokarev
2011-01-25 10:01     ` Tejun Heo
2011-01-25  4:09 ` Jeff Garzik
2011-01-25  4:21 ` Mark Lord
2011-01-25  4:34   ` Herbert Poetzl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.