public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/65070] New: libgomp calls syscall instruction directly
@ 2015-02-15 11:23 nyh at math dot technion.ac.il
  2015-02-15 16:01 ` [Bug libgomp/65070] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nyh at math dot technion.ac.il @ 2015-02-15 11:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65070

            Bug ID: 65070
           Summary: libgomp calls syscall instruction directly
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nyh at math dot technion.ac.il
                CC: jakub at gcc dot gnu.org

The code in libgomp/config/linux/x86/futex.h is needlessly complicated: It
contains a definition of SYS_futex, and contains two variants (x86 and x86_64)
of the assembly code needed to run a system call. But unless I'm missing
something, all of this is quite redundant - glibc already has the
<sys/syscall.h> defining SYS_futex, and a syscall() function calling a system
call in the right way for both x86 and x86_64. 

Using the assembly code directly instead of calling the syscall() function is a
tiny bit faster, but since this code only use for fairly slow situations anyway
(a futex is only used when a context switch is necessary), the extra
function-call overhead should be, I think, negligible.

Finally, my ulterior motive for making this code call syscall() instead of
machine instructions directly is that the latter breaks on the OSv operating
system: https://github.com/cloudius-systems/osv/issues/590


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-07  6:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-15 11:23 [Bug libgomp/65070] New: libgomp calls syscall instruction directly nyh at math dot technion.ac.il
2015-02-15 16:01 ` [Bug libgomp/65070] " jakub at gcc dot gnu.org
2015-02-15 17:10 ` nyh at math dot technion.ac.il
2016-08-07  6:21 ` nyh at math dot technion.ac.il

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).