On Thu, 17 Dec 2009 00:30:46 +0100
Robert <info...@die-optimisten.net> wrote:

> Hi,
> 
> I just read [1,2] that Western Digital (and probably others) will
> start to sell disks with an internal block size of 4KB instead of 512
> byte.
> 
> The article mentions that this might lead to a considerable
> performance impact if the  logical partition alignment is not in sync
> with the physical one ("e.g. if partitions starts at sector 63 wich
> is not a multiple of 4KB" [1]):
> "If a block of 4KB should be written, which is (logically) aligned,
> but physically in fact 2 sectors, then both physical sectors will
> need to be read, partially modified and then written back which leads
> to a serious performance hit." [1]
> 
> Any comments from someone who has a good knowledge of this area? Will 
> this affect OpenBSD?
> 
> regards,
> Robert
> 
> [1] (german) 
> http://www.heise.de/newsticker/meldung/Festplatten-mit-4-KByte-Sektorgroesse-887759.html
> [2]
> http://www.wdc.com/wdproducts/library/whitepapers/en/2579-771430.pdf


Ok, here we go:

sd0 at scsibus3 targ 0 lun 0: <ATA, WDC WD10EARS-00Y, 80.0> SCSI3 0/direct fixed
sd0: 953869MB, 512 bytes/sec, 1953525168 sec total

If anyone wants something special tested, let me know, might have some
sparetime later/over the weekend to honour requests.

I quickly tested a snapshot install without[1] and with[2] the
"XP legacy jumper" set. Nothing funky done to offsets, just used the
defaults presented by the installer.


bs       | no jumper | with jumper (bytes/sec)

4k write |  85889527 | 103984486
4k read  | 104816390 | 105121410
1m write |  75664716 |  96099982
1m read  | 104801842 | 103948306

           
In Windows land the jumper is used for XP installs with only one
partiton over the whole drive. When set the realignment software from
WD does not have to be run. ( http://www.wdc.com/advformat )
My guess is that the jumper tells the firmware to move the end of the
63 sector offset (Win XP also uses 63 sec) infront of a 4k boundary.
So with the jumper set only the slice sizes when using whole disk for
OpenBSD would have to be manually aligned on the 4k bounds atm.


Whatever, i'll have a look if manually adjusting the boundaries and
slice start/end will make a difference, as i only tested the first
slice.

- Robert [H]



### Case 1 ###
quick and dirty snapshot install without the "XP legacy jumper" set.

# fdisk sd0
Disk: sd0       geometry: 121601/255/63 [1953525168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   1 - 121600 254  63 [          63:  1953520002 ] OpenBSD

# disklabel sd0
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: WDC WD10EARS-00Y
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121601
total sectors: 1953525168
rpm: 3600
interleave: 1
boundstart: 63
boundend: 1953520065
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:         16787862               63  4.2BSD   2048 16384    1 # /
  b:          1060290         16787925    swap                   
  c:       1953525168                0  unused

# dd if=/dev/zero of=/tmp/file.bs4k bs=4k count=262144
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 12.501 secs (85889527 bytes/sec)
# dd of=/dev/zero if=/tmp/file.bs4k bs=4k count=262144
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 10.244 secs (104816390 bytes/sec)
# dd if=/dev/zero of=/tmp/file.1m bs=1m count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 28.381 secs (75664716 bytes/sec)
# dd of=/dev/null if=/tmp/file.1m bs=1m count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 20.490 secs (104801842 bytes/sec)


### Case 2 ###
"XP legacy jumper" set.

# fdisk sd0
Disk: sd0       geometry: 121601/255/63 [1953525168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   1 - 121600 254  63 [          63:  1953520002 ] OpenBSD     

# disklabel sd0
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: WDC WD10EARS-00Y
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121601
total sectors: 1953525168
rpm: 3600
interleave: 1
boundstart: 63
boundend: 1953520065
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:         16787862               63  4.2BSD   2048 16384    1 # /
  b:          1060290         16787925    swap                   
  c:       1953525168                0  unused 

(( in installer a = 8g, b = 512m ))

# dd if=/dev/zero of=/tmp/file.4k bs=4k count=262144
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 10.325 secs (103984486 bytes/sec)
# dd of=/dev/null if=/tmp/file.4k bs=4k count=262144
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 10.214 secs (105121410 bytes/sec)
# dd if=/dev/zero of=/tmp/file.1m bs=1m count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 22.346 secs (96099982 bytes/sec)
# dd of=/dev/null if=/tmp/file.1m bs=1m count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 20.659 secs (103948306 bytes/sec)

Reply via email to