lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test
From
Date
On 8/9/22 5:17 PM, Florian Weimer wrote:
> * Florian Weimer:
>
>> * Gavin Shan:
>>
>>> sched_getcpu() is glibc dependent and it can simply return the CPU
>>> ID from the registered rseq information, as Florian Weimer pointed.
>>> In this case, it's pointless to compare the return value from
>>> sched_getcpu() and that fetched from the registered rseq information.
>>>
>>> Fix the issue by replacing sched_getcpu() with getcpu(), as Florian
>>> suggested. The comments are modified accordingly.
>>
>> Note that getcpu was added in glibc 2.29, so perhaps you need to perform
>> a direct system call?
>
> One more thing: syscall(__NR_getcpu) also has the advantage that it
> wouldn't have to be changed again if node IDs become available via rseq
> and getcpu is implemented using that.
>
> Thanks,
> Florian
>

Thanks, Florian. It makes sense to me to use syscall(__NR_getcpu) in
next revision. Thanks for your quick review :)

I would hold for one or two days to post v2, to see if others have
more comments.

Thanks,
Gavin

\
 
 \ /
  Last update: 2022-08-09 10:47    [W:2.306 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site