Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1373722

Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number of running thread

From Andi Kleen <andi@firstfloor.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number of running thread
Date 2016-04-07 22:30 +0200
Message-ID <rloIV-Ti-7@gated-at.bofh.it> (permalink)
References (4 earlier) <rlfvY-2qa-15@gated-at.bofh.it> <rlgin-34z-19@gated-at.bofh.it> <rll8l-6JT-3@gated-at.bofh.it> <rllrJ-6RI-43@gated-at.bofh.it> <rlnab-8bl-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> One basic use of cpu id cache is to speed up the sched_getcpu(3)
> implementation in glibc. This is why I'm proposing it as a stand-alone

I don't think rseq is needed for faster getcpu.

User space has to be able handle stale return values anyways, as it
has no way to lock itself to a cpu while it is using the return value.
So it can be only a hint.

The original version of getcpu just had a jiffies based cache. The CPU
value was valid up to a jiffie (the next time jiffie changes), and then it
gets looked up again.

Processes are unlikely to switch CPUs more often than a jiffie, so it's
good enough as a hint.
 
This doesn't need any new kernel interfaces at all because jiffies is already
exported to the vdso.

It just needs a new entry point into the vdso that handles the jiffie
check.

-Andi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v6 0/5] Thread-local ABI system call (CPU number cache) Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 19:10 +0200
  [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 19:10 +0200
    Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread "H. Peter Anvin" <hpa@zytor.com> - 2016-04-04 19:20 +0200
      Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 21:50 +0200
        Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 22:50 +0200
          Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-05 18:10 +0200
            Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Peter Zijlstra <peterz@infradead.org> - 2016-04-05 18:50 +0200
              Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 11:10 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Peter Zijlstra <peterz@infradead.org> - 2016-04-07 12:40 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 12:40 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Peter Zijlstra <peterz@infradead.org> - 2016-04-07 13:30 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 14:10 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Peter Zijlstra <peterz@infradead.org> - 2016-04-07 14:30 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 14:40 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-07 18:00 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-07 14:40 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-07 18:40 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Andy Lutomirski <luto@amacapital.net> - 2016-04-07 18:50 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-07 19:00 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 19:00 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-07 19:00 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-07 20:50 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Andi Kleen <andi@firstfloor.org> - 2016-04-07 22:30 +0200
                Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU  number of running thread Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-07 23:00 +0200
    Re: [RFC PATCH v6 1/5] Thread-local ABI system call: cache CPU number  of running thread Florian Weimer <fweimer@redhat.com> - 2016-04-07 12:50 +0200
  [RFC PATCH v6 5/5] Thread-local ABI: wire up x86 32/64 system call Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 19:10 +0200
  [RFC PATCH v6 3/5] Thread-local ABI: wire up ARM system call Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 19:10 +0200
  [RFC PATCH v6 4/5] Thread-local ABI cpu_id: x86 32/64 resume notifier Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-04 19:10 +0200

csiph-web