public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Bug#661580: mkfs.xfs fails to detect correct sector size
@ 2012-02-28  7:49 Goswin von Brederlow
  2012-02-28  9:11 ` Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: Goswin von Brederlow @ 2012-02-28  7:49 UTC (permalink / raw)
  To: Debian Bug Tracking System

Package: xfsprogs
Version: 3.1.7
Severity: important
File: /sbin/mkfs.xfs

Hi,

since I recently bought a harddisk with 4K sector size I've been
checking for correct alignment and blocksizes in various things. One
of them being xfs.

When I partition the disk in parted it shows correctly to have a
logical blocksize of 512 byte and physical blocksize of 4096 byte.
But mkfs.xfs does not detect that the physical blocksize is 4096 byte
and creates a filesystem with:

meta-data=/dev/sde1              isize=256    agcount=32, agsize=22892696 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=732566272, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=357698, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0


This often results in access to the disk that is not aligned to the
blocksize with the resulting degradation in performance.

Further, manually selecting the right sector size of 4096 still causes
lots of unaligned access while formating and while mounting the
filesystem. It does seem to fix the problem for actual use though.

MfG
	Goswin

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages xfsprogs depends on:
ii  libblkid1     2.20.1-1
ii  libc6         2.13-21 
ii  libreadline5  5.2-11  
ii  libuuid1      2.19.1-5

xfsprogs recommends no packages.

Versions of packages xfsprogs suggests:
pn  acl      2.2.51-4  
pn  attr     1:2.4.46-3
pn  quota    <none>    
pn  xfsdump  <none>    

-- no debconf information


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Bug#661580: mkfs.xfs fails to detect correct sector size
@ 2012-03-01  8:14 Goswin von Brederlow
  2012-03-01  8:33 ` Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: Goswin von Brederlow @ 2012-03-01  8:14 UTC (permalink / raw)
  To: Debian Bug Tracking System

Package: xfsprogs
Version: 3.1.7
Followup-For: Bug #661580

Hi again,

I've patched the NBD driver to set the physical sector size. Was way
easier than I imagined:

----------------------------------------------------------------------
--- linux/drivers/block/nbd.c~      2012-03-01 09:10:35.000000000 +0100
+++ linux/drivers/block/nbd.c       2012-03-01 08:57:49.000000000 +0100
@@ -413,6 +413,9 @@
                return ret;
        }
 
+       /* Set physical block size to blocksize */
+       blk_queue_physical_block_size(lo->disk->queue, lo->blksize);
+
        while ((req = nbd_read_stat(lo)) != NULL)
                nbd_end_request(req);
 
----------------------------------------------------------------------

And I can confirm that the sector size detection is still broken in
3.1.7.

root@frosties:~$ parted /dev/nbd0
GNU Parted 2.3
Using /dev/nbd0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: Unknown (unknown)
Disk /dev/nbd0: 16.8MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  16.8MB  16.8MB  xfs

(parted) q                                                                
root@frosties:~$ mkfs.xfs -f /dev/nbd0 
meta-data=/dev/nbd0              isize=256    agcount=1, agsize=4096 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=4096, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=1200, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

mrvn@frosties:~% tail /sys/block/nbd0/queue/*
==> /sys/block/nbd0/queue/add_random <==
1

==> /sys/block/nbd0/queue/discard_granularity <==
0

==> /sys/block/nbd0/queue/discard_max_bytes <==
0

==> /sys/block/nbd0/queue/discard_zeroes_data <==
0

==> /sys/block/nbd0/queue/hw_sector_size <==
512

==> /sys/block/nbd0/queue/iosched <==
tail: error reading `/sys/block/nbd0/queue/iosched': Is a directory

==> /sys/block/nbd0/queue/iostats <==
1

==> /sys/block/nbd0/queue/logical_block_size <==
512

==> /sys/block/nbd0/queue/max_hw_sectors_kb <==
127

==> /sys/block/nbd0/queue/max_integrity_segments <==
0

==> /sys/block/nbd0/queue/max_sectors_kb <==
127

==> /sys/block/nbd0/queue/max_segment_size <==
65536

==> /sys/block/nbd0/queue/max_segments <==
128

==> /sys/block/nbd0/queue/minimum_io_size <==
4096

==> /sys/block/nbd0/queue/nomerges <==
0

==> /sys/block/nbd0/queue/nr_requests <==
128

==> /sys/block/nbd0/queue/optimal_io_size <==
0

==> /sys/block/nbd0/queue/physical_block_size <==
4096

==> /sys/block/nbd0/queue/read_ahead_kb <==
128

==> /sys/block/nbd0/queue/rotational <==
0

==> /sys/block/nbd0/queue/rq_affinity <==
1

==> /sys/block/nbd0/queue/scheduler <==
noop deadline [cfq] 


MfG
	Goswin

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages xfsprogs depends on:
ii  libblkid1     2.20.1-1
ii  libc6         2.13-21 
ii  libreadline5  5.2-11  
ii  libuuid1      2.19.1-5

xfsprogs recommends no packages.

Versions of packages xfsprogs suggests:
pn  acl      2.2.51-4  
pn  attr     1:2.4.46-3
pn  quota    <none>    
pn  xfsdump  <none>    

-- no debconf information


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-03-02  5:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28  7:49 Bug#661580: mkfs.xfs fails to detect correct sector size Goswin von Brederlow
2012-02-28  9:11 ` Christoph Hellwig
2012-02-28 13:28   ` Carlos Maiolino
2012-02-28 19:19   ` Goswin von Brederlow
2012-02-29 19:56   ` Eric Sandeen
2012-03-01  3:53     ` Goswin von Brederlow
2012-03-01  6:06       ` Christoph Hellwig
2012-03-01  8:56         ` Goswin von Brederlow
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01  8:14 Goswin von Brederlow
2012-03-01  8:33 ` Christoph Hellwig
2012-03-01  9:07   ` Goswin von Brederlow
2012-03-01 20:55   ` Eric Sandeen
2012-03-02  5:05     ` Eric Sandeen

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