All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, johannes@sipsolutions.net,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 20/31]: pkt_sched: Perform bulk of qdisc destruction in RCU.
Date: Fri, 18 Jul 2008 01:58:02 +0200	[thread overview]
Message-ID: <487FDC8A.9090101@trash.net> (raw)
In-Reply-To: <20080717.153609.142867331.davem@davemloft.net>

David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Thu, 17 Jul 2008 15:48:22 +0200
> 
>> One thought that occured to me - we could avoid all the visiblity
>> issues wrt. dev->qdisc_list by simply getting rid of it :)
>>
>> If we move the qdisc list from the device to the root Qdisc itself,
>> it would become invisible automatically as soon as we assign a new
>> root qdisc to the netdev_queue. Iteration would become slightly
>> more complicated since we'd have to iterate over all netdev_queues,
>> but I think it should avoid most of the problems I mentioned
>> (besides the u32_list thing).
> 
> What might make sense is to have a special Qdisc_root structure which
> is simply:
> 
> struct Qdisc_root {
> 	struct Qdisc		qd;
> 	struct list_head	qdisc_list;
> };
> 
> Everything about tree level synchronization would be type explicit.

Device level grafting is also explicit, so that looks like
a clean way.

> Yes, as you say, the qdisc iteration would get slightly ugly.  But
> that doesn't seem to be a huge deal.
> 
> But it seems a clean solution to the child qdisc visibility problem.
> 
> About u32_list, that thing definitely needs some spinlock.  The
> consultation of that list, and refcount mods, only occur during config
> operations.  So it's not like we have to grab this lock in the data
> paths.
> 
> If we really want to sweep this problem under the rug, there is another
> way.  Have the qdisc_destroy() RCU handler kick off a workqueue, and
> grab the RTNL semaphore there during the final destruction calls. :-)

That would be the safe way. The RCU destruction used to cause us
bugs for at least two years, but I actually believe the Qdisc_root
thing will work :)

WARNING: multiple messages have this Message-ID (diff)
From: Patrick McHardy <kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 20/31]: pkt_sched: Perform bulk of qdisc destruction in RCU.
Date: Fri, 18 Jul 2008 01:58:02 +0200	[thread overview]
Message-ID: <487FDC8A.9090101@trash.net> (raw)
In-Reply-To: <20080717.153609.142867331.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

David Miller wrote:
> From: Patrick McHardy <kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
> Date: Thu, 17 Jul 2008 15:48:22 +0200
> 
>> One thought that occured to me - we could avoid all the visiblity
>> issues wrt. dev->qdisc_list by simply getting rid of it :)
>>
>> If we move the qdisc list from the device to the root Qdisc itself,
>> it would become invisible automatically as soon as we assign a new
>> root qdisc to the netdev_queue. Iteration would become slightly
>> more complicated since we'd have to iterate over all netdev_queues,
>> but I think it should avoid most of the problems I mentioned
>> (besides the u32_list thing).
> 
> What might make sense is to have a special Qdisc_root structure which
> is simply:
> 
> struct Qdisc_root {
> 	struct Qdisc		qd;
> 	struct list_head	qdisc_list;
> };
> 
> Everything about tree level synchronization would be type explicit.

Device level grafting is also explicit, so that looks like
a clean way.

> Yes, as you say, the qdisc iteration would get slightly ugly.  But
> that doesn't seem to be a huge deal.
> 
> But it seems a clean solution to the child qdisc visibility problem.
> 
> About u32_list, that thing definitely needs some spinlock.  The
> consultation of that list, and refcount mods, only occur during config
> operations.  So it's not like we have to grab this lock in the data
> paths.
> 
> If we really want to sweep this problem under the rug, there is another
> way.  Have the qdisc_destroy() RCU handler kick off a workqueue, and
> grab the RTNL semaphore there during the final destruction calls. :-)

