public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Holger Hoffstaette <holger@wizards.de>,
	Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: Nasty regression from .27.7 to .27.8: idle samba goes crazy
Date: Wed, 10 Dec 2008 18:37:34 +0100	[thread overview]
Message-ID: <493FFE5E.2000404@colorfullife.com> (raw)
In-Reply-To: <20081209123703.043067eb@dhcp-100-2-144.bos.redhat.com>

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

Chuck Ebbert wrote:
> On Mon, 8 Dec 2008 23:22:46 +0100
> Jan Rekorajski <baggins@sith.mimuw.edu.pl> wrote:
>
>   
>> On Mon, 08 Dec 2008, Stefan Richter wrote:
>>
>>     
>>>>>> On Monday, 8 of December 2008, Holger Hoffstaette wrote:
>>>>>>             
>>>>>>> The system is a generic old single-core P4 box with a single SATA drive,
>>>>>>> Gentoo userland and Samba is 3.0.33 (in async mode). The kernel has no
>>>>>>> patches or binary drivers.
>>>>>>>               
>>> Holger, it may be unrelated to the issue, but to be sure:  Which network
>>> card driver do you use?
>>>       
>> I think you can safely rule out NIC, I'm also seeing this behaviour on a
>> brand new server with imap hanging in some busy-loop.
>> Network card in my case:
>> Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
>>
>> What I observer was one CPU doing 100% system work, and the number of
>> timer interrupts went from 1k per second to 4k (for the whole system).
>>
>>     
Could you try the attached patch?
It should fix the bug.


--
    Manfred

[-- Attachment #2: patch-idr-get_above_int --]
[-- Type: text/plain, Size: 1490 bytes --]

rom ae060e0b7bc071bd73dd5319b93c3344d9e10212 Mon Sep 17 00:00:00 2001
From: Manfred Spraul <manfred@colorfullife.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Cc: cebbert@redhat.com
Cc: airlied@gmail.com
Cc: akpm@linux-foundation.org
Bcc: manfred@colorfullife.com
Date: Wed, 10 Dec 2008 18:17:06 +0100
Subject: [PATCH] lib/idr.c: Fix bug introduced by RCU fix

The last patch to lib/idr.c caused a bug if idr_get_new_above() was
called on an empty idr:
Usually, nodes stay on the same layer. New layers are added to the top
of the tree.
The exception is idr_get_new_above() on an empty tree: In this case,
the new root node is first added on layer 0, then moved upwards.
p->layer was not updated.

As usual: You shall never rely on the source code comments, they
will only mislead you.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
---
 lib/idr.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/idr.c b/lib/idr.c
index 7a785a0..1c4f928 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -220,8 +220,14 @@ build_up:
 	 */
 	while ((layers < (MAX_LEVEL - 1)) && (id >= (1 << (layers*IDR_BITS)))) {
 		layers++;
-		if (!p->count)
+		if (!p->count) {
+			/* special case: if the tree is currently empty,
+			 * then we grow the tree by moving the top node
+			 * upwards.
+			 */
+			p->layer++;
 			continue;
+		}
 		if (!(new = get_from_free_list(idp))) {
 			/*
 			 * The allocation failed.  If we built part of
-- 
1.5.6.5


  parent reply	other threads:[~2008-12-10 17:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08  6:18 Nasty regression from .27.7 to .27.8: idle samba goes crazy Holger Hoffstaette
2008-12-08  7:34 ` Rafael J. Wysocki
2008-12-08  8:07   ` Holger Hoffstaette
2008-12-08 16:46     ` Stefan Richter
2008-12-08 19:19       ` Stefan Richter
2008-12-08 20:08         ` Holger Hoffstaette
2008-12-08 22:22         ` Jan Rekorajski
2008-12-09 17:37           ` Chuck Ebbert
2008-12-09 19:16             ` Manfred Spraul
2008-12-09 19:30               ` Chuck Ebbert
2008-12-10 17:37             ` Manfred Spraul [this message]
2008-12-11 22:54               ` Holger Hoffstätte
2008-12-11 23:40                 ` [stable] " Greg KH
2008-12-12 10:59                   ` Holger Hoffstätte
2008-12-12  1:08               ` Jan Rekorajski
2008-12-12 18:26                 ` Jan Rekorajski
2008-12-12 14:01               ` Holger Hoffstätte
2008-12-08 16:32   ` Stefan Richter
2008-12-08 18:46     ` Rafael J. Wysocki
2008-12-08 19:14       ` Stefan Richter

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=493FFE5E.2000404@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=holger@wizards.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    /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