[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a6937b9-08b1-0f52-18db-13e17e344786@intel.com>
Date: Tue, 6 Sep 2022 16:41:55 +0800
From: "Sun, Jiebin" <jiebin.sun@...el.com>
To: Shakeel Butt <shakeelb@...gle.com>
Cc: akpm@...ux-foundation.org, vasily.averin@...ux.dev,
dennis@...nel.org, tj@...nel.org, cl@...ux.com,
ebiederm@...ssion.com, legion@...nel.org, manfred@...orfullife.com,
alexander.mikhalitsyn@...tuozzo.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, tim.c.chen@...el.com,
feng.tang@...el.com, ying.huang@...el.com, tianyou.li@...el.com,
wangyang.guo@...el.com, jiebin.sun@...el.com
Subject: Re: [PATCH v2 1/2] percpu: Add percpu_counter_add_local
On 9/6/2022 3:31 AM, Shakeel Butt wrote:
> On Tue, Sep 06, 2022 at 03:35:16AM +0800, Jiebin Sun wrote:
>> Add percpu_counter_add_local for only updating local counter
>> without aggregating to global counter.
> Please add why do we need this. Who should use this and who shouldn't.
Thanks. I have added the code comment and change log in patch v3 and
provided
the info who should use it and who shouldn't.
>
>> Signed-off-by: Jiebin Sun <jiebin.sun@...el.com>
> [...]
>
>> diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
>> index ed610b75dc32..d33cb750962a 100644
>> --- a/lib/percpu_counter.c
>> +++ b/lib/percpu_counter.c
>> @@ -72,6 +72,12 @@ void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
>> }
>> EXPORT_SYMBOL(percpu_counter_set);
>>
> Add a doc comment here on why someone want to use this?
>
>> +void percpu_counter_add_local(struct percpu_counter *fbc, s64 amount)
>> +{
>> + this_cpu_add(*fbc->counters, amount);
>> +}
>> +EXPORT_SYMBOL(percpu_counter_add_local);
>> +
>> /*
>> * This function is both preempt and irq safe. The former is due to explicit
>> * preemption disable. The latter is guaranteed by the fact that the slow path
>> --
>> 2.31.1
>>
Powered by blists - more mailing lists