That would be the safe way. The RCU destruction used to cause us
bugs for at least two years, but I actually believe the Qdisc_root
thing will work :)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-07-17 23:58 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 12:17 [PATCH 20/31]: pkt_sched: Perform bulk of qdisc destruction in RCU David Miller
2008-07-17 12:17 ` David Miller
2008-07-17 13:03 ` Patrick McHardy
2008-07-17 13:03   ` Patrick McHardy
2008-07-17 13:12   ` David Miller
2008-07-17 13:12     ` David Miller
2008-07-17 13:48     ` Patrick McHardy
2008-07-17 22:36       ` David Miller
2008-07-17 22:36         ` David Miller
2008-07-17 23:58         ` Patrick McHardy [this message]
2008-07-17 23:58           ` Patrick McHardy
2008-07-17 13:35   ` jamal
2008-07-17 13:35     ` jamal
2008-07-17 14:02     ` Patrick McHardy
2008-07-17 22:24       ` David Miller
2008-07-17 22:24         ` David Miller
2008-07-17 23:48         ` Patrick McHardy
2008-07-17 23:48           ` Patrick McHardy
2008-07-18 13:10           ` jamal
2008-07-18 13:27             ` jamal
2008-07-18 21:05               ` David Miller
2008-07-18 21:05                 ` David Miller
2008-07-20 15:16                 ` jamal
2008-07-20 17:25                   ` David Miller
2008-07-20 17:34                     ` Tomas Winkler
2008-07-20 17:34                       ` Tomas Winkler
2008-07-20 17:35                       ` David Miller
2008-07-20 17:35                         ` David Miller
2008-07-20 22:32                     ` jamal
2008-07-20 22:32                       ` jamal
2008-07-20 23:59                       ` David Miller
2008-07-21  2:20                         ` jamal
2008-07-21 11:20                           ` jamal
2008-07-21 11:20                             ` jamal
2008-07-21 16:45                             ` David Miller
2008-07-21 11:58                           ` Herbert Xu
2008-07-21 11:58                             ` Herbert Xu
2008-07-21 13:08                             ` jamal
2008-07-21 13:08                               ` jamal
2008-07-21 13:19                               ` Herbert Xu
2008-07-21 13:56                                 ` jamal
2008-07-21 13:58                                   ` Herbert Xu
2008-07-21 15:09                                     ` David Miller
2008-07-21 15:09                                       ` David Miller
2008-07-21 15:22                                       ` Herbert Xu
2008-07-21 15:22                                         ` Herbert Xu
2008-07-21 15:26                                         ` David Miller
2008-07-21 16:16                                           ` Herbert Xu
2008-07-21 16:16                                             ` Herbert Xu
2008-07-21 16:25                                             ` David Miller
2008-07-21 16:25                                               ` David Miller
2008-07-21 16:43                                               ` Herbert Xu
2008-07-21 16:51                                                 ` David Miller
2008-07-21 17:02                                                   ` Herbert Xu
2008-07-21 17:02                                                     ` Herbert Xu
2008-07-21 17:08                                                     ` David Miller
2008-07-21 17:08                                                       ` David Miller
2008-07-21 17:11                                                       ` Herbert Xu
2008-07-21 17:11                                                         ` Herbert Xu
2008-08-22  6:56                                                         ` Herbert Xu
2008-08-22  7:16                                                           ` David Miller
2008-08-22  7:41                                                             ` Herbert Xu
2008-08-22  7:41                                                               ` Herbert Xu
2008-08-22 10:42                                                               ` David Miller
2008-08-22 10:42                                                                 ` David Miller
2008-08-22 10:47                                                                 ` Herbert Xu
2008-08-22 10:47                                                                   ` Herbert Xu
2008-08-22 13:52                                                                 ` jamal
2008-08-22 13:52                                                                   ` jamal
2008-08-22 13:43                                                           ` jamal
2008-08-22 13:43                                                             ` jamal
2008-07-21 17:35                             ` David Miller
2008-07-21 17:35                               ` David Miller
2008-07-18 17:10             ` Roland Dreier
2008-07-18 17:10               ` Roland Dreier
2008-07-20 14:58               ` jamal
2008-07-20 14:58                 ` jamal
2008-07-20 14:32         ` Herbert Xu
2008-07-20 17:20           ` David Miller
2008-07-20 14:20     ` Herbert Xu
2008-07-20 14:20       ` Herbert Xu
2008-07-20 15:35       ` jamal
2008-07-20 15:35         ` jamal
2008-07-21  0:11         ` Herbert Xu
2008-07-21  2:33           ` jamal
2008-07-21  2:33             ` jamal
2008-07-21  3:17             ` Herbert Xu
2008-07-21  3:17               ` Herbert Xu
2008-07-21 11:14               ` jamal
2008-07-21 11:36                 ` Herbert Xu
2008-07-21 11:39                   ` jamal
2008-07-21 11:39                     ` jamal
2008-07-19  3:59   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487FDC8A.9090101@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.