From: Dave Chinner <david@fromorbit.com>
To: Alvin Abitria <abitria.alvin@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: LBA starting address alignment from struct request
Date: Mon, 8 Dec 2014 08:39:07 +1100 [thread overview]
Message-ID: <20141207213907.GO18131@dastard> (raw)
In-Reply-To: <CANybWhrdw4ESe6LXAOiy4QooX2yu4WGKiGEhVjb-rX_3HFAe_Q@mail.gmail.com>
On Sun, Dec 07, 2014 at 11:49:41AM +0800, Alvin Abitria wrote:
> Hello,
>
> Currently doing block drivers. I've noticed during my tests that if
> my platform are RHEL6.x/CentOS6.x my struct request's starting
> LBA/sector is always aligned to 8 (e.g. 0, 8, 0x100, 0x2508, etc.)
> which is actually desirable for my designed driver. It seems the
> struct requests are always aligned there.
>
> On the other hand, if I test on some older systems like Oracle 5.6,
> the starting LBA for struct requests there seems not to be aligned to
> 8 - most cases the LBA is offseted (e.g. 0x2507, 300f, 0x95bd500f,
> etc.)
>
> My block queue settings and even looking from sysfs shows that my
> logical block size and physical block size are 512 and 512,
> respectively. So I don't think it has something to do with 4kB
> sectors. What could be the setting that triggered such behaviour?
Partition alignment and filesystem type and configuration will
determine if IOs on arbitrary sector alignments are done. Some
filesystems will *always* do some amount of arbitrarily sector
aligned IO even when using a 4k block size. And if you configure a
filesystem to use a 512 byte block size, then you'll almost always
get non-aligned IO requests.
Hence if your block device can only handle 4k aligned and sized IO
then it needs to preset a block device with a 4k sector size. That
will result in everything using the block device to issue 4k aligned
and sized IOs....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2014-12-07 21:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-07 3:49 LBA starting address alignment from struct request Alvin Abitria
2014-12-07 21:39 ` Dave Chinner [this message]
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=20141207213907.GO18131@dastard \
--to=david@fromorbit.com \
--cc=abitria.alvin@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
/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 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.