LKML Archive on lore.kernel.org
 help / color / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com,
	dipankar@in.ibm.com, akpm@linux-foundation.org,
	mathieu.desnoyers@efficios.com, josh@joshtriplett.org,
	tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
	dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com,
	oleg@redhat.com, joel@joelfernandes.org,
	Bart Van Assche <bart.vanassche@wdc.com>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Shane M Seymour <shane.seymour@hpe.com>,
	Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
	Ryder Lee <ryder.lee@mediatek.com>, Roy Luo <royluo@google.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH tip/core/rcu 01/12] rcu: Remove rcu_swap_protected()
Date: Wed, 11 Dec 2019 15:12:39 -0800
Message-ID: <20191211231239.GK2889@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <1911b7fa-c8d4-e34b-020d-3346a56f29d6@gmail.com>

On Wed, Dec 11, 2019 at 08:09:11PM +0100, Matthias Brugger wrote:
> 
> 
> On 11/12/2019 19:37, Paul E. McKenney wrote:
> > On Tue, Dec 10, 2019 at 07:51:22PM -0800, Paul E. McKenney wrote:
> >> On Tue, Dec 10, 2019 at 10:35:49PM -0500, Martin K. Petersen wrote:
> >>>
> >>> Paul,
> >>>
> >>>> Now that the calls to rcu_swap_protected() have been replaced by
> >>>> rcu_replace_pointer(), this commit removes rcu_swap_protected().
> >>>
> >>> It appears there are two callers remaining in Linus' master. Otherwise
> >>> looks good to me.
> >>
> >> I did queue a fix for one of them, and thank you for calling my
> >> attention to the new one.  This commit should hit -next soon, so
> >> hopefully this will discourage further additions.  ;-)
> >>
> >>> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> >>
> >> Thank you!
> > 
> > And here is the patch for the new one.
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 10699d92c906707d679e28b099cd798a519b4f51
> > Author: Paul E. McKenney <paulmck@kernel.org>
> > Date:   Wed Dec 11 10:30:21 2019 -0800
> > 
> >     wireless/mediatek: Replace rcu_swap_protected() with rcu_replace_pointer()
> >     
> >     This commit replaces the use of rcu_swap_protected() with the more
> >     intuitively appealing rcu_replace_pointer() as a step towards removing
> >     rcu_swap_protected().
> >     
> >     Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/
> >     Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> >     Reported-by: "Martin K. Petersen" <martin.petersen@oracle.com>
> >     Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> >     Cc: Felix Fietkau <nbd@nbd.name>
> >     Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
> >     Cc: Ryder Lee <ryder.lee@mediatek.com>
> >     Cc: Roy Luo <royluo@google.com>
> >     Cc: Kalle Valo <kvalo@codeaurora.org>
> >     Cc: "David S. Miller" <davem@davemloft.net>
> >     Cc: Matthias Brugger <matthias.bgg@gmail.com>
> >     Cc: <linux-wireless@vger.kernel.org>
> >     Cc: <netdev@vger.kernel.org>
> >     Cc: <linux-arm-kernel@lists.infradead.org>
> >     Cc: <linux-mediatek@lists.infradead.org>
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c
> > index 53b5a4b..80986ce 100644
> > --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c
> > +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c
> > @@ -281,8 +281,8 @@ void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno)
> >  {
> >  	struct mt76_rx_tid *tid = NULL;
> >  
> > -	rcu_swap_protected(wcid->aggr[tidno], tid,
> > -			   lockdep_is_held(&dev->mutex));
> > +	tid = rcu_swap_protected(wcid->aggr[tidno], tid,
> > +				 lockdep_is_held(&dev->mutex));
> 
> I suppose you meant: rcu_replace_pointer() here.

Indeed I did, and thank you for catching this!  Bad patch day here.  :-/

Update below...

							Thanx, Paul

------------------------------------------------------------------------

commit ad5572b091429a45e863acaa6a36cf396d44f58d
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Wed Dec 11 10:30:21 2019 -0800

    wireless/mediatek: Replace rcu_swap_protected() with rcu_replace_pointer()
    
    This commit replaces the use of rcu_swap_protected() with the more
    intuitively appealing rcu_replace_pointer() as a step towards removing
    rcu_swap_protected().
    
    Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/
    Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
    Reported-by: "Martin K. Petersen" <martin.petersen@oracle.com>
    [ paulmck: Apply Matthias Brugger feedback. ]
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
    Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
    Cc: Felix Fietkau <nbd@nbd.name>
    Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
    Cc: Ryder Lee <ryder.lee@mediatek.com>
    Cc: Roy Luo <royluo@google.com>
    Cc: Kalle Valo <kvalo@codeaurora.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Matthias Brugger <matthias.bgg@gmail.com>
    Cc: <linux-wireless@vger.kernel.org>
    Cc: <netdev@vger.kernel.org>
    Cc: <linux-arm-kernel@lists.infradead.org>
    Cc: <linux-mediatek@lists.infradead.org>

diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c
index 53b5a4b..59c1878 100644
--- a/drivers/net/wireless/mediatek/mt76/agg-rx.c
+++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c
@@ -281,8 +281,8 @@ void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno)
 {
 	struct mt76_rx_tid *tid = NULL;
 
-	rcu_swap_protected(wcid->aggr[tidno], tid,
-			   lockdep_is_held(&dev->mutex));
+	tid = rcu_replace_pointer(wcid->aggr[tidno], tid,
+				  lockdep_is_held(&dev->mutex));
 	if (tid) {
 		mt76_rx_aggr_shutdown(dev, tid);
 		kfree_rcu(tid, rcu_head);

  reply index

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10  4:07 [PATCH tip/core/rcu 0/12] Miscellaneous fixes for v5.6 Paul E. McKenney
2019-12-10  4:07 ` [PATCH tip/core/rcu 01/12] rcu: Remove rcu_swap_protected() paulmck
2019-12-11  3:35   ` Martin K. Petersen
2019-12-11  3:51     ` Paul E. McKenney
2019-12-11 18:37       ` Paul E. McKenney
2019-12-11 19:09         ` Matthias Brugger
2019-12-11 23:12           ` Paul E. McKenney [this message]
2019-12-12  9:31             ` Kalle Valo
     [not found]             ` <87mubxdh52.fsf@kamboji.qca.qualcomm.com>
2019-12-12 18:21               ` Paul E. McKenney
2019-12-10  4:07 ` [PATCH tip/core/rcu 02/12] rcu: Mark non-global functions and variables as static paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 03/12] rcu: Fix harmless omission of "CONFIG_" from #if condition paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 04/12] rcu: Fix tracepoint tracking RCU CPU kthread utilization paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 05/12] rcu: Remove the declaration of call_rcu() in tree.h paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 06/12] rcu: Move gp_state_names[] and gp_state_getname() to tree_stall.h paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 07/12] rcu: Move rcu_{expedited,normal} definitions into rcupdate.h paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 08/12] rcu: Switch force_qs_rnp() to for_each_leaf_node_cpu_mask() paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 09/12] srcu: Apply *_ONCE() to ->srcu_last_gp_end paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 10/12] .mailmap: Add entries for old paulmck@kernel.org addresses paulmck
2019-12-11 19:03   ` Florian Fainelli
2019-12-11 23:14     ` Paul E. McKenney
2019-12-10  4:07 ` [PATCH tip/core/rcu 11/12] powerpc: Remove comment about read_barrier_depends() paulmck
2019-12-10  4:07 ` [PATCH tip/core/rcu 12/12] rcu: Remove unused stop-machine #include paulmck

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=20191211231239.GK2889@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bart.vanassche@wdc.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=jthumshirn@suse.de \
    --cc=kernel-team@fb.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=martin.petersen@oracle.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mingo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=royluo@google.com \
    --cc=ryder.lee@mediatek.com \
    --cc=shane.seymour@hpe.com \
    --cc=tglx@linutronix.de \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git