From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbdFTR2j (ORCPT ); Tue, 20 Jun 2017 13:28:39 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:33655 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbdFTR2i (ORCPT ); Tue, 20 Jun 2017 13:28:38 -0400 Date: Tue, 20 Jun 2017 13:28:35 -0400 From: Tejun Heo To: Nikolay Borisov Cc: jbacik@fb.com, jack@suse.cz, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, mgorman@techsingularity.net Subject: Re: [PATCH 1/2] percpu_counter: Rename __percpu_counter_add to percpu_counter_add_batch Message-ID: <20170620172835.GA21326@htj.duckdns.org> References: <1497958590-6639-1-git-send-email-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497958590-6639-1-git-send-email-nborisov@suse.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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