<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
<pre>On 2019/4/12 19:46, Cyril Hrubis wrote:</pre>
<blockquote cite="mid:20190412114632.GD28648@haruka.lan" type="cite">
<pre wrap="">Hi!
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">-#if defined(__i386__)
- return syscall(__NR_getcpu, cpu_id, node_id, cache_struct);
+#ifndef HAVE_SCHED_GETCPU
+ return tst_syscall(__NR_getcpu, cpu_id, node_id, cache_struct);
#else
*cpu_id = sched_getcpu();
#endif
</pre>
</blockquote>
<pre wrap="">So when __NR_getcpu is not implemented we end up with tst_brk(TCONF,
...) called from the tst_syscall, right? Since AFAIK the getcpu syscall
is not implemented on all architectures...
</pre>
</blockquote>
<pre wrap="">Yes. It will report TCONF if __NR_getcpu is not implemented.
From getcpu manpage, it is not implemented on all architectures as you
said, I think we can remove sched_getcpu and use __NR_getcpu directly.
</pre>
</blockquote>
<pre wrap="">
Reading the manual pages I think it's correct to fall back to
sched_getcpu() since as far as I can tell platforms that don't support
getcpu syscall have implemented the functionality as vDSO. So unless we
implement vDSO variant of getcpu we have to rely on sched_getcpu().
</pre>
</blockquote>
<pre>Hi cyril</pre>
<pre> Reading the sched_getcpu manpage, <span class="tlid-translation translation" lang="en"><span title="" class="">I mistakenly think the sched_getcpu uses
the getcpu syscall diretly.</span></span><code class="cpp"><span class="hljs-comment"> </span></code><span class="tlid-translation translation" lang="en"><span title="" class="">Actually </span></span><code class="cpp"><span class="hljs-comment">sched_getcpu uses VDSO getcpu() syscall
since glibc 2.22. Thanks for you explanation. </span></code></pre>
<pre><span class="tlid-translation translation" lang="en"><span title="" class=""></span></span></pre>
</body>
</html>