linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is LO_FLAGS_DIRECT_IO by default a good idea?
@ 2021-10-18 14:19 Lennart Poettering
  2021-10-18 15:05 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Lennart Poettering @ 2021-10-18 14:19 UTC (permalink / raw)
  To: Christoph Hellwig, Jens Axboe, Ming Lei, Martijn Coenen
  Cc: linux-block, Luca Boccassi, Karel Zak

eMing, Christoph, Jens!

Ming, 5 years ago or so you added support for dio/aio for the
loopback block device, i.e. LO_FLAGS_DIRECT_IO. As I understood it's
supposed to improve performance of loopback block devices
substantially. I noticed that there's various software that enables it
by default (Android, Docker), but a lot of other candidates currently
do not (util-linux, Ubuntu Snaps, various systemd tools). We recently
got a request to enable it by default in systemd, but information is
scarce on the precise effect of enabling this, and whether there are
any drawbacks.

So my question really is just: is this a flag we should all just
enable by default? Is there any reason not to enable it? Should
util-linux' losetup defaults be changed regarding this?

A brief answer like "yes, please, enable by default" would already
make me happy.

Thank you,

Lennart

--
Lennart Poettering, Berlin

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

* Re: Is LO_FLAGS_DIRECT_IO by default a good idea?
  2021-10-18 14:19 Is LO_FLAGS_DIRECT_IO by default a good idea? Lennart Poettering
@ 2021-10-18 15:05 ` Christoph Hellwig
  2021-10-19  7:28   ` Lennart Poettering
  2021-10-19  7:44   ` Ming Lei
  0 siblings, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-10-18 15:05 UTC (permalink / raw)
  To: Lennart Poettering
  Cc: Christoph Hellwig, Jens Axboe, Ming Lei, Martijn Coenen,
	linux-block, Luca Boccassi, Karel Zak

On Mon, Oct 18, 2021 at 04:19:20PM +0200, Lennart Poettering wrote:
> A brief answer like "yes, please, enable by default" would already
> make me happy.

I thikn enabling it by default is a good idea.  The only good use
case I can think of for using buffered I/O is when the image has
a smaller block size than supported on the host file.

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

* Re: Is LO_FLAGS_DIRECT_IO by default a good idea?
  2021-10-18 15:05 ` Christoph Hellwig
@ 2021-10-19  7:28   ` Lennart Poettering
  2021-10-19  7:44   ` Ming Lei
  1 sibling, 0 replies; 6+ messages in thread
From: Lennart Poettering @ 2021-10-19  7:28 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Ming Lei, Martijn Coenen, linux-block, Luca Boccassi,
	Karel Zak

On Mo, 18.10.21 17:05, Christoph Hellwig (hch@lst.de) wrote:

> On Mon, Oct 18, 2021 at 04:19:20PM +0200, Lennart Poettering wrote:
> > A brief answer like "yes, please, enable by default" would already
> > make me happy.
>
> I thikn enabling it by default is a good idea.  The only good use
> case I can think of for using buffered I/O is when the image has
> a smaller block size than supported on the host file.

Excellent! Thanks for the answer!

Lennart

--
Lennart Poettering, Berlin

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

* Re: Is LO_FLAGS_DIRECT_IO by default a good idea?
  2021-10-18 15:05 ` Christoph Hellwig
  2021-10-19  7:28   ` Lennart Poettering
@ 2021-10-19  7:44   ` Ming Lei
  2021-10-19 12:24     ` Jens Axboe
  1 sibling, 1 reply; 6+ messages in thread
From: Ming Lei @ 2021-10-19  7:44 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Lennart Poettering, Jens Axboe, Martijn Coenen, linux-block,
	Luca Boccassi, Karel Zak

On Mon, Oct 18, 2021 at 05:05:50PM +0200, Christoph Hellwig wrote:
> On Mon, Oct 18, 2021 at 04:19:20PM +0200, Lennart Poettering wrote:
> > A brief answer like "yes, please, enable by default" would already
> > make me happy.
> 
> I thikn enabling it by default is a good idea.  The only good use
> case I can think of for using buffered I/O is when the image has
> a smaller block size than supported on the host file.

Maybe we can enable it at default in kernel side, then fackback to
buffered IO if DIO is failed.

thanks, 
Ming


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

* Re: Is LO_FLAGS_DIRECT_IO by default a good idea?
  2021-10-19  7:44   ` Ming Lei
@ 2021-10-19 12:24     ` Jens Axboe
  2021-10-25 10:37       ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2021-10-19 12:24 UTC (permalink / raw)
  To: Ming Lei, Christoph Hellwig
  Cc: Lennart Poettering, Martijn Coenen, linux-block, Luca Boccassi,
	Karel Zak

On 10/19/21 1:44 AM, Ming Lei wrote:
> On Mon, Oct 18, 2021 at 05:05:50PM +0200, Christoph Hellwig wrote:
>> On Mon, Oct 18, 2021 at 04:19:20PM +0200, Lennart Poettering wrote:
>>> A brief answer like "yes, please, enable by default" would already
>>> make me happy.
>>
>> I thikn enabling it by default is a good idea.  The only good use
>> case I can think of for using buffered I/O is when the image has
>> a smaller block size than supported on the host file.
> 
> Maybe we can enable it at default in kernel side, then fackback to
> buffered IO if DIO is failed.

Yes I think that's sane, pure DIO probably isn't a great idea by
default. But if we have a sane fallback, then I do think it'd be the
best way to run it.

-- 
Jens Axboe


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

* Re: Is LO_FLAGS_DIRECT_IO by default a good idea?
  2021-10-19 12:24     ` Jens Axboe
@ 2021-10-25 10:37       ` Karel Zak
  0 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2021-10-25 10:37 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Ming Lei, Christoph Hellwig, Lennart Poettering, Martijn Coenen,
	linux-block, Luca Boccassi

On Tue, Oct 19, 2021 at 06:24:34AM -0600, Jens Axboe wrote:
> On 10/19/21 1:44 AM, Ming Lei wrote:
> > On Mon, Oct 18, 2021 at 05:05:50PM +0200, Christoph Hellwig wrote:
> >> On Mon, Oct 18, 2021 at 04:19:20PM +0200, Lennart Poettering wrote:
> >>> A brief answer like "yes, please, enable by default" would already
> >>> make me happy.
> >>
> >> I thikn enabling it by default is a good idea.  The only good use
> >> case I can think of for using buffered I/O is when the image has
> >> a smaller block size than supported on the host file.
> > 
> > Maybe we can enable it at default in kernel side, then fackback to
> > buffered IO if DIO is failed.
> 
> Yes I think that's sane, pure DIO probably isn't a great idea by
> default. But if we have a sane fallback, then I do think it'd be the
> best way to run it.

So, I can wait for kernel rather than enable it by default in
losetup/mount, right? :-)

  Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


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

end of thread, other threads:[~2021-10-25 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 14:19 Is LO_FLAGS_DIRECT_IO by default a good idea? Lennart Poettering
2021-10-18 15:05 ` Christoph Hellwig
2021-10-19  7:28   ` Lennart Poettering
2021-10-19  7:44   ` Ming Lei
2021-10-19 12:24     ` Jens Axboe
2021-10-25 10:37       ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).