Re: [PATCH 8/9] io_uring: utilize the io_batch infrastructure for more efficient polled IO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/21 2:03 AM, Christoph Hellwig wrote:
> On Wed, Oct 13, 2021 at 10:54:15AM -0600, Jens Axboe wrote:
>> @@ -2404,6 +2406,11 @@ static int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
>>  		struct kiocb *kiocb = &req->rw.kiocb;
>>  		int ret;
>>  
>> +		if (!file)
>> +			file = kiocb->ki_filp;
>> +		else if (file != kiocb->ki_filp)
>> +			break;
>> +
> 
> Can you explain why we now can only poll for a single file (independent
> of the fact that batching is used)?

Different file may be on a different backend, it's just playing it
safe and splitting it up. In practice it should not matter.

>> +	if (!pos && !iob.req_list)
>>  		return 0;
>> +	if (iob.req_list)
>> +		iob.complete(&iob);
> 
> Why not:
> 
> 	if (iob.req_list)
> 		iob.complete(&iob);
> 	else if (!pos)
> 		return 0;

That is cleaner, will adapt. Thanks!

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux