[PATCH RT v2] net: Add missing seqcount_release() to qdisc_run_end()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/20201110153853.463368981@xxxxxxxxxxx/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.

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

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 112d2dca8b08..221470e38031 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -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
-- 
2.17.1





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux