Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2856882ybx; Fri, 8 Nov 2019 10:19:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwKEC1qaX+MSbc1SSOvU0vZb1uqzPscITJwuL+s19rymmMCmu6X2Jc5aAmFLSwhTUaHFcdP X-Received: by 2002:a50:cd14:: with SMTP id z20mr11735897edi.226.1573237145037; Fri, 08 Nov 2019 10:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573237145; cv=none; d=google.com; s=arc-20160816; b=Vsu6u1klOFEPS+N48KTa0QByTk5b9LZmhWqpHXyTDteAusy+06iuWvKNwjTCC3/o/h atA3dVzp7ZidqBRyICrO0KgniNGZfqpHDp00cc8D5A9r/CvBh4emXNKBmHk501ixCLz2 +NxTN1wIQysqlYTk1yTlU0mAWNRYO1Up8vlofEwPKVj1T4mAE274BRM6OCrg/h13HMo1 cRLKQ0W3UabraN99GUqMnP/r/xMJPBX7vNf5YSd/9mIQBc33ybW6qd0uFOPUhc6UuD4h B1ecdvsXpiy1COE+kFNXb0gQmIOonhpK3OWVA/F6xYduVg9/rfb5Y1KrsNRJRqIqwP8F rOFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=XgCtFmIi2dbtsuRddYU526EmkZAX2X47EBvAZvQclcM=; b=0ZKlSkFkJ8kfJO9FAPUdPI8RBXICS9aIbKiHC5jzShPlk5HTGMKm89ZLXAL6mbhu3n LHsdTXlsdKpKva0BHZLfbPcDGTmFYDzyk6Njp2BTw+RSA+jKP5SPwVtm9Co6hJqHbyCA sst68vhtmL/NP2mFXwhq320wgqsL9HV1fpTiBMN55HrwvrQa24x40d94G0f0ttjxVGrd gnb9Mo9yPst/Jhf4ekMbut3iVcyRWW2jzv+swhGb6XZiMQVwcQx9Gh2RW/+L/G9PdDq1 R2nfoxMYQtrLtHi/VsmKmLBjBQM/HcLkFnyBEXENJcsySOrvGL3UmlIXNcVLO6LgN3g0 Xx9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i30si5405207edd.124.2019.11.08.10.18.42; Fri, 08 Nov 2019 10:19:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbfKHSRs (ORCPT + 99 others); Fri, 8 Nov 2019 13:17:48 -0500 Received: from gentwo.org ([3.19.106.255]:39048 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfKHSRs (ORCPT ); Fri, 8 Nov 2019 13:17:48 -0500 Received: by gentwo.org (Postfix, from userid 1002) id 979943E957; Fri, 8 Nov 2019 18:17:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 967713E89A; Fri, 8 Nov 2019 18:17:47 +0000 (UTC) Date: Fri, 8 Nov 2019 18:17:47 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Sebastian Andrzej Siewior cc: Dennis Zhou , linux-kernel@vger.kernel.org, Tejun Heo , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" Subject: Re: [PATCH v2] percpu-refcount: Use normal instead of RCU-sched" In-Reply-To: <20191108173553.lxsdic6wa4y3ifsr@linutronix.de> Message-ID: References: <20191002112252.ro7wpdylqlrsbamc@linutronix.de> <20191107091319.6zf5tmdi54amtann@linutronix.de> <20191107161749.GA93945@dennisz-mbp> <20191107162842.2qgd3db2cjmmsxeh@linutronix.de> <20191107165519.GA99408@dennisz-mbp> <20191107172434.ylz4hyxw4rbmhre2@linutronix.de> <20191107173653.GA1242@dennisz-mbp> <20191108173553.lxsdic6wa4y3ifsr@linutronix.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Nov 2019, Sebastian Andrzej Siewior wrote: > diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h > index 7aef0abc194a2..390031e816dcd 100644 > --- a/include/linux/percpu-refcount.h > +++ b/include/linux/percpu-refcount.h > @@ -186,14 +186,14 @@ static inline void percpu_ref_get_many(struct percpu_ref *ref, unsigned long nr) > { > unsigned long __percpu *percpu_count; > > - rcu_read_lock_sched(); > + rcu_read_lock(); > > if (__ref_is_percpu(ref, &percpu_count)) > this_cpu_add(*percpu_count, nr); You can use __this_cpu_add() instead since rcu_read_lock implies preempt disable. This will not change the code for x86 but other platforms that do not use atomic operation here will be able to avoid including to code to disable preempt for the per cpu operations. Same is valid for all other per cpu operations in the patch.