[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170620172835.GA21326@htj.duckdns.org>
Date: Tue, 20 Jun 2017 13:28:35 -0400
From: Tejun Heo <tj@...nel.org>
To: Nikolay Borisov <nborisov@...e.com>
Cc: jbacik@...com, jack@...e.cz, linux-kernel@...r.kernel.org,
hannes@...xchg.org, mgorman@...hsingularity.net
Subject: Re: [PATCH 1/2] percpu_counter: Rename __percpu_counter_add to
percpu_counter_add_batch
Hello, Nikolay.
On Tue, Jun 20, 2017 at 02:36:29PM +0300, Nikolay Borisov wrote:
> 252e0ba6b77d ("lib: percpu_counter variable batch") added a batched version
> of percpu_counter_add. However, one problem with this patch is the fact that it
> overloads the meaning of double underscore, which in kernel-land are taken
> to implicitly mean there is no preempt protection for the API. Currently, in
I don't think the above holds. We use __ for quite a few different
things. Sometimes it denotes internal functions which shouldn't be
used outside a subsystem, sometimes just more explicit / verbose
versions of certain operations, at other times less protection against
preemption / irq / whatever.
> both !SMP and SMP configs percpu_counter_add calls __percpu_counter_add which
> is preempt safe due to explicit calls to preempt_disable. This state of play
> creates the false sense that __percpu_counter_add is less SMP-safe than
> percpu_counter_add. They are both identical irrespective of CONFIG_SNMP value.
> The only difference is that the __ version takes a batch parameter.
>
> Make this a bit more explicit by just renaming __percpu_counter_add to
> percpu_counter_add_batch.
I'm all for making the function name more explicit, but can you please
drop the first part of the commit description?
Thanks.
--
tejun
Powered by blists - more mailing lists