All of lore.kernel.org
 help / color / mirror / Atom feed
From: bvanassche@acm.org (Bart Van Assche)
Subject: [PATCH] nvmet: disable direct I/O when unavailable
Date: Mon, 25 Feb 2019 08:10:16 -0800	[thread overview]
Message-ID: <1551111016.31902.149.camel@acm.org> (raw)
In-Reply-To: <20190225153827.GA17442@linux-x5ow.site>

On Mon, 2019-02-25@16:38 +0100, Johannes Thumshirn wrote:
> On Mon, Feb 25, 2019@06:49:04AM -0800, Bart Van Assche wrote:
> > On 2/25/19 1:37 AM, Johannes Thumshirn wrote:
> > > On 24/02/2019 11:54, Max Gurtovoy wrote:
> > > > What is the status of iSCSI/SRP targets in this case ?
> > > 
> > > iSCSI/SRP passes in the following:
> > > 
> > >   /*
> > >    * Use O_DSYNC by default instead of O_SYNC to forgo syncing
> > >    * of pure timestamp updates.
> > >    */
> > >   flags = O_RDWR | O_CREAT | O_LARGEFILE | O_DSYNC;
> > 
> > That code fragment comes from the LIO file backend. There is no requirement
> > for a SCSI target core file backend to use O_DSYNC. SCST allows users to
> > choose whether or not O_DSYNC should be used:
> 
> Yes, LIO file backend is the in-tree equivalent to NVMe's file backend. That's
> why I copied it here.
> 
> 
> > 
> > 	if (virt_dev->wt_flag && !virt_dev->nv_cache)
> > 		open_flags |= O_DSYNC;
> > 
> 
> OK. Do your open_flags include O_DIRECT per default as well?

I don't think it has ever been supported to pass O_DIRECT to filp_open().
As one can see in build_open_flags() O_DIRECT is ignored. The only way I
know of to submit direct I/O from kernel context is by setting the
IOCB_DIRECT flag.

Bart.

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <bvanassche@acm.org>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Max Gurtovoy <maxg@mellanox.com>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	Christoph Hellwig <hch@lst.de>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH] nvmet: disable direct I/O when unavailable
Date: Mon, 25 Feb 2019 08:10:16 -0800	[thread overview]
Message-ID: <1551111016.31902.149.camel@acm.org> (raw)
In-Reply-To: <20190225153827.GA17442@linux-x5ow.site>

On Mon, 2019-02-25 at 16:38 +0100, Johannes Thumshirn wrote:
> On Mon, Feb 25, 2019 at 06:49:04AM -0800, Bart Van Assche wrote:
> > On 2/25/19 1:37 AM, Johannes Thumshirn wrote:
> > > On 24/02/2019 11:54, Max Gurtovoy wrote:
> > > > What is the status of iSCSI/SRP targets in this case ?
> > > 
> > > iSCSI/SRP passes in the following:
> > > 
> > >   /*
> > >    * Use O_DSYNC by default instead of O_SYNC to forgo syncing
> > >    * of pure timestamp updates.
> > >    */
> > >   flags = O_RDWR | O_CREAT | O_LARGEFILE | O_DSYNC;
> > 
> > That code fragment comes from the LIO file backend. There is no requirement
> > for a SCSI target core file backend to use O_DSYNC. SCST allows users to
> > choose whether or not O_DSYNC should be used:
> 
> Yes, LIO file backend is the in-tree equivalent to NVMe's file backend. That's
> why I copied it here.
> 
> 
> > 
> > 	if (virt_dev->wt_flag && !virt_dev->nv_cache)
> > 		open_flags |= O_DSYNC;
> > 
> 
> OK. Do your open_flags include O_DIRECT per default as well?

I don't think it has ever been supported to pass O_DIRECT to filp_open().
As one can see in build_open_flags() O_DIRECT is ignored. The only way I
know of to submit direct I/O from kernel context is by setting the
IOCB_DIRECT flag.

Bart.

  reply	other threads:[~2019-02-25 16:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 18:22 [PATCH] nvmet: disable direct I/O when unavailable Johannes Thumshirn
2019-02-21 18:22 ` Johannes Thumshirn
2019-02-22  0:41 ` Chaitanya Kulkarni
2019-02-22  0:41   ` Chaitanya Kulkarni
2019-02-22  5:55   ` Johannes Thumshirn
2019-02-22  5:55     ` Johannes Thumshirn
2019-02-24 10:54     ` Max Gurtovoy
2019-02-24 10:54       ` Max Gurtovoy
2019-02-25  9:37       ` Johannes Thumshirn
2019-02-25  9:37         ` Johannes Thumshirn
2019-02-25 14:49         ` Bart Van Assche
2019-02-25 14:49           ` Bart Van Assche
2019-02-25 15:38           ` Johannes Thumshirn
2019-02-25 15:38             ` Johannes Thumshirn
2019-02-25 16:10             ` Bart Van Assche [this message]
2019-02-25 16:10               ` Bart Van Assche
2019-02-25 21:18     ` Sagi Grimberg
2019-02-25 21:18       ` Sagi Grimberg
2019-03-08 13:26       ` Christoph Hellwig
2019-03-08 13:26         ` Christoph Hellwig

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=1551111016.31902.149.camel@acm.org \
    --to=bvanassche@acm.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.