From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18261 invoked by alias); 1 Dec 2019 14:22:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 18252 invoked by uid 89); 1 Dec 2019 14:22:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: albireo.enyo.de From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 6/7] linux: Refactor sched_getcpu in terms of getcpu References: <20191129210327.26434-1-adhemerval.zanella@linaro.org> <20191129210327.26434-6-adhemerval.zanella@linaro.org> Date: Sun, 01 Dec 2019 14:22:00 -0000 In-Reply-To: <20191129210327.26434-6-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Fri, 29 Nov 2019 18:03:26 -0300") Message-ID: <87y2vwdt1g.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-12/txt/msg00003.txt.bz2 * Adhemerval Zanella: > diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c > index 65dd9fdda7..3646c8b713 100644 > --- a/sysdeps/unix/sysv/linux/sched_getcpu.c > +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c > @@ -17,23 +17,11 @@ > > #include > #include > -#include > - > -#ifdef HAVE_GETCPU_VSYSCALL > -# define HAVE_VSYSCALL > -#endif > -#include > > int > sched_getcpu (void) > { > -#ifdef __NR_getcpu > unsigned int cpu; > - int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); > - > + int r = __getcpu (&cpu, NULL); > return r == -1 ? r : cpu; > -#else > - __set_errno (ENOSYS); > - return -1; > -#endif > } I wonder if the current state is a useful performance optimization.