* [PATCH]: Kill qdisc rcu freeing...
@ 2008-08-18 5:34 David Miller
2008-08-18 12:07 ` Jarek Poplawski
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2008-08-18 5:34 UTC (permalink / raw)
To: netdev; +Cc: jarkao2, herbert
Ok, I flipped the switch. I've checked in the following to
net-2.6 and it seems to pass a bunch of smoke tests I just
did (flood pings while adding and deleting various qdisc
setups, etc.)
Jarek, I think we can possibly now revert that locking change
you had to make because destroy was outside of RTNL?
pkt_sched: No longer destroy qdiscs from RCU.
We can now kill them synchronously with all of the
previous dev_deactivate() cures.
This makes netdev destruction and shutdown saner as
the qdiscs hold references to the device.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/net/sch_generic.h | 1 -
net/sched/sch_generic.c | 27 +++++++++------------------
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 757ab08..84d25f2 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -61,7 +61,6 @@ struct Qdisc
struct gnet_stats_basic bstats;
struct gnet_stats_queue qstats;
struct gnet_stats_rate_est rate_est;
- struct rcu_head q_rcu;
int (*reshape_fail)(struct sk_buff *skb,
struct Qdisc *q);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 30b76ae..6f96b7b 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -518,14 +518,19 @@ void qdisc_reset(struct Qdisc *qdisc)
}
EXPORT_SYMBOL(qdisc_reset);
-/* this is the rcu callback function to clean up a qdisc when there
- * are no further references to it */
+/* Under qdisc_lock(qdisc) and BH! */
-static void __qdisc_destroy(struct rcu_head *head)
+void qdisc_destroy(struct Qdisc *qdisc)
{
- struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
const struct Qdisc_ops *ops = qdisc->ops;
+ if (qdisc->flags & TCQ_F_BUILTIN ||
+ !atomic_dec_and_test(&qdisc->refcnt))
+ return;
+
+ if (qdisc->parent)
+ list_del(&qdisc->list);
+
#ifdef CONFIG_NET_SCHED
qdisc_put_stab(qdisc->stab);
#endif
@@ -542,20 +547,6 @@ static void __qdisc_destroy(struct rcu_head *head)
kfree((char *) qdisc - qdisc->padded);
}
-
-/* Under qdisc_lock(qdisc) and BH! */
-
-void qdisc_destroy(struct Qdisc *qdisc)
-{
- if (qdisc->flags & TCQ_F_BUILTIN ||
- !atomic_dec_and_test(&qdisc->refcnt))
- return;
-
- if (qdisc->parent)
- list_del(&qdisc->list);
-
- call_rcu(&qdisc->q_rcu, __qdisc_destroy);
-}
EXPORT_SYMBOL(qdisc_destroy);
static bool dev_all_qdisc_sleeping_noop(struct net_device *dev)
--
1.5.6.5.GIT
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH]: Kill qdisc rcu freeing...
2008-08-18 5:34 [PATCH]: Kill qdisc rcu freeing David Miller
@ 2008-08-18 12:07 ` Jarek Poplawski
2008-08-19 5:33 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2008-08-18 12:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev, herbert
On Sun, Aug 17, 2008 at 10:34:35PM -0700, David Miller wrote:
>
> Ok, I flipped the switch. I've checked in the following to
> net-2.6 and it seems to pass a bunch of smoke tests I just
> did (flood pings while adding and deleting various qdisc
> setups, etc.)
>
> Jarek, I think we can possibly now revert that locking change
> you had to make because destroy was outside of RTNL?
Yes, I think there are these two patches only to revert:
----------
commit d4766692e72422f3b0f0e9ac6773d92baad07d51
Author: Jarek Poplawski <jarkao2@gmail.com>
Date: Wed Aug 13 15:20:24 2008 -0700
pkt_sched: Protect gen estimators under est_lock.
----------
commit 1cfa26661a85549063e369e2b40275eeaa7b923c
Author: Jarek Poplawski <jarkao2@gmail.com>
Date: Mon Aug 11 18:11:06 2008 -0700
pkt_sched: Add BH protection for qdisc_stab_lock.
----------
I guess, I don't need to send any patches, but let me know if I'm
wrong.
Thanks,
Jarek P.
>
> pkt_sched: No longer destroy qdiscs from RCU.
>
> We can now kill them synchronously with all of the
> previous dev_deactivate() cures.
>
> This makes netdev destruction and shutdown saner as
> the qdiscs hold references to the device.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
...
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH]: Kill qdisc rcu freeing...
2008-08-18 12:07 ` Jarek Poplawski
@ 2008-08-19 5:33 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2008-08-19 5:33 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, herbert
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Mon, 18 Aug 2008 12:07:25 +0000
> On Sun, Aug 17, 2008 at 10:34:35PM -0700, David Miller wrote:
> >
> > Ok, I flipped the switch. I've checked in the following to
> > net-2.6 and it seems to pass a bunch of smoke tests I just
> > did (flood pings while adding and deleting various qdisc
> > setups, etc.)
> >
> > Jarek, I think we can possibly now revert that locking change
> > you had to make because destroy was outside of RTNL?
>
> Yes, I think there are these two patches only to revert:
>
> ----------
...
> commit d4766692e72422f3b0f0e9ac6773d92baad07d51
...
> ----------
...
> commit 1cfa26661a85549063e369e2b40275eeaa7b923c
...
> ----------
>
> I guess, I don't need to send any patches, but let me know if I'm
> wrong.
Thanks, I've reverted both commits.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-19 5:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-18 5:34 [PATCH]: Kill qdisc rcu freeing David Miller
2008-08-18 12:07 ` Jarek Poplawski
2008-08-19 5:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).