mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christopher Lameter <cl@linux.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Dennis Zhou <dennis@kernel.org>,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH v2] percpu-refcount: Use normal instead of RCU-sched"
Date: Fri, 8 Nov 2019 18:17:47 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.21.1911081813330.1687@www.lameter.com> (raw)
In-Reply-To: <20191108173553.lxsdic6wa4y3ifsr@linutronix.de>

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.


  reply	other threads:[~2019-11-08 18:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 11:22 [PATCH] " Sebastian Andrzej Siewior
2019-10-02 15:08 ` Paul E. McKenney
2019-10-02 15:17   ` Sebastian Andrzej Siewior
2019-11-07  9:13 ` Sebastian Andrzej Siewior
2019-11-07 16:17   ` Dennis Zhou
2019-11-07 16:28     ` Sebastian Andrzej Siewior
2019-11-07 16:55       ` Dennis Zhou
2019-11-07 17:24         ` Sebastian Andrzej Siewior
2019-11-07 17:36           ` Dennis Zhou
2019-11-08 17:35             ` [PATCH v2] " Sebastian Andrzej Siewior
2019-11-08 18:17               ` Christopher Lameter [this message]
2019-11-11 10:44                 ` Sebastian Andrzej Siewior
2019-11-11 13:38                   ` Paul E. McKenney
2019-11-17  4:11               ` Dennis Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1911081813330.1687@www.lameter.com \
    --to=cl@linux.com \
    --cc=bigeasy@linutronix.de \
    --cc=dennis@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®