From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 441 invoked by alias); 15 Feb 2015 17:10:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 399 invoked by uid 48); 15 Feb 2015 17:10:08 -0000 From: "nyh at math dot technion.ac.il" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/65070] libgomp calls syscall instruction directly Date: Sun, 15 Feb 2015 17:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nyh at math dot technion.ac.il X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg01660.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65070 --- Comment #2 from Nadav Har'El --- Hi, What was the intention behind this "intentionally"? As I mentioned above, I believe the tiny performance saving of not calling the syscall() function are minimal, because if I understand correctly it's only called in rare cases when there is contention, and when the context-switch overhead would be large anyway. And even if it's not rare, isn't the syscall overhead significantly larger than the syscall() function's additional overhead (copying a couple of registers, etc.)? Just using and syscall() would have made all this code simpler, and avoid repeating code already in glibc. Unless I'm missing something important here... Regarding OSv (see http://osv.io/), the idea there is that it is able to run unmodified Linux dynamically-linked binaries. Our C library is different (not glibc), but other libraries and executables which call libc functions can run unmodified, and libgomp should not be an exception. The plan is to take an unmodified libgomp.so from some Linux distribution and just run it, without recompiling. It's not impossible for us also to support the "syscall" instruction, but I was just wondering why we want to: libgomp is the first library we've seen to call the syscall instruction directly instead of just calling the syscall() libc function, and I was wondering if there is good justification for that.