Skip to contentSkip to conversation

net: Add missing seqcount_release() to qdisc_run_end()

PATCH In review Tom Zanussi 3 participants 3 messages Nov 14, 2020 – Nov 16, 2020 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: Add missing seqcount_release() to qdisc_run_end()

Hi Sebastian and Steve,

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.

This was tested on 5.14 but applies cleanly to rt-devel as well.

Thanks,

Tom

[1] https://lore.kernel.org/linux-rt-users/[email protected]/T/#m0be3a1290486f3493828dedcf7f06d5fbba092a8

v2: Mike Galbraith pointed out that write_sequnlock() already contains __raw_write_seqcount_end().

---
The patch ('net: Properly annotate the try-lock for the seqlock") adds a seqcount_acquire() in qdisc_run_begin() but omits the corresponding 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, seqcount_acquire() will have been called.

---
 include/net/sch_generic.h | 3 +++
 1 file changed, 3 insertions(+)
include/net/sch_generic.h +3 -0
index 112d2dca8b08..221470e38031 100644
@@ -192,7 +192,10 @@ 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);
+	seqcount_release(&s->dep_map, 1, _RET_IP_);
 #else
 	write_seqcount_end(&qdisc->running);
 #endif
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Tom Zanussi

Hi Sebastian and Steve,

Hi Tom,

Quoted 5 lines

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.

This was tested on 5.14 but applies cleanly to rt-devel as well.

as just explained in the other thread, I would recommend to simply drop that backported patch instead. There should be no splat in the devel tree.

Quoted 3 lines

Thanks,

Tom

Sebastian

#2 lore raw
Quoted 5 lines · On Mon, 16 Nov 2020 18:22:21 +0100 Sebastian Andrzej Siewior…
Quoted 1 line

This was tested on 5.14 but applies cleanly to rt-devel as well.

as just explained in the other thread, I would recommend to simply drop that backported patch instead. There should be no splat in the devel tree.

I'll do that. Thanks!

-- Steve