From: Dave Chinner <david@fromorbit.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: xfs@oss.sgi.com
Subject: Re: Alignment size?
Date: Fri, 13 Aug 2010 21:39:15 +1000 [thread overview]
Message-ID: <20100813113915.GD10429@dastard> (raw)
In-Reply-To: <4C64E52E.2060806@msgid.tls.msk.ru>
On Fri, Aug 13, 2010 at 10:24:46AM +0400, Michael Tokarev wrote:
> 13.08.2010 03:49, Dave Chinner wrote:
> > On Fri, Aug 13, 2010 at 02:10:39AM +0400, Michael Tokarev wrote:
> >> Hello.
> >>
> >> I used XFS for a long time on many different
> >> servers, and it works well. But now I encountered
> >> an.. unexpected problem.
> >>
> >> The question is: on one of our servers, XFS requires
> >> different alignment size for O_DIRECT operations than
> >> on others. Usually it's 512 bytes, but on this server
> >> it is 4096 - both min_io and alignment (this is from
> >> XFS_IOC_DIOINFO ioctl).
> >
> > It'll be a filesystem set up with a 4k sector size, then. Check the
> > output of xfs_info.
>
> yes, xfs_info reports sectsz=4096, I noticed this yesterday.
....
> So the question that remains is: why?
>
> It's an old machine (PIV era), with old scsi disks (74Gb
> non-hotswap), -- the same disks as used on numerous other
> machines out there, where there's no such issue.
If the software was as old as the machine, then that's the likely
reason. The old md raid5 implementation did not handle sub-page
size aligned IO very well - a change of IO alignment would cause the
stripe cache to be purged and cause performance to be terrible.
Hence every time XFS wrote the superblock or an AG header it would
purge the stripe cache.
The workaround old versions of mkfs.xfs used was to create the fs
with a sector size of 4k when it detected md raid5 underneath it so
the sb and ag headers were all 4k aligned and sized, just like the
rest of the filesystem....
> And a related question, -- is there a way to create
> xfs fs with the right sector size? The filesystem
> were ok in years, not only on this machine, and I'm
> quite afraid to replace it with something else (e.g.
> ext4) in a hurry without good prior testing.
# mkfs.xfs -s <size> ....
if you want to set it manually. YOu shouldn't need to with any
relatively recent mkfs.xfs...
> By the way, how one can check the "sector size" of a
> block device nowadays? I think I saw something about
> sysfs, but I see nothing of that sort in 2.6.32 kernel
> (which is used on this and other systems).
/sys/block/<dev>/queue/hw_sector_size
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-08-13 11:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 22:10 Alignment size? Michael Tokarev
2010-08-12 23:49 ` Dave Chinner
2010-08-13 6:24 ` Michael Tokarev
2010-08-13 10:27 ` Stan Hoeppner
2010-08-13 11:00 ` Michael Tokarev
2010-08-13 11:36 ` Roger Willcocks
2010-08-13 11:39 ` Dave Chinner [this message]
2010-08-13 15:15 ` Christoph Hellwig
2010-08-17 0:18 ` Michael Tokarev
2010-08-17 0:30 ` Michael Tokarev
2010-08-17 0:31 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100813113915.GD10429@dastard \
--to=david@fromorbit.com \
--cc=mjt@tls.msk.ru \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox