public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nyh at math dot technion.ac.il" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/65070] New: libgomp calls syscall instruction directly
Date: Sun, 15 Feb 2015 11:23:00 -0000	[thread overview]
Message-ID: <bug-65070-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2015-02-15 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15 11:23 nyh at math dot technion.ac.il [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65070-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).