Re: [PATCH 8/8] aio: support for IO polling

2018-11-22 Thread Jens Axboe
On 11/22/18 4:13 AM, Jan Kara wrote: > > On Tue 20-11-18 10:19:53, Jens Axboe wrote: >> +/* >> + * We can't just wait for polled events to come to us, we have to actively >> + * find and complete them. >> + */ >> +static void aio_iopoll_reap_events(struct kioctx *ctx) >> +{ >> +if (!(ctx->flag

Re: [PATCH 8/8] aio: support for IO polling

2018-11-22 Thread Jan Kara
On Tue 20-11-18 10:19:53, Jens Axboe wrote: > +/* > + * We can't just wait for polled events to come to us, we have to actively > + * find and complete them. > + */ > +static void aio_iopoll_reap_events(struct kioctx *ctx) > +{ > + if (!(ctx->flags & IOCTX_FLAG_IOPOLL)) > + return

Re: [PATCH 8/8] aio: support for IO polling

2018-11-21 Thread Benny Halevy
On Wed, 2018-11-21 at 06:26 -0700, Jens Axboe wrote: > On 11/21/18 4:12 AM, Benny Halevy wrote: > > > +#define AIO_POLL_STACK 8 > > > + > > > +/* > > > + * Process completed iocb iopoll entries, copying the result to > > > userspace. > > > + */ > > > +static long aio_iopoll_reap(struct kioctx *c

Re: [PATCH 8/8] aio: support for IO polling

2018-11-21 Thread Jens Axboe
On 11/21/18 4:12 AM, Benny Halevy wrote: >> +#define AIO_POLL_STACK 8 >> + >> +/* >> + * Process completed iocb iopoll entries, copying the result to userspace. >> + */ >> +static long aio_iopoll_reap(struct kioctx *ctx, struct io_event __user *evs, >> +unsigned int *nr

Re: [PATCH 8/8] aio: support for IO polling

2018-11-21 Thread Benny Halevy
On Tue, 2018-11-20 at 10:19 -0700, Jens Axboe wrote: > Add polled variants of PREAD/PREADV and PWRITE/PWRITEV. These act > like their non-polled counterparts, except we expect to poll for > completion of them. The polling happens at io_getevent() time, and > works just like non-polled IO. > > To s

[PATCH 8/8] aio: support for IO polling

2018-11-20 Thread Jens Axboe
Add polled variants of PREAD/PREADV and PWRITE/PWRITEV. These act like their non-polled counterparts, except we expect to poll for completion of them. The polling happens at io_getevent() time, and works just like non-polled IO. To setup an io_context for polled IO, the application must call io_se