Re: [patch 24/25] debugobjects: Refill per CPU pool more agressively
From: Thomas Gleixner
Date: Fri Oct 11 2024 - 16:49:48 EST
On Thu, Oct 10 2024 at 18:02, Leizhen wrote:
> On 2024/10/8 0:50, Thomas Gleixner wrote:
>> + /*
>> + * If this emptied a batch try to refill from the
>> + * free pool. Don't do that if this was the top-most
>> + * batch as pcpu_free() expects the per CPU pool
>> + * to be less than ODEBUG_POOL_PERCPU_SIZE.
>> + */
>> + if (unlikely(pcp->cnt < (ODEBUG_POOL_PERCPU_SIZE - ODEBUG_BATCH_SIZE) &&
>> + !(pcp->cnt % ODEBUG_BATCH_SIZE))) {
>
> It seems better to swap the contents on both sides of &&. Because the probability
> of the current right side is lower.
Good point!
Thanks,
tglx