netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Thu, 17 Jul 2008 15:03:35 +0200	[thread overview]
Message-ID: <487F4327.1000107@trash.net> (raw)
In-Reply-To: <20080717.051726.226040470.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

David Miller wrote:
> This allows less strict control of access to the qdisc attached to a
> netdev_queue.  It is even allowed to enqueue into a qdisc which is
> in the process of being destroyed.  The RCU handler will toss out
> those packets.
> 
> We will need this to handle sharing of a qdisc amongst multiple
> TX queues.  In such a setup the lock has to be shared, so will
> be inside of the qdisc itself.  At which point the netdev_queue
> lock cannot be used to hard synchronize access to the ->qdisc
> pointer.
> 
> One operation we have to keep inside of qdisc_destroy() is the list
> deletion.  It is the only piece of state visible after the RCU quiesce
> period, so we have to undo it early and under the appropriate locking.
> 
> The operations in the RCU handler do not need any looking because the
> qdisc tree is no longer visible to anything at that point.

Still working my way through the patches, but this one caught my
eye (we had this before and it caused quite a few problems).

One of the problems is that only the uppermost qdisc is destroyed
immediately, child qdiscs are still visible on qdisc_list and are
removed without any locking from the RCU callback. There are also
visibility issues for classifiers and actions deeper down in the
hierarchy.

The previous way to work around this was quite ugly. qdisc_destroy()
walked the entire hierarchy to unlink inner classes immediately
from the qdisc_list (commit 85670cc1f changed it to what we do now).
That fixed visibility issues for everything visible only through
qdiscs (child qdiscs and classifiers). Actions are also visible
globally, so this might still be a problem, not sure though since
they don't refer to their parent (haven't thought about it much yet).

Another problem we had earlier with this was that qdiscs previously
assumed changes (destruction) would only happen in process context
and thus didn't disable BHs when taking a read_lock for walking the
hierarchy (deadlocking with write_lock in BH context). This seems to
be handled correctly in your tree by always disabling BHs.

The remaining problem is data that was previously only used and
modified under the RTNL (u32_list is one example). Modifications
during destruction now need protection against concurrent use in
process context.

I still need to get a better understanding of how things work now,
so I won't suggest a fix until then :)


--
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

  parent reply	other threads:[~2008-07-17 13:03 UTC|newest]

Thread overview: 58+ 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
     [not found] ` <20080717.051726.226040470.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-17 13:03   ` Patrick McHardy [this message]
     [not found]     ` <487F4327.1000107-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
2008-07-17 13:12       ` David Miller
2008-07-17 13:48         ` Patrick McHardy
     [not found]           ` <487F4DA6.6010009-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
2008-07-17 22:36             ` David Miller
     [not found]               ` <20080717.153609.142867331.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-17 23:58                 ` Patrick McHardy
2008-07-17 13:35       ` jamal
2008-07-17 14:02         ` Patrick McHardy
     [not found]           ` <487F50EC.80008-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
2008-07-17 22:24             ` David Miller
     [not found]               ` <20080717.152447.89672084.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
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-20 15:16                         ` jamal
2008-07-20 17:25                           ` David Miller
     [not found]                             ` <20080720.102534.246150854.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-20 17:34                               ` Tomas Winkler
     [not found]                                 ` <1ba2fa240807201034u1fbe3343tdcc858f7772d2b39-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-20 17:35                                   ` David Miller
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 16:45                                       ` David Miller
2008-07-21 11:58                                     ` Herbert Xu
     [not found]                                       ` <E1KKu2D-0002kd-00-XQvu0L+U/CjiRBuR/1fSEKKkPtS2pBon@public.gmane.org>
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
     [not found]                                                 ` <20080721135846.GA11543-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-07-21 15:09                                                   ` David Miller
     [not found]                                                     ` <20080721.080901.214889979.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-21 15:22                                                       ` Herbert Xu
2008-07-21 15:26                                                         ` David Miller
     [not found]                                                           ` <20080721.082627.128593651.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-21 16:16                                                             ` Herbert Xu
     [not found]                                                               ` <20080721161616.GA12938-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-07-21 16:25                                                                 ` David Miller
2008-07-21 16:43                                                                   ` Herbert Xu
2008-07-21 16:51                                                                     ` David Miller
     [not found]                                                                       ` <20080721.095124.89249903.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-21 17:02                                                                         ` Herbert Xu
     [not found]                                                                           ` <20080721170233.GA13417-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-07-21 17:08                                                                             ` David Miller
     [not found]                                                                               ` <20080721.100821.38432201.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-21 17:11                                                                                 ` Herbert Xu
2008-08-22  6:56                                                                                   ` Herbert Xu
2008-08-22  7:16                                                                                     ` David Miller
     [not found]                                                                                       ` <20080822.001620.141235108.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-08-22  7:41                                                                                         ` Herbert Xu
     [not found]                                                                                           ` <20080822074115.GB25615-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-08-22 10:42                                                                                             ` David Miller
     [not found]                                                                                               ` <20080822.034217.135152551.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-08-22 10:47                                                                                                 ` Herbert Xu
2008-08-22 13:52                                                                                                 ` jamal
     [not found]                                                                                     ` <20080822065655.GA18471-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-08-22 13:43                                                                                       ` jamal
2008-07-21 17:35                                         ` David Miller
2008-07-18 17:10                     ` Roland Dreier
     [not found]                       ` <adaljzz6ruq.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
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
     [not found]           ` <E1KKZmE-0000ty-00-XQvu0L+U/CjiRBuR/1fSEKKkPtS2pBon@public.gmane.org>
2008-07-20 15:35             ` jamal
2008-07-21  0:11               ` Herbert Xu
     [not found]                 ` <20080721001119.GA6515-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2008-07-21  2:33                   ` jamal
2008-07-21  3:17                     ` Herbert Xu
2008-07-21 11:14                       ` jamal
2008-07-21 11:36                         ` Herbert Xu
     [not found]                           ` <20080721113600.GA10322-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
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=487F4327.1000107@trash.net \
    --to=kaber-dcujhnylwpneowh0uzbu5w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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).