All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Avi Kivity <avi@scylladb.com>,
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: io_pgetevents & aio fsync V2
Date: Fri, 06 Apr 2018 08:57:59 -0400	[thread overview]
Message-ID: <x497epklcfc.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20180406062700.GA20714@lst.de> (Christoph Hellwig's message of "Fri, 6 Apr 2018 08:27:00 +0200")

Christoph Hellwig <hch@lst.de> writes:

> On Fri, Apr 06, 2018 at 04:16:30AM +0100, Al Viro wrote:
>> BTW, this is only tangentially related, but... does *anything* call
>> io_submit() for huge amounts of iocb?

I don't know.  If an application did that, as many I/Os as could fit
into the ring buffer would be submitted, and that's what gets returned
from the system call (the number of submitted iocbs).

>> Check in do_io_submit() is insane - "no more than MAX_LONG total of
>> _pointers_".  Compat variant goes for "no more than a page worth of
>> pointers" and there's a hard limit in ioctx_alloc() - we can't ever
>> get more than 8M slots in ring buffer...
>
> Logical upper bound for io_submit is nr_events passed to io_setup(),
> which is bound by aio_max_nr.  Except that we never actually check
> against nr_events (or max_reqs as it is known in kernel) in io_submit.
> Sigh..

io_submit_one calls aio_get_req which calls get_reqs_available, which is
what does the checking for an available ring buffer entry.

-Jeff

WARNING: multiple messages have this Message-ID (diff)
From: Jeff Moyer <jmoyer@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Avi Kivity <avi@scylladb.com>,
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: io_pgetevents & aio fsync V2
Date: Fri, 06 Apr 2018 08:57:59 -0400	[thread overview]
Message-ID: <x497epklcfc.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20180406062700.GA20714@lst.de> (Christoph Hellwig's message of "Fri, 6 Apr 2018 08:27:00 +0200")

Christoph Hellwig <hch@lst.de> writes:

> On Fri, Apr 06, 2018 at 04:16:30AM +0100, Al Viro wrote:
>> BTW, this is only tangentially related, but... does *anything* call
>> io_submit() for huge amounts of iocb?

I don't know.  If an application did that, as many I/Os as could fit
into the ring buffer would be submitted, and that's what gets returned
from the system call (the number of submitted iocbs).

>> Check in do_io_submit() is insane - "no more than MAX_LONG total of
>> _pointers_".  Compat variant goes for "no more than a page worth of
>> pointers" and there's a hard limit in ioctx_alloc() - we can't ever
>> get more than 8M slots in ring buffer...
>
> Logical upper bound for io_submit is nr_events passed to io_setup(),
> which is bound by aio_max_nr.  Except that we never actually check
> against nr_events (or max_reqs as it is known in kernel) in io_submit.
> Sigh..

io_submit_one calls aio_get_req which calls get_reqs_available, which is
what does the checking for an available ring buffer entry.

-Jeff

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

  reply	other threads:[~2018-04-06 12:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  7:26 io_pgetevents & aio fsync V2 Christoph Hellwig
2018-03-28  7:26 ` Christoph Hellwig
2018-03-28  7:26 ` [PATCH 1/6] aio: don't print the page size at boot time Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-03-28  7:26 ` [PATCH 2/6] aio: remove an outdated comment in aio_complete Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-03-28 16:05   ` Darrick J. Wong
2018-03-28 16:05     ` Darrick J. Wong
2018-03-28 17:05   ` Matthew Wilcox
2018-03-28 17:05     ` Matthew Wilcox
2018-03-28  7:26 ` [PATCH 3/6] aio: refactor read/write iocb setup Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-04-06  3:21   ` Al Viro
2018-04-06  3:21     ` Al Viro
2018-04-06  7:10     ` Christoph Hellwig
2018-04-06  7:10       ` Christoph Hellwig
2018-04-06 12:28       ` Al Viro
2018-04-06 12:28         ` Al Viro
2018-03-28  7:26 ` [PATCH 4/6] aio: sanitize ki_list handling Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-03-28  7:26 ` [PATCH 5/6] aio: implement IOCB_CMD_FSYNC and IOCB_CMD_FDSYNC Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-04-06  2:59   ` Al Viro
2018-04-06  2:59     ` Al Viro
2018-03-28  7:26 ` [PATCH 6/6] aio: implement io_pgetevents Christoph Hellwig
2018-03-28  7:26   ` Christoph Hellwig
2018-04-06  3:16 ` io_pgetevents & aio fsync V2 Al Viro
2018-04-06  3:16   ` Al Viro
2018-04-06  6:27   ` Christoph Hellwig
2018-04-06  6:27     ` Christoph Hellwig
2018-04-06 12:57     ` Jeff Moyer [this message]
2018-04-06 12:57       ` Jeff Moyer

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=x497epklcfc.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=avi@scylladb.com \
    --cc=hch@lst.de \
    --cc=linux-aio@kvack.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.