All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sitsofe Wheeler <sitsofe@gmail.com>
To: smitha sunder <sundersmitha@gmail.com>
Cc: "Elliott, Robert (Servers)" <elliott@hpe.com>, fio <fio@vger.kernel.org>
Subject: Re: unaligned IO and starting LBA
Date: Thu, 19 Dec 2019 03:27:47 +0000	[thread overview]
Message-ID: <CALjAwxhuNDowJbesAjgPVoj67h5tfLj-OAcWdA0go30Qy95+Gg@mail.gmail.com> (raw)
In-Reply-To: <CA+zhgFRJJ6JiWe46+UPDkfDddUDxCTJcOTPUtJnA-y6rKcvN6w@mail.gmail.com>

On Thu, 17 Oct 2019 at 13:49, smitha sunder <sundersmitha@gmail.com> wrote:
>
> Hi Robert,
>
> Since I want to use blocksize_unaligned=1 , I had to get rid of direct=1 :
>
> Per man page :
> blocksize_unaligned, bs_unaligned
> If set, any size in blocksize_range may be used. This typically won't
> work with direct I/O, as that normally requires sector alignment.
>
> # fio --name=job1 --filename=/dev/nvme0n1  --rw=randwrite
> --ioengine=libaio  --number_ios=1 --debug=io --bs_unaligned=1
> --bs=1029 --direct=1
> fio: set debug option io
> fio: bs_unaligned may not work with raw io

> On Wed, Oct 16, 2019 at 8:12 AM Elliott, Robert (Servers)
> <elliott@hpe.com> wrote:
> >
> > > -----Original Message-----
> > > From: fio-owner@vger.kernel.org [mailto:fio-owner@vger.kernel.org] On Behalf Of smitha sunder
> > > Sent: Tuesday, October 15, 2019 4:37 PM
> > > To: fio <fio@vger.kernel.org>
> > > Subject: unaligned IO and starting LBA
> > >
> > > Hello,
> > >
> > > I have a 512 byte formatted nvme drive and I want to send an unaligned
> > > IO and here’s the fio command line I am using , fio version fio-3.7
> > >
> > > # fio --name=job1 --filename=/dev/nvme0n1  --rw=randwrite
> > > --ioengine=libaio  --number_ios=1 --debug=io --bs_unaligned=1
> > > --bs=1029

A blocksize of 1029 is neither a multiple of 4096 nor 512! You simply
can't send I/O that is not aligned (and is not a multiple) of the
device's logical block size down to a device so something will have to
"fix" things for you.

> > > Shouldn’t I see D7BD7CE as the starting LBA for the write based on the
> > > above offset (0x1af7af9cec) ?
> >
> > Without direct=1 you're exercising the OS page cache logic,
> > not directly accessing the drive.

Robert's right - when you have buffering going on the linux kernel
will quietly do a read-modify-write (two reads assuming it didn't
already have those blocks in memory, a modify, then two writes)
because you straddled a block.

-- 
Sitsofe | http://sucs.org/~sits/


      reply	other threads:[~2019-12-19  3:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 21:36 unaligned IO and starting LBA smitha sunder
2019-10-16 15:11 ` Elliott, Robert (Servers)
2019-10-16 17:18   ` smitha sunder
2019-12-19  3:27     ` Sitsofe Wheeler [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=CALjAwxhuNDowJbesAjgPVoj67h5tfLj-OAcWdA0go30Qy95+Gg@mail.gmail.com \
    --to=sitsofe@gmail.com \
    --cc=elliott@hpe.com \
    --cc=fio@vger.kernel.org \
    --cc=sundersmitha@gmail.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 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.