On 12/21/18 4:28 AM, Christoph Hellwig wrote: > On Tue, Dec 18, 2018 at 08:42:16AM -0700, Jens Axboe wrote: >> We have to add each submitted polled request to the io_context >> poll_submitted list, which means we have to grab the poll_lock. We >> already use the block plug to batch submissions if we're doing a batch >> of IO submissions, extend that to cover the poll requests internally as >> well. > > The way we make this conditional looks rather odd. What about something > like the untested patch below to clean this up a bit? I also think that > we don't need the explicit aio_flush_state_reqs call in aio_submit_state_end > given that blk_finish_plug already calls the supplied callback. I folded in most of this and fixed a few missed cases, and made it work with !CONFIG_BLOCK as well. I do think the flush is needed, if we did block and flushed the plug earier. -- Jens Axboe