unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: RFC: Add getcpu wrapper
Date: Wed, 05 Dec 2018 16:48:43 +0100	[thread overview]
Message-ID: <87lg54gejo.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOqEeSY7H-MQybk=wuR4aK4juTNj5dGK1CvjYkxExYOAuw@mail.gmail.com> (H. J. Lu's message of "Wed, 5 Dec 2018 07:40:12 -0800")

* H. J. Lu:

> On Wed, Dec 5, 2018 at 7:35 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu:
>>
>> > returns such info.  But syscall () is too slow.  I'd like to add a wrapper to
>> > glibc.   Any comments?
>>
>> We already have it as sched_getcpu, I think.
>>
>
> We have
>
> int
> sched_getcpu (void)
> {
> #ifdef __NR_getcpu
>   unsigned int cpu;
>   int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL);
>
>   ^^^^^  I need the node info.
>
>   return r == -1 ? r : cpu;
> #else
>   __set_errno (ENOSYS);
>   return -1;
> #endif
> }

Ah, so you want to pass a non-null second argument to getcpu?

I think we can expose getcpu (with two arguments), under that name.  Add
it to <sched.h> or <unistd.h>; I do not have a strong preference.

Thanks,
Florian

  reply	other threads:[~2018-12-05 15:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 14:29 RFC: Add getcpu wrapper H.J. Lu
2018-12-05 15:35 ` Florian Weimer
2018-12-05 15:40   ` H.J. Lu
2018-12-05 15:48     ` Florian Weimer [this message]
2018-12-05 16:00       ` Zack Weinberg
2018-12-05 16:04         ` H.J. Lu
2018-12-05 17:33 ` Carlos O'Donell
2018-12-05 17:41   ` [PATCH] Add getcpu H.J. Lu
2018-12-05 18:13     ` H.J. Lu
2018-12-05 18:48     ` Florian Weimer
2018-12-05 19:50       ` H.J. Lu
2018-12-05 19:57         ` Florian Weimer
2018-12-05 20:07           ` H.J. Lu
2018-12-05 20:14             ` H.J. Lu
2018-12-07 12:50               ` Tulio Magno Quites Machado Filho
2018-12-07 14:49                 ` H.J. Lu
2018-12-05 20:43       ` Joseph Myers
2018-12-05 20:56         ` The future of the manual (was Re: [PATCH] Add getcpu) Zack Weinberg
2018-12-05 21:28           ` Joseph Myers
2018-12-07 13:11           ` Florian Weimer
2018-12-05 21:39         ` [PATCH] Add getcpu H.J. Lu
2018-12-05 21:45           ` Joseph Myers
2018-12-05 21:55           ` Florian Weimer
2018-12-06 20:26             ` H.J. Lu
2018-12-07 16:51               ` Florian Weimer
2018-12-07 17:01                 ` H.J. Lu
2018-12-07 17:15                   ` Florian Weimer
2018-12-07 20:29                     ` [PATCH] Don't use __typeof__ (getcpu) H.J. Lu
2018-12-07 20:38                       ` Samuel Thibault
2018-12-07 20:49                         ` H.J. Lu
2018-12-10 12:20     ` [PATCH] Add getcpu Szabolcs Nagy
2018-12-10 12:22       ` Florian Weimer

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=87lg54gejo.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.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).