lkml.org 
[lkml]   [1999]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: andrea buffer code (2.2.9-C.gz)
Andrea Arcangeli wrote:
> >Is that really required? Have you made any profiling?
>
> If you want to SMP scale well it's needed (I don't think on a two-way SMP
> is a big issue having a per-memmap spinlock instead of a global spinlock
> but on more powerful machines it can help I think).

1 GB memory means 256.000 spinlocks. I think that's overkill regardless
of the number of CPU's.

What about
- 1 spinlock: simple.
OR:
- a hash-table with (NR_CPU*16) spinlocks?
This would limit the memory usage, scale quite well.
The only possible problem is cache line contention, but even
__cache_aligned would still save lots of memory.

BTW, I think I found a major SMP-race, I've posted it to
linux-kernel@vger.
Since your buffer code fixes parts of that problem, I've attached my
mail.

--
ManfredFrom - Wed May 19 13:31:34 1999
Message-ID: <37429AFE.6EE21FCE@colorfullife.com>
Date: Wed, 19 May 1999 13:05:34 +0200
From: Manfred Spraul <manfreds@colorfullife.com>
Reply-To: masp0008@stud.uni-sb.de
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.9 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: linux-kernel@vger.rutgers.edu
Subject: possible SMP-race, 2.2.9 & 2.3.3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

__global_cli() cannot stop the other processors if it is called with
interrupts disabled.

arch/i386/kernel/irq.c:
> A global "cli()" while in an interrupts context turns
> into just a local cli(). Interrupts should use a spinlock
> for the (very unlikely) case they ever want to protect
> against each other.

I've added a check for that event (__global_cli() called with IF
cleared), and this happens often.
Do we have to fix that? (i.e. convert the callers from __global_cli() to
a spinlock?)


I've found one codpath:
-> ide_end_request(): acquires io_request_lock, clear local interrupts.
-> calls end_that_request_first()
-> calls end_buffer_io_async() <<<<<<<<<< calls cli(), needs global
sync.

Regards,
Manfred


\
 
 \ /
  Last update: 2005-03-22 13:51    [from the cache]
©2003-2011 Jasper Spaans