Re: [PATCH v3 3/3] debugobjects: Reduce contention on pool lock in fill_pool()

From: Leizhen (ThunderTown)
Date: Wed Oct 09 2024 - 23:33:52 EST




On 2024/10/7 22:04, Thomas Gleixner wrote:
> On Wed, Sep 11 2024 at 16:35, Zhen Lei wrote:
>> + /*
>> + * Avoid allocation and lock contention when another CPU is already
>> + * in the allocation path.
>> + */
>> + if (atomic_read(&cpus_allocating))
>> + return;
>
> Hmm. I really don't want to rely on a single CPU doing allocations in
> case that the pool level reached a critical state. That CPU might be
> scheduled out and all others are consuming objects up to the point where
> the pool becomes empty.

That makes sense, you're thoughtful.

>
> Let me integrate this into the series I'm going to post soon.
>
> Thanks,
>
> tglx
> .
>

--
Regards,
Zhen Lei