Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Mathieu Desnoyers
- On Jul 6, 2020, at 2:11 PM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> - On Jul 6, 2020, at 1:50 PM, Florian Weimer fwei...@redhat.com wrote: >> >>> * Mathieu Desnoyers: >>> Now we need to discuss how we introduce that fix in a way that will allow us

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Florian Weimer
* Mathieu Desnoyers: > - On Jul 6, 2020, at 1:50 PM, Florian Weimer fwei...@redhat.com wrote: > >> * Mathieu Desnoyers: >> >>> Now we need to discuss how we introduce that fix in a way that will >>> allow user-space to trust the __rseq_abi.cpu_id field's content. >> >> I don't think that's n

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Mathieu Desnoyers
- On Jul 6, 2020, at 1:50 PM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> Now we need to discuss how we introduce that fix in a way that will >> allow user-space to trust the __rseq_abi.cpu_id field's content. > > I don't think that's necessary. We can mention it in

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Florian Weimer
* Mathieu Desnoyers: > Now we need to discuss how we introduce that fix in a way that will > allow user-space to trust the __rseq_abi.cpu_id field's content. I don't think that's necessary. We can mention it in the glibc distribution notes on the wiki. > The usual approach to kernel bug fixing

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Mathieu Desnoyers
- On Jul 6, 2020, at 10:49 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jul 6, 2020, at 9:59 AM, Florian Weimer fwei...@redhat.com wrote: > >> * Mathieu Desnoyers: >> >>> When available, use the cpu_id field from __rseq_abi on Linux to >>> implement sched_getcpu().

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Mathieu Desnoyers
- On Jul 6, 2020, at 9:59 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> When available, use the cpu_id field from __rseq_abi on Linux to >> implement sched_getcpu(). Fall-back on the vgetcpu vDSO if >> unavailable. > > I've pushed this to glibc master, but unfortu

Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9)

2020-07-06 Thread Florian Weimer
* Mathieu Desnoyers: > When available, use the cpu_id field from __rseq_abi on Linux to > implement sched_getcpu(). Fall-back on the vgetcpu vDSO if > unavailable. I've pushed this to glibc master, but unfortunately it looks like this exposes a kernel bug related to affinity mask changes. After