Re: [PATCH 1/2] lightnvm: break the loop when rqd is not null

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

 



That is okay with me.

2016-05-19 20:40 GMT+08:00 Matias Bjørling <mb@xxxxxxxxxxx>:
> On 05/19/2016 08:38 AM, Wenwei Tao wrote:
>>
>> From: Wenwei Tao <ww.tao0320@xxxxxxxxx>
>>
>> Break the loop when rqd is not null to reduce
>> unnecessary schedule.
>>
>> Signed-off-by: Wenwei Tao <ww.tao0320@xxxxxxxxx>
>> ---
>>   drivers/lightnvm/rrpc.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
>> index 2103e97..2915e39 100644
>> --- a/drivers/lightnvm/rrpc.c
>> +++ b/drivers/lightnvm/rrpc.c
>> @@ -98,6 +98,9 @@ static void rrpc_discard(struct rrpc *rrpc, struct bio
>> *bio)
>>
>>         do {
>>                 rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len);
>> +               if (rqd)
>> +                       break;
>> +
>>                 schedule();
>>         } while (!rqd);
>>
>>
>
> If that case, mind if I convert the do..while to while?
>
> while(1) {
>         rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len);
>         if (rqd)
>                 break;
>         schedule();
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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