All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: Denys Fedoryshchenko <denys@visp.net.lb>,
	netdev@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>
Subject: [PATCH] pkt_sched: Fix qdisc state in net_tx_action()
Date: Fri, 5 Sep 2008 08:29:15 +0000	[thread overview]
Message-ID: <20080905082915.GA7320@ff.dom.local> (raw)
In-Reply-To: <200809050143.27998.denys@visp.net.lb>

On 05-09-2008 00:43, Denys Fedoryshchenko wrote:
> I catch it!!!! And it is not ppp seems.
...
> Here is command that stuck. ifconfig, tc doesn't work, and seems 
> even sockets cannot be created (i cannot open new ssh connection 
> from this router, but i can ssh to existing socket).
> 
> I trigger this bug on latest git too.
> 
> 
>   PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
> 11593     1 root     R     2048  0.1 47.5 tc qdisc del dev ifb0 root
...

Great!!!!

Alas these logs are not very clear, but while browsing the code I
think I found one of possible reasons around this (but I'm not sure
this is all...).

Thanks,
Jarek P.

------------>

pkt_sched: Fix qdisc state in net_tx_action()

net_tx_action() can skip __QDISC_STATE_SCHED bit clearing while qdisc
is neither ran nor rescheduled, which may cause endless loop in
dev_deactivate().

Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

---

 net/core/dev.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 60c51f7..e719ed2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1991,8 +1991,13 @@ static void net_tx_action(struct softirq_action *h)
 				spin_unlock(root_lock);
 			} else {
 				if (!test_bit(__QDISC_STATE_DEACTIVATED,
-					      &q->state))
+					      &q->state)) {
 					__netif_reschedule(q);
+				} else {
+					smp_mb__before_clear_bit();
+					clear_bit(__QDISC_STATE_SCHED,
+						  &q->state);
+				}
 			}
 		}
 	}

  reply	other threads:[~2008-09-05  8:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 11:22 BUG? locking issue(networking?) with latest git Denys Fedoryshchenko
2008-09-04  7:21 ` Jarek Poplawski
2008-09-04  9:03   ` Denys Fedoryshchenko
2008-09-04  9:38     ` Jarek Poplawski
2008-09-04  9:46       ` Denys Fedoryshchenko
2008-09-04 10:02         ` Jarek Poplawski
2008-09-04 10:11           ` Denys Fedoryshchenko
2008-09-04 14:14           ` Denys Fedoryshchenko
2008-09-04 21:48             ` Jarek Poplawski
2008-09-04 22:43               ` Denys Fedoryshchenko
2008-09-05  8:29                 ` Jarek Poplawski [this message]
2008-09-05 10:26                   ` [PATCH] pkt_sched: Fix qdisc state in net_tx_action() Herbert Xu
2008-09-05 22:41                   ` Denys Fedoryshchenko
2008-09-06 12:02                     ` Jarek Poplawski
2008-09-08  1:41                       ` 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=20080905082915.GA7320@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=davem@davemloft.net \
    --cc=denys@visp.net.lb \
    --cc=herbert@gondor.apana.org.au \
    --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.