netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nuno Silva <nuno.silva@vgertech.com>
To: linux-kernel@vger.kernel.org
Cc: "Vladimir B. Savkin" <master@sectorb.msk.ru>, netdev@oss.sgi.com
Subject: Re: 2.6.8-rc4-bk1 problem: unregister_netdevice: waiting for ppp0 to become free. Usage count = 1
Date: Sun, 22 Aug 2004 03:13:55 +0100	[thread overview]
Message-ID: <41280163.1050508@vgertech.com> (raw)
In-Reply-To: <411D2625.2070908@vgertech.com>

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

Nuno Silva wrote:
> Vladimir B. Savkin wrote:
> | On Thu, Aug 12, 2004 at 08:18:28PM +0100, Nuno Silva wrote:
> |
> |>Hi!
> |>
> |>With 2.6.8-rc4-bk1 I get "Aug 12 17:33:10 puma kernel:
> |>unregister_netdevice: waiting for ppp0 to become free. Usage count = 1"
> |>in the logs after pppd exit.
> |>
> |>Also, the box won't reboot and print that message forever in the
> |>console. sysrq-U && sysrq-R did it :-)
> |>
> |>The last version I tried was 2.6.8-rc2-bk11 and, wrt this prob, is
> |>running fine. So, the problem is in that window and the changelog for
> |>rc4 mentions something about ppp:
> |>http://kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.8-rc4
> |>
> |>If someone requires more information or tests feel free to ask!
> |
> |
> | I saw this too, with 2.6.7-rc3-mm1.
> | I have discovered that it happens because of idle TCP socket
> | holds a reference to a network device.
> | After killing associated process, device was freed immediately.
> |
> 
> I waited for 5 mins before sysrq-U && sysrq-R.
> Anyway, if I 'killall pppd' and then issue 'ifconfig -a' the ifconfig
> command will hang.
> 
> This didn't happen with 2.6.8-rc2-bk11 (the one I'm running now), so
> something changed... I'm I the only one with ppp/pppd/pppoe who tried
> 2.6.8-rc4-bk1? :-) Any success reports?
> 

OK, I just tested again and the problem persists. However this time I 
had some spare moments so I rebooted a few times to isolate the problem.

The problem is in the QoS code. If I start ppp whithout the 
/etc/ppp/ip-up.d/wshaper script everything is fine. If I try the 
wshaper.htb it's also fine. So, I'd say that the problem is in the CBQ 
section. This time I waited for 1 hour and got hundreds of 
"unregister_netdevice: waiting for ppp0 to become free. Usage count = 1" 
in the console/syslog. pppd eats 99% CPU. ifconfig freezes. Even reboot 
isn't possible without sysrq's help.

This problem was introduced between 2.6.8-rc2-bk11 and 2.6.8-rc4-bk1 and 
always happens. Right now I'm testing with 2.6.8.1 with a patch from Mr. 
Miller -- "cacheline-align qdisc data in qdisc_create()" (attached).

If someone needs more details feel free to ask!

Regards,
Nuno Silva


[-- Attachment #2: qdisc.diff --]
[-- Type: text/x-patch, Size: 1816 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/15 19:33:16-07:00 kaber@trash.net 
#   [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_api.c
#   2004/08/15 19:32:59-07:00 kaber@trash.net +13 -8
#   [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c	2004-08-19 07:33:10 -07:00
+++ b/net/sched/sch_api.c	2004-08-19 07:33:10 -07:00
@@ -389,7 +389,8 @@
 {
 	int err;
 	struct rtattr *kind = tca[TCA_KIND-1];
-	struct Qdisc *sch = NULL;
+	void *p = NULL;
+	struct Qdisc *sch;
 	struct Qdisc_ops *ops;
 	int size;
 
@@ -407,12 +408,18 @@
 	if (ops == NULL)
 		goto err_out;
 
-	size = sizeof(*sch) + ops->priv_size;
+	/* ensure that the Qdisc and the private data are 32-byte aligned */
+	size = ((sizeof(*sch) + QDISC_ALIGN_CONST) & ~QDISC_ALIGN_CONST);
+	size += ops->priv_size + QDISC_ALIGN_CONST;
 
-	sch = kmalloc(size, GFP_KERNEL);
+	p = kmalloc(size, GFP_KERNEL);
 	err = -ENOBUFS;
-	if (!sch)
+	if (!p)
 		goto err_out;
+	memset(p, 0, size);
+	sch = (struct Qdisc *)(((unsigned long)p + QDISC_ALIGN_CONST)
+	                       & ~QDISC_ALIGN_CONST);
+	sch->padded = (char *)sch - (char *)p;
 
 	/* Grrr... Resolve race condition with module unload */
 
@@ -420,8 +427,6 @@
 	if (ops != qdisc_lookup_ops(kind))
 		goto err_out;
 
-	memset(sch, 0, size);
-
 	INIT_LIST_HEAD(&sch->list);
 	skb_queue_head_init(&sch->q);
 
@@ -470,8 +475,8 @@
 
 err_out:
 	*errp = err;
-	if (sch)
-		kfree(sch);
+	if (p)
+		kfree(p);
 	return NULL;
 }
 

  reply	other threads:[~2004-08-22  2:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <411BC284.6080807@vgertech.com>
2004-08-13  8:03 ` 2.6.8-rc4-bk1 problem: unregister_netdevice: waiting for ppp0 to become free. Usage count = 1 Vladimir B. Savkin
2004-08-13 20:35   ` Nuno Silva
2004-08-22  2:13     ` Nuno Silva [this message]
2004-08-22  5:25       ` David S. Miller
2004-08-22  8:02         ` Nuno Silva
2004-08-22  8:14       ` Herbert Xu
2004-08-22 12:39         ` Patrick McHardy
2004-08-23  4:47           ` David S. Miller
2004-08-26 16:46             ` Jurriaan
2004-08-23 17:56           ` Nuno Silva

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=41280163.1050508@vgertech.com \
    --to=nuno.silva@vgertech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=master@sectorb.msk.ru \
    --cc=netdev@oss.sgi.com \
    /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).