Skip to contentSkip to conversation

mld: convert from timer to delayed work

PATCH Superseded Taehee Yoo 1 participant 1 message Feb 8, 2021

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 4/8 mld: convert from timer to delayed work

mcast.c has several timers for delaying works.
Timer's expire handler is working under BH context so it can't use sleepable things such as GFP_KERNEL, mutex, etc.
In order to use sleepable APIs, it converts from timers to delayed work. But there are some critical sections, which is used by both process and BH context. So that it still uses spin_lock_bh() and rwlock.

---
 include/net/if_inet6.h |   8 +--
 net/ipv6/mcast.c       | 141 ++++++++++++++++++++++++-----------------
 2 files changed, 86 insertions(+), 63 deletions(-)
include/net/if_inet6.h +4 -4
index cd17b756a2a5..096c0554d199 100644
@@ -120,7 +120,7 @@ struct ifmcaddr6 {
 	unsigned int		mca_sfmode;
 	unsigned char		mca_crcount;
 	unsigned long		mca_sfcount[2];
-	struct timer_list	mca_timer;
+	struct delayed_work	mca_work;
 	unsigned int		mca_flags;
 	int			mca_users;
 	refcount_t		mca_refcnt;
@@ -178,9 +178,9 @@ struct inet6_dev {
 	unsigned long		mc_qri;		/* Query Response Interval */
 	unsigned long		mc_maxdelay;
 
-	struct timer_list	mc_gq_timer;	/* general query timer */
-	struct timer_list	mc_ifc_timer;	/* interface change timer */
-	struct timer_list	mc_dad_timer;	/* dad complete mc timer */
+	struct delayed_work	mc_gq_work;	/* general query work */
+	struct delayed_work	mc_ifc_work;	/* interface change work */
+	struct delayed_work	mc_dad_work;	/* dad complete mc work */
 
 	struct ifacaddr6	*ac_list;
 	rwlock_t		lock;
net/ipv6/mcast.c +82 -59

351 lines not on this page · raw message

Signature · 1 line
2.17.1