mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: zilvinas@wilibox.com, linux-kernel@vger.kernel.org
Subject: Re: Kernel NFS lockd freezes notebook on shutdown (Linux 2.6.22-rc1 + CFS v12)
Date: Thu, 17 May 2007 02:55:43 +0400	[thread overview]
Message-ID: <20070516225543.GA337@tv-sign.ru> (raw)
In-Reply-To: <20070516121538.7b108c10.akpm@linux-foundation.org>

On Wed, 16 May 2007 21:00:41 +0300
Zilvinas Valinskas <zilvinas@wilibox.com> wrote:
> 
> In short, on shutdown my laptop is always freezing now. I was able to
> capture the 'sysrq-P' (hit that several times), sysrq-T outputs. Please
> see .config and log messages at http://barclay.balt.net/~zilvinas/oops/ 
> 
> Kernel version I had built according git is :
> 
> zilvinas@zv:/projects/linux-amd64.git$ git describe HEAD
> v2.6.22-rc1-29-gfaa8b6c
> 
> On top of that I have CFS v12 applied (no other changes otherwise).
> Please note that there is ''fglrx.ko'' loaded and kernel is tainted
> because of that (feel free to ignore the report ...).
> 
> Anyway, 'sysrq-P' always show that PC is stuck at (NFS lockd?) and it is
> always the same backtrace is shown. 'sysrq-t' output is in
> 'kernel-nfs-freeze.log' file (did not want to post it here).
> 
>  Pid: 3652, comm: lockd Tainted: P       2.6.22-rc1-cfs-v12 #1
> 
> [<ffffffff8024a5a0>] wq_barrier_func+0x0/0x10
> [<ffffffff8024a7e5>] destroy_workqueue+0x75/0xa0
> [<ffffffff8833cd34>] :sunrpc:rpciod_down+0xf4/0x170
> [<ffffffff8836dd74>] :lockd:lockd+0x244/0x300
> [<ffffffff80233e1f>] schedule_tail+0x3f/0xb0
> [<ffffffff8020b0f8>] child_rip+0xa/0x12
> [<ffffffff8836db30>] :lockd:lockd+0x0/0x300
> [<ffffffff8836db30>] :lockd:lockd+0x0/0x300
> [<ffffffff8020b0ee>] child_rip+0x0/0x12
> 
> Hope this helps. Thanks in advance for any advice how to solve problem !
> For now I am back to '2.6.21.1-cfs-v10'.
> 

Nice, thanks.

Zilvinas, could you try the patch below?

It is a shot in the dark. I hope I'll suggest somethimg better tomorrow.

Oleg.

--- OLD/kernel/workqueue.c~	2007-05-17 00:15:37.000000000 +0400
+++ OLD/kernel/workqueue.c	2007-05-17 02:51:15.000000000 +0400
@@ -752,16 +752,25 @@ static void cleanup_workqueue_thread(str
 	spin_unlock_irq(&cwq->lock);
 
 	if (alive) {
+		int n;
+
 		wait_for_completion(&barr.done);
 
-		while (unlikely(cwq->thread != NULL))
-			cpu_relax();
-		/*
-		 * Wait until cwq->thread unlocks cwq->lock,
-		 * it won't touch *cwq after that.
-		 */
-		smp_rmb();
-		spin_unlock_wait(&cwq->lock);
+		for (n = 0;; ++n) {
+			spin_lock_irq(&cwq->lock);
+			alive = (cwq->thread != NULL);
+			spin_unlock_irq(&cwq->lock);
+
+			if (!alive)
+				break;
+
+			if (n > 1000) {
+				printk(KERN_CRIT "ERR!! wq: %s\n", cwq->wq->name);
+				break;
+			}
+
+			yield();
+		}
 	}
 }
 


  reply	other threads:[~2007-05-16 22:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 18:00 Zilvinas Valinskas
2007-05-16 19:15 ` Andrew Morton
2007-05-16 22:55   ` Oleg Nesterov [this message]
2007-05-17  6:17     ` Zilvinas Valinskas
2007-05-17  8:21     ` Zilvinas Valinskas
2007-05-17  9:00       ` Zilvinas Valinskas
2007-05-17 18:45       ` Oleg Nesterov
2007-05-18 10:47         ` Zilvinas Valinskas
2007-05-18 20:28           ` Oleg Nesterov
2007-05-20 10:37             ` zilvinas
2007-05-20 17:01               ` J. Bruce Fields
2007-05-20 19:21               ` Oleg Nesterov
2007-05-18 12:17   ` Zilvinas Valinskas
2007-05-18 15:34     ` Andrew Morton

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=20070516225543.GA337@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zilvinas@wilibox.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

Powered by JetHome