Re: [PATCH v9 1/4] liburing: add api to set napi busy poll settings

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

 



On 2/2/24 1:23 PM, Olivier Langlois wrote:
> On Fri, 2024-02-02 at 13:14 -0700, Jens Axboe wrote:
>>
>> Ah gotcha, yeah that?s odd and could not ever have worked. I wonder
>> how that was tested?
>>
>> I?ll setup a liburing branch as well.
>>
> It is easy. You omit to check the function return value by telling to
> yourself that it cannot fail...
> 
> I caught my mistake on a second pass code review...

Oh I can see how that can happen, but then there should be no functional
changes in terms of latency... Which means that it was never tested. The
test results were from the original postings, so probably just fine.
It's just that later versions would've failed. Looking at the example
test case, it doesn't check the return value.

> C++ has a very useful [[nodiscard]] attribute that can help to catch
> this simple error... I am not sure if there is something similar to the
> [[nodiscard]] in the ISO C standard...

You can use __attribute__((__warn_unused_result__)) - the kernel does
that, for example.

-- 
Jens Axboe





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux