# Re: \[RFC PATCH\] getcpu\_cache system call: caching current CPU number (x86)

- From: Andrew Hunter \<hidden\>
- Date: 2015-07-13 15:30:42 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2015/07/13329226
- Thread: https://ratatoskr.run/linux-api/2015/07/13329226/t.md

```text
On Mon, Jul 13, 2015 at 8:27 AM, Mathieu Desnoyers
[ref] wrote:
> percpu segments will likely not solve everything. I have a use-case
> with dynamically allocated per-cpu ring buffer in user-space (lttng-ust)
> which can be a challenge for percpu segments. Having a fast getcpu()
> is a win in those cases.
>

Note that percpu segments allow userspace to trivially implement fast getcpu.

For the record, Paul and I currently think the best solution is percpu
segments + some variant of a restart-sequence API (we'll have a patch
soon.)
```
