tech-kern archive

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

Re: [uvm_hotplug] Fixing the build of tests



On December 15, 2018 10:59:19 AM GMT+05:30, Santhosh Raju <santhosh.raju%gmail.com@localhost> wrote:
>Hello
>
>I noticed that the tests for uvm_hotplug(9) situated under
>tests/sys/uvm/t_uvm_physseg.c was failing build.
>
>The reason for failure was the comparison between psize_t (which is
>defined as unsigned log inside t_uvm_hotplug.c) and int resulting in a
>sign compare error (-Werror=sign-compare). This was used to compare
>the "npages"  variable inside uvmexp struct.
>
>I have fixed the build by doing a type cast of uvmexp.npages to
>psize_t and the changes have been attached as diff along with this
>mail. The rationale for this is that uvmexp.npages is not expected to
>go below zero and hence the type cast does not result in negative
>values being converted to unsigned long.
>
>Cherry and I initially worked on this part of the code. And I would
>like the tests to be able to build again, so that I can further probe
>why some tests are failing.
>
>The test is currently not hooked into the build system, so this does
>not cause build failures when building the kernel.
>
>Let me know if the patch looks good to commit.
>
>Regards
>Santhosh

Hi Santhosh,

I believe the right thing to do would be to just fix the type in uvmexp.npages to the correct type instead of adjusting the test to accommodate it. What would be the consequences of this? 

Also, I hadn't realised that the tests aren't wired into the build. They really should be.

Thanks!
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


Home | Main Index | Thread Index | Old Index