All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: Add missing __raw_write_seqcount_end() and seqcount_release()
@ 2020-11-13 21:13 Tom Zanussi
  0 siblings, 0 replies; only message in thread
From: Tom Zanussi @ 2020-11-13 21:13 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: Steven Rostedt, linux-rt-users

Hi Sebastian,

This patch fixes a problem [1] I saw when backporting 'net: Properly
annotate the try-lock for the seqlock" from 5.4 to 4.19 which also
looks like it should apply to -devel.

Thanks,

Tom

[1] https://lore.kernel.org/linux-rt-users/20201110153853.463368981@goodmis.org/T/#m0be3a1290486f3493828dedcf7f06d5fbba092a8 

---

The patch ('net: Properly annotate the try-lock for the seqlock") adds
__raw_write_seqcount_begin() in qdisc_run_begin() but omits the
corresponding __raw_write_seqcount_end() and seqcount_release() in
qdisc_run_end().

Add it unconditionally, since qdisc_run_end() is never called unless
qdisc_run_begin() succeeds, and if it succeeds,
__raw_write_seqcount_begin() seqcount_acquire() will have been called.

Signed-off-by: Tom Zanussi <zanussi@kernel.org>
---
 include/net/sch_generic.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 112d2dca8b08..c5ccce4f8f62 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -192,7 +192,11 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)
 static inline void qdisc_run_end(struct Qdisc *qdisc)
 {
 #ifdef CONFIG_PREEMPT_RT
+	seqcount_t *s = &qdisc->running.seqcount;
+
 	write_sequnlock(&qdisc->running);
+	__raw_write_seqcount_end(s);
+	seqcount_release(&s->dep_map, 1, _RET_IP_);
 #else
 	write_seqcount_end(&qdisc->running);
 #endif
-- 
2.17.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-13 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 21:13 [PATCH] net: Add missing __raw_write_seqcount_end() and seqcount_release() Tom Zanussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.