Re: [PATCH] xfs: optimise xfs_mod_icount/ifree when delta < 0

From: Shaokun Zhang
Date: Mon Nov 04 2019 - 22:08:20 EST


Hi Christoph,

On 2019/11/4 23:25, Christoph Hellwig wrote:
> On Mon, Nov 04, 2019 at 07:29:40PM +0800, Shaokun Zhang wrote:
>> From: Yang Guo <guoyang2@xxxxxxxxxx>
>>
>> percpu_counter_compare will be called by xfs_mod_icount/ifree to check
>> whether the counter less than 0 and it is a expensive function.
>> let's check it only when delta < 0, it will be good for xfs's performance.
>
> How much overhead do you see? In the end the compare is just a debug

Thanks your reply, sorry for my not clear description.
__percpu_counter_compare itself is not expensive, but __percpu_counter_sum
called by __percpu_counter_compare is high load, I will list it in next thread.

> check, so if it actually shows up we should remove it entirely.
>

I'm not sure about it, so I check the delta to do less modification.

Thanks,
Shaokun

>