[PATCH] linux: Simplify get_nprocs
Adhemerval Zanella
adhemerval.zanella@linaro.org
Tue Jul 13 19:04:56 GMT 2021
On 13/07/2021 16:03, Adhemerval Zanella wrote:
>
>
> On 13/07/2021 15:39, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> On 13/07/2021 11:38, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>> This patch simplifies the memory allocation code and uses the sched
>>>>> routines instead of reimplement it. This still uses a stack
>>>>> allocation buffer, so it can be used on malloc initialization code.
>>>>
>>>> Could you add a run-time test for that limit? With the added test, I
>>>> think this is fine.
>>>
>>> What kind of test? To check if on a larger system with more than 32k
>>> logical CPU the value is capped?
>>
>> Sorry, no, to check that sched_getaffiny with a 4K buffer succeeds.
>
> Ah right, I will work on it.
>
Although currently we already call get_nprocs on some internal usages
(malloc for instance) and I haven't see any regression with my change.
Do we really need to add an explicit test for it?
More information about the Libc-alpha
mailing list