coalescing in polling mode in 4.9

Nitesh Shetty nj.shetty at samsung.com
Fri Feb 9 14:37:08 PST 2018


Hi Alex,

Did you observe any benefit in polling-performance i.e. with 
interrupt-coalescing vs without interrupt-coalescing. I'd appreciate if 
you could share the performance/latency data.

Thanks,
Nitesh

On Tuesday 06 February 2018 11:09 AM, Alex Nln wrote:
> Hi Nitesh,
> 
> On Mon, 05 Feb 2018 21:12:12 +0530
> Nitesh <nj.shetty at samsung.com> wrote:
> 
>> Hi Alex,
>> I got into similar problem not long ago. With coalescing enabled, some
>> I/Os took very long. Every time need_reshed() returns true,
>> io_schedule() makes task go to sleep as its state is previous set as
>> non-interruptible.I handled this by setting task state as running, and
>> release the cpu. Diff is attached below, you may give it a try.
>>
> 
> I tested this patch on kernel 4.9 and it solves the problem.
> Thanks a lot
> 
> 
>>
>> diff --git a/fs/block_dev.c b/fs/block_dev.c
>> index 4a181fc..d2eeedf 100644
>> --- a/fs/block_dev.c
>> +++ b/fs/block_dev.c
>> @@ -236,9 +236,13 @@ __blkdev_direct_IO_simple(struct kiocb *iocb,
>> struct iov_iter *iter,
>>                   set_current_state(TASK_UNINTERRUPTIBLE);
>>                   if (!READ_ONCE(bio.bi_private))
>>                           break;
>> -               if (!(iocb->ki_flags & IOCB_HIPRI) ||
>> -                   !blk_poll(bdev_get_queue(bdev), qc))
>> +               if (!(iocb->ki_flags & IOCB_HIPRI))
>>                           io_schedule();
>> +               else if (!blk_poll(bdev_get_queue(bdev), qc)) {
>> +                       if(need_resched())
>> +                               set_current_state(TASK_RUNNING);
>> +                       io_schedule();
>> +               }
>>           }
>>           __set_current_state(TASK_RUNNING);
>>
>>
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
> 
> 
> 



More information about the Linux-nvme mailing list