* aic7xxx
@ 2000-12-17 2:12 Mathias Wiklander
2000-12-17 7:41 ` aic7xxx stewart
2000-12-17 10:30 ` aic7xxx Mohammad A. Haque
0 siblings, 2 replies; 35+ messages in thread
From: Mathias Wiklander @ 2000-12-17 2:12 UTC (permalink / raw)
To: linux-kernel
Hi!
I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
ever I try to load it as a module or if I compile it in the kernel I get
the folowing error messages. The last 4 messages repeats for ever. The
problem is on 3 diffrent machines. Anyone who know what it can be and
how to fix it.
/Eastbay
(scsi0) <Adaptec AHA-294X SCSI host adapter> found at PCI 0/19/0
(scsi0) Narrow Channel, SCSI ID=7, 16/255 SCBs
(scsi0) Cables present (Int-50 NO, Ext-50 NO)
(scsi0) Downloading sequencer code... 415 instructions downloaded
scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.1/5.2.0
<Adaptec AHA-294X SCSI host adapter>
scsi : aborting command due to timeout : pid 0, scsi0, channel 0, id 0,
lun 0 Inquiry 00 00 00 ff 00
SCSI host 0 abort (pid 0) timed out - resetting
SCSI bus is being reset for host 0 channel 0.
SCSI host 0 channel 0 reset (pid 0) timed out - trying harder
SCSI bus is being reset for host 0 channel 0.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 2:12 aic7xxx Mathias Wiklander
@ 2000-12-17 7:41 ` stewart
2000-12-17 9:08 ` aic7xxx Mathias Wiklander
2000-12-17 10:30 ` aic7xxx Mohammad A. Haque
1 sibling, 1 reply; 35+ messages in thread
From: stewart @ 2000-12-17 7:41 UTC (permalink / raw)
To: Mathias Wiklander; +Cc: linux-kernel
I am also having problems with this driver, but with different adapters
and symptoms. depmod is reporting a lot of unresolved symbols for generic
scsi and scsi cdrom. Compiling it into the kernel instead of as a module
seems to bypass the problems.
stewart
On Sun, 17 Dec 2000, Mathias Wiklander wrote:
> Hi!
>
> I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
> ever I try to load it as a module or if I compile it in the kernel I get
> the folowing error messages. The last 4 messages repeats for ever. The
> problem is on 3 diffrent machines. Anyone who know what it can be and
> how to fix it.
>
> /Eastbay
>
> (scsi0) <Adaptec AHA-294X SCSI host adapter> found at PCI 0/19/0
> (scsi0) Narrow Channel, SCSI ID=7, 16/255 SCBs
> (scsi0) Cables present (Int-50 NO, Ext-50 NO)
> (scsi0) Downloading sequencer code... 415 instructions downloaded
> scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.1/5.2.0
> <Adaptec AHA-294X SCSI host adapter>
> scsi : aborting command due to timeout : pid 0, scsi0, channel 0, id 0,
> lun 0 Inquiry 00 00 00 ff 00
> SCSI host 0 abort (pid 0) timed out - resetting
> SCSI bus is being reset for host 0 channel 0.
> SCSI host 0 channel 0 reset (pid 0) timed out - trying harder
> SCSI bus is being reset for host 0 channel 0.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 7:41 ` aic7xxx stewart
@ 2000-12-17 9:08 ` Mathias Wiklander
0 siblings, 0 replies; 35+ messages in thread
From: Mathias Wiklander @ 2000-12-17 9:08 UTC (permalink / raw)
To: stewart; +Cc: linux-kernel
That's not the case for me. When I build it in to the kernel, the kernel
comes tho the init of thje board then these lines repeats forever.
SCSI host 0 abort (pid 0) timed out - resetting
SCSI bus is being reset for host 0 channel 0.
SCSI host 0 channel 0 reset (pid 0) timed out - trying harder
SCSI bus is being reset for host 0 channel 0.
/Mathias
stewart@neuron.com wrote:
>
> I am also having problems with this driver, but with different adapters
> and symptoms. depmod is reporting a lot of unresolved symbols for generic
> scsi and scsi cdrom. Compiling it into the kernel instead of as a module
> seems to bypass the problems.
>
> stewart
>
> On Sun, 17 Dec 2000, Mathias Wiklander wrote:
>
> > Hi!
> >
> > I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
> > ever I try to load it as a module or if I compile it in the kernel I get
> > the folowing error messages. The last 4 messages repeats for ever. The
> > problem is on 3 diffrent machines. Anyone who know what it can be and
> > how to fix it.
> >
> > /Eastbay
> >
> > (scsi0) <Adaptec AHA-294X SCSI host adapter> found at PCI 0/19/0
> > (scsi0) Narrow Channel, SCSI ID=7, 16/255 SCBs
> > (scsi0) Cables present (Int-50 NO, Ext-50 NO)
> > (scsi0) Downloading sequencer code... 415 instructions downloaded
> > scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.1/5.2.0
> > <Adaptec AHA-294X SCSI host adapter>
> > scsi : aborting command due to timeout : pid 0, scsi0, channel 0, id 0,
> > lun 0 Inquiry 00 00 00 ff 00
> > SCSI host 0 abort (pid 0) timed out - resetting
> > SCSI bus is being reset for host 0 channel 0.
> > SCSI host 0 channel 0 reset (pid 0) timed out - trying harder
> > SCSI bus is being reset for host 0 channel 0.
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > Please read the FAQ at http://www.tux.org/lkml/
> >
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 2:12 aic7xxx Mathias Wiklander
2000-12-17 7:41 ` aic7xxx stewart
@ 2000-12-17 10:30 ` Mohammad A. Haque
2000-12-17 10:49 ` aic7xxx Mathias Wiklander
1 sibling, 1 reply; 35+ messages in thread
From: Mohammad A. Haque @ 2000-12-17 10:30 UTC (permalink / raw)
To: Mathias Wiklander; +Cc: linux-kernel
Helps if we could get a kernel version.
Mathias Wiklander wrote:
>
> Hi!
>
> I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
> ever I try to load it as a module or if I compile it in the kernel I get
> the folowing error messages. The last 4 messages repeats for ever. The
> problem is on 3 diffrent machines. Anyone who know what it can be and
> how to fix it.
--
=====================================================================
Mohammad A. Haque http://www.haque.net/
mhaque@haque.net
"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
batmanppc@themes.org
=====================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 10:30 ` aic7xxx Mohammad A. Haque
@ 2000-12-17 10:49 ` Mathias Wiklander
2000-12-17 14:41 ` aic7xxx stewart
2000-12-17 21:14 ` aic7xxx Mohammad A. Haque
0 siblings, 2 replies; 35+ messages in thread
From: Mathias Wiklander @ 2000-12-17 10:49 UTC (permalink / raw)
To: Mohammad A. Haque; +Cc: linux-kernel
Sorry I've forgot that. It is 2.4.0-test12
/Eastbay
"Mohammad A. Haque" wrote:
>
> Helps if we could get a kernel version.
>
> Mathias Wiklander wrote:
> >
> > Hi!
> >
> > I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
> > ever I try to load it as a module or if I compile it in the kernel I get
> > the folowing error messages. The last 4 messages repeats for ever. The
> > problem is on 3 diffrent machines. Anyone who know what it can be and
> > how to fix it.
>
> --
>
> =====================================================================
> Mohammad A. Haque http://www.haque.net/
> mhaque@haque.net
>
> "Alcohol and calculus don't mix. Project Lead
> Don't drink and derive." --Unknown http://wm.themes.org/
> batmanppc@themes.org
> =====================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 10:49 ` aic7xxx Mathias Wiklander
@ 2000-12-17 14:41 ` stewart
2000-12-17 21:14 ` aic7xxx Mohammad A. Haque
1 sibling, 0 replies; 35+ messages in thread
From: stewart @ 2000-12-17 14:41 UTC (permalink / raw)
To: Mathias Wiklander; +Cc: Mohammad A. Haque, linux-kernel
ditto.
On Sun, 17 Dec 2000, Mathias Wiklander wrote:
> Sorry I've forgot that. It is 2.4.0-test12
>
> /Eastbay
> "Mohammad A. Haque" wrote:
> >
> > Helps if we could get a kernel version.
> >
> > Mathias Wiklander wrote:
> > >
> > > Hi!
> > >
> > > I have problem using my scsi card. It is an Adaptec 2940 (SCSI2). When
> > > ever I try to load it as a module or if I compile it in the kernel I get
> > > the folowing error messages. The last 4 messages repeats for ever. The
> > > problem is on 3 diffrent machines. Anyone who know what it can be and
> > > how to fix it.
> >
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 10:49 ` aic7xxx Mathias Wiklander
2000-12-17 14:41 ` aic7xxx stewart
@ 2000-12-17 21:14 ` Mohammad A. Haque
2000-12-19 21:22 ` aic7xxx Mathias Wiklander
1 sibling, 1 reply; 35+ messages in thread
From: Mohammad A. Haque @ 2000-12-17 21:14 UTC (permalink / raw)
To: Mathias Wiklander; +Cc: linux-kernel
Weird. The modules just give me unresolved symbol errors instead of the
loop.
Mathias Wiklander wrote:
>
> Sorry I've forgot that. It is 2.4.0-test12
>
--
=====================================================================
Mohammad A. Haque http://www.haque.net/
mhaque@haque.net
"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
batmanppc@themes.org
=====================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
@ 2000-12-18 1:03 Douglas Gilbert
0 siblings, 0 replies; 35+ messages in thread
From: Douglas Gilbert @ 2000-12-18 1:03 UTC (permalink / raw)
To: Mohammad A. Haque, linux-kernel
Mohammad A. Haque wrote:
>
> Weird. The modules just give me unresolved symbol errors instead of the
> loop.
>
> Mathias Wiklander wrote:
> >
> > Sorry I've forgot that. It is 2.4.0-test12
> >
There was a SCSI Makefile bug in test12 that caused
those unresoved symbols. This patch from Bob Tracy
fixes it.
Doug Gilbert
--- linux/drivers/scsi/Makefile Tue Dec 12 10:49:32 2000
+++ linux/drivers/scsi/Makefile.t12bt Tue Dec 12 22:46:27 2000
@@ -30,7 +30,7 @@
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
-obj-$(CONFIG_SCSI) += scsi_mod.o
+obj-$(CONFIG_SCSI) += scsi_mod.o scsi_syms.o
obj-$(CONFIG_A4000T_SCSI) += amiga7xx.o 53c7xx.o
obj-$(CONFIG_A4091_SCSI) += amiga7xx.o 53c7xx.o
@@ -122,8 +122,7 @@
scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o \
scsicam.o scsi_proc.o scsi_error.o \
scsi_obsolete.o scsi_queue.o scsi_lib.o \
- scsi_merge.o scsi_dma.o scsi_scan.o \
- scsi_syms.o
+ scsi_merge.o scsi_dma.o scsi_scan.o
sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o
initio-objs := ini9100u.o i91uscsi.o
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: aic7xxx
2000-12-17 21:14 ` aic7xxx Mohammad A. Haque
@ 2000-12-19 21:22 ` Mathias Wiklander
0 siblings, 0 replies; 35+ messages in thread
From: Mathias Wiklander @ 2000-12-19 21:22 UTC (permalink / raw)
To: dougg; +Cc: linux-kernel
It didn't help me with this patch. The aic7xxx driver (module or
kernelcompiled) just put this 4 rows:
SCSI host 0 abort (pid 0) timed out - resetting
SCSI bus is being reset for host 0 channel 0.
SCSI host 0 channel 0 reset (pid 0) timed out - trying harder
SCSI bus is being reset for host 0 channel 0.
Anyone who knews what it means?
I need help.
/Eastbay
> There was a SCSI Makefile bug in test12 that caused
> those unresoved symbols. This patch from Bob Tracy
> fixes it.
>
> Doug Gilbert
>
> --- linux/drivers/scsi/Makefile Tue Dec 12 10:49:32 2000
> +++ linux/drivers/scsi/Makefile.t12bt Tue Dec 12 22:46:27 2000
> @@ -30,7 +30,7 @@
> CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
> CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
>
> -obj-$(CONFIG_SCSI) += scsi_mod.o
> +obj-$(CONFIG_SCSI) += scsi_mod.o scsi_syms.o
>
> obj-$(CONFIG_A4000T_SCSI) += amiga7xx.o 53c7xx.o
> obj-$(CONFIG_A4091_SCSI) += amiga7xx.o 53c7xx.o
> @@ -122,8 +122,7 @@
> scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o \
> scsicam.o scsi_proc.o scsi_error.o \
> scsi_obsolete.o scsi_queue.o scsi_lib.o \
> - scsi_merge.o scsi_dma.o scsi_scan.o \
> - scsi_syms.o
> + scsi_merge.o scsi_dma.o scsi_scan.o
>
> sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o
> initio-objs := ini9100u.o i91uscsi.o
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: RFC: patch to allow lock-free traversal of lists with insertion
@ 2001-10-09 15:45 Paul McKenney
2001-10-09 17:00 ` Richard Henderson
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
0 siblings, 2 replies; 35+ messages in thread
From: Paul McKenney @ 2001-10-09 15:45 UTC (permalink / raw)
To: Richard Henderson; +Cc: linux-kernel, lse-tech
> On Mon, Oct 08, 2001 at 06:55:24PM -0700, Paul E. McKenney wrote:
> > This is a proposal to provide a wmb()-like primitive that enables
> > lock-free traversal of lists while elements are concurrently being
> > inserted into these lists.
>
> I've discussed this with you before and you continue to have
> completely missed the point.
It would not be the first point that I have completely missed, but
please read on. I have discussed this algorithm with Alpha architects,
who tell me that it is sound.
> Alpha requires that you issue read-after-read memory barriers on
> the reader side if you require ordering between reads. That is
> the extent of the weakness of the memory ordering.
I agree that Alpha requires "mb" instructions to be executed on the
reading CPUs if the reading CPUs are to observe some other CPU's writes
occuring in order. And I agree that the usual way that this is done
is to insert "mb" instructions between the reads on the read side.
However, if the reading CPU executes an "mb" instruction between the
time that the writing CPU executes the "wmb" and the time that the writing
CPU executes the second store, then the reading CPU is guaranteed to
see the writes in order. Here is how this happens:
Initial values: a = 0, p = &a, b = 1.
Writing CPU Reading CPU
1) b = 2;
2) Execute "wmb" instruction
3) Send a bunch of IPIs
4) Receive IPI
5) Execute "mb" instruction
6) Indicate completion
7) Detect completion
8) p = &b
The combination of steps 2 and 5 guarantee that the reading CPU will
invalidate the cacheline containing the old value of "b" before it
can possibly reference the new value of "p". The CPU must read "p"
before "b", since it can't know where "p" points before reading it.
> Sparc64 is the same way.
I can believe that "membar #StoreStore" and friends operate in the same
way that the Alpha memory-ordering instructions do. However, some of
the code in Linux seems to rely on "membar #SYNC" waiting for outstanding
invalidations to complete. If this is the case, then "membar #SYNC"
could be used to segregate writes when the corresponding reads are
implicitly ordered by data dependencies, as they are during pointer
dereferences.
> This crap will never be applied. Your algorithms are simply broken
> if you do not ensure proper read ordering via the rmb() macro.
Please see the example above. I do believe that my algorithms are
reliably forcing proper read ordering using IPIs, just in an different
way. Please note that I have discussed this algorithm with Alpha
architects, who believe that it is sound.
But they (and I) may well be confused. If so, could you please
show me what I am missing?
Thanx, Paul
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-09 15:45 RFC: patch to allow lock-free traversal of lists with insertion Paul McKenney
@ 2001-10-09 17:00 ` Richard Henderson
2001-10-10 3:33 ` Paul Mackerras
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
1 sibling, 1 reply; 35+ messages in thread
From: Richard Henderson @ 2001-10-09 17:00 UTC (permalink / raw)
To: Paul McKenney; +Cc: linux-kernel, lse-tech
On Tue, Oct 09, 2001 at 08:45:15AM -0700, Paul McKenney wrote:
> Please see the example above. I do believe that my algorithms are
> reliably forcing proper read ordering using IPIs, just in an different
> way.
I wasn't suggesting that the IPI wouldn't work -- it will.
But it will be _extremely_ slow.
I am suggesting that the lock-free algorithms should add the
read barriers, and that failure to do so indicates that they
are incomplete. If nothing else, it documents where the real
dependancies are.
r~
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-09 15:45 RFC: patch to allow lock-free traversal of lists with insertion Paul McKenney
2001-10-09 17:00 ` Richard Henderson
@ 2001-10-10 2:05 ` Andrea Arcangeli
2001-10-10 5:05 ` Linus Torvalds
2001-10-10 13:24 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Ivan Kokshaysky
1 sibling, 2 replies; 35+ messages in thread
From: Andrea Arcangeli @ 2001-10-10 2:05 UTC (permalink / raw)
To: Paul McKenney
Cc: Richard Henderson, linux-kernel, lse-tech, Jay.Estabrook,
Peter Rival
On Tue, Oct 09, 2001 at 08:45:15AM -0700, Paul McKenney wrote:
> Please see the example above. I do believe that my algorithms are
> reliably forcing proper read ordering using IPIs, just in an different
> way. Please note that I have discussed this algorithm with Alpha
> architects, who believe that it is sound.
The IPI way is certainly safe.
The point here is that it is suprisingly that alpha needs this IPI
unlike all other architectures. So while the IPI is certainly safe we
wouldn't expect it to be necessary on alpha either.
Now my only worry is that when you worked on this years ago with the
alpha architects there were old chips, old caches and old machines (ev5
maybe?).
So before changing any code, I would prefer to double check with the
current alpha architects that the read dependency really isn't enough to
enforce read ordering without the need of rmb also on the beleeding edge
ev6/ev67/etc.. cores. So potentially as worse we'd need to redefine
wmb() as wmbdd() (and friends) only for EV5+SMP compiles of the kernel,
but we wouldn't be affected with any recent hardware compiling for
EV6/EV67. Jay, Peter, comments?
Andrea
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-09 17:00 ` Richard Henderson
@ 2001-10-10 3:33 ` Paul Mackerras
2001-10-10 17:02 ` Richard Henderson
0 siblings, 1 reply; 35+ messages in thread
From: Paul Mackerras @ 2001-10-10 3:33 UTC (permalink / raw)
To: Richard Henderson; +Cc: Paul McKenney, linux-kernel, lse-tech
Richard Henderson writes:
> I am suggesting that the lock-free algorithms should add the
> read barriers, and that failure to do so indicates that they
> are incomplete. If nothing else, it documents where the real
> dependancies are.
Please, let's not go adding rmb's in places where there is already an
ordering forced by a data dependency - that will hurt performance
unnecessarily on x86, ppc, sparc, ia64, etc.
It seems to me that there are two viable alternatives:
1. Define an rmbdd() which is a no-op on all architectures except for
alpha, where it is an rmb. Richard can then have the job of
finding all the places where an rmbdd is needed, which sounds like
one of the smellier labors of Hercules to me. :)
2. Use Paul McKenney's scheme.
I personally don't really mind which gets chosen. Scheme 1 will
result in intermittent hard-to-find bugs on alpha (since the vast
majority of kernel hackers will not understand where or why rmbdd's
are required), but if Richard prefers that to scheme 2, it's his call
IMHO.
Regards,
Paul.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
@ 2001-10-10 5:05 ` Linus Torvalds
2001-10-10 5:17 ` BALBIR SINGH
` (3 more replies)
2001-10-10 13:24 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Ivan Kokshaysky
1 sibling, 4 replies; 35+ messages in thread
From: Linus Torvalds @ 2001-10-10 5:05 UTC (permalink / raw)
To: linux-kernel
In article <20011010040502.A726@athlon.random>,
Andrea Arcangeli <andrea@suse.de> wrote:
>On Tue, Oct 09, 2001 at 08:45:15AM -0700, Paul McKenney wrote:
>> Please see the example above. I do believe that my algorithms are
>> reliably forcing proper read ordering using IPIs, just in an different
>> way. Please note that I have discussed this algorithm with Alpha
>> architects, who believe that it is sound.
>
>The IPI way is certainly safe.
Now, before people get all excited, what is this particular code
actually _good_ for?
Creating a lock-free list that allows insertion concurrently with lookup
is _easy_.
But what's the point? If you insert stuff, you eventually have to remove
it. What goes up must come down. Insert-inane-quote-here.
And THAT is the hard part. Doing lookup without locks ends up being
pretty much worthless, because you need the locks for the removal
anyway, at which point the whole thing looks pretty moot.
Did I miss something?
Linus
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:05 ` Linus Torvalds
@ 2001-10-10 5:17 ` BALBIR SINGH
2001-10-10 5:29 ` Davide Libenzi
2001-10-10 5:46 ` Linus Torvalds
2001-10-10 6:16 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul Mackerras
` (2 subsequent siblings)
3 siblings, 2 replies; 35+ messages in thread
From: BALBIR SINGH @ 2001-10-10 5:17 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]
Linus Torvalds wrote:
>In article <20011010040502.A726@athlon.random>,
>Andrea Arcangeli <andrea@suse.de> wrote:
>
>>On Tue, Oct 09, 2001 at 08:45:15AM -0700, Paul McKenney wrote:
>>
>>>Please see the example above. I do believe that my algorithms are
>>>reliably forcing proper read ordering using IPIs, just in an different
>>>way. Please note that I have discussed this algorithm with Alpha
>>>architects, who believe that it is sound.
>>>
>>The IPI way is certainly safe.
>>
>
>Now, before people get all excited, what is this particular code
>actually _good_ for?
>
>Creating a lock-free list that allows insertion concurrently with lookup
>is _easy_.
>
>But what's the point? If you insert stuff, you eventually have to remove
>it. What goes up must come down. Insert-inane-quote-here.
>
>And THAT is the hard part. Doing lookup without locks ends up being
>pretty much worthless, because you need the locks for the removal
>anyway, at which point the whole thing looks pretty moot.
>
>Did I miss something?
>
> Linus
>
What about cases like the pci device list or any other such list. Sometimes
you do not care if somebody added something, while you were looking through
the list as long as you do not get illegal addresses or data.
Wouldn't this be very useful there? Most of these lists come up
at system startup and change rearly, but we look through them often.
Me too, Did I miss something?
Balbir
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
[-- Attachment #2: Wipro_Disclaimer.txt --]
[-- Type: text/plain, Size: 853 bytes --]
----------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:17 ` BALBIR SINGH
@ 2001-10-10 5:29 ` Davide Libenzi
2001-10-10 5:46 ` Linus Torvalds
1 sibling, 0 replies; 35+ messages in thread
From: Davide Libenzi @ 2001-10-10 5:29 UTC (permalink / raw)
To: BALBIR SINGH; +Cc: Linus Torvalds, linux-kernel
On Wed, 10 Oct 2001, BALBIR SINGH wrote:
> What about cases like the pci device list or any other such list. Sometimes
> you do not care if somebody added something, while you were looking through
> the list as long as you do not get illegal addresses or data.
> Wouldn't this be very useful there? Most of these lists come up
> at system startup and change rearly, but we look through them often.
>
> Me too, Did I miss something?
What means that changes rarely that you're going to use rarely_lock() ?
If you're going to remove even only 1 element in 1000000 jiffies then
you've to lock.
If your list can only grow, that's different.
- Davide
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:17 ` BALBIR SINGH
2001-10-10 5:29 ` Davide Libenzi
@ 2001-10-10 5:46 ` Linus Torvalds
2001-10-10 6:01 ` BALBIR SINGH
2001-10-10 7:14 ` kdb requires kallsyms Kirill Ratkin
1 sibling, 2 replies; 35+ messages in thread
From: Linus Torvalds @ 2001-10-10 5:46 UTC (permalink / raw)
To: BALBIR SINGH; +Cc: linux-kernel
On Wed, 10 Oct 2001, BALBIR SINGH wrote:
> >
> >And THAT is the hard part. Doing lookup without locks ends up being
> >pretty much worthless, because you need the locks for the removal
> >anyway, at which point the whole thing looks pretty moot.
>
> What about cases like the pci device list or any other such list. Sometimes
> you do not care if somebody added something, while you were looking through
> the list as long as you do not get illegal addresses or data.
> Wouldn't this be very useful there? Most of these lists come up
> at system startup and change rearly, but we look through them often.
It's not about "change rarely". You cannot use a non-locking lookup if
they _ever_ remove anything.
I can't think of many lists like that. The PCI lists certainly are both
add/remove: cardbus bridges and hotplug-PCI means that they are not just
purely "enumerate at bootup".
Sure, maybe there are _some_ things that don't need to ever be removed,
but I can't think of any interesting data structure off-hand. Truly static
stuff tends to be allocated in an array that is sized once - array lookups
are much faster than traversing a linked list anyway.
So the linked list approach tends to make sense for things that _aren't_
just static, but I don't know of anything that only grows and grows. In
fact, that would sound like a horrible memory leak to me if we had
something like that. Even slow growth is bad if you want up-times measured
in years.
Now, in all fairness I can imagine hacky lock-less removals too. To get
them to work, you have to (a) change the "next" pointer to point to the
next->next (and have some serialization between removals, but removals
only, to make sure you don't have next->next also going away from you) and
(b) leave the old "next" pointer (and thus the data structure) around
until you can _prove_ that nobody is looking anything up any more, and
that the now-defunct data structure can truly be removed.
However, apart from locking, there aren't all that many ways to "prove"
that non-use. You could probably do it with interesting atomic sequence
numbers etc, although by the time you generate atomic sequence numbers
your lookup is already getting heavier - to the point where locking
probably isn't so bad an idea any more.
Linus
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:46 ` Linus Torvalds
@ 2001-10-10 6:01 ` BALBIR SINGH
2001-10-10 15:23 ` Victor Yodaiken
2001-10-10 7:14 ` kdb requires kallsyms Kirill Ratkin
1 sibling, 1 reply; 35+ messages in thread
From: BALBIR SINGH @ 2001-10-10 6:01 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2995 bytes --]
Linus Torvalds wrote:
>On Wed, 10 Oct 2001, BALBIR SINGH wrote:
>
>>>And THAT is the hard part. Doing lookup without locks ends up being
>>>pretty much worthless, because you need the locks for the removal
>>>anyway, at which point the whole thing looks pretty moot.
>>>
>>What about cases like the pci device list or any other such list. Sometimes
>>you do not care if somebody added something, while you were looking through
>>the list as long as you do not get illegal addresses or data.
>>Wouldn't this be very useful there? Most of these lists come up
>>at system startup and change rearly, but we look through them often.
>>
>
>It's not about "change rarely". You cannot use a non-locking lookup if
>they _ever_ remove anything.
>
>I can't think of many lists like that. The PCI lists certainly are both
>add/remove: cardbus bridges and hotplug-PCI means that they are not just
>purely "enumerate at bootup".
>
I agree, I just thought of one case quickly. Assume that somebody did a cat /proc/pci.
Meanwhile somebody is adding a new pci device (hotplug PCI) simultaneously (which is very rare).
I would not care if the new device showed up in the output of /proc/pci this time. It would
definitely show up next time. Meanwhile locking the list (just in case it changes) is an
overhead in the case above. I was referring to these cases in my earlier mail.
>
>Sure, maybe there are _some_ things that don't need to ever be removed,
>but I can't think of any interesting data structure off-hand. Truly static
>stuff tends to be allocated in an array that is sized once - array lookups
>are much faster than traversing a linked list anyway.
>
>So the linked list approach tends to make sense for things that _aren't_
>just static, but I don't know of anything that only grows and grows. In
>fact, that would sound like a horrible memory leak to me if we had
>something like that. Even slow growth is bad if you want up-times measured
>in years.
>
>Now, in all fairness I can imagine hacky lock-less removals too. To get
>them to work, you have to (a) change the "next" pointer to point to the
>next->next (and have some serialization between removals, but removals
>only, to make sure you don't have next->next also going away from you) and
>(b) leave the old "next" pointer (and thus the data structure) around
>until you can _prove_ that nobody is looking anything up any more, and
>that the now-defunct data structure can truly be removed.
>
The problem with removals is that somebody could be adding an element simulataneously
to the "next" element. Which might cause problems. I hope I correctly understood
the scenario here.
>
>However, apart from locking, there aren't all that many ways to "prove"
>that non-use. You could probably do it with interesting atomic sequence
>numbers etc, although by the time you generate atomic sequence numbers
>your lookup is already getting heavier - to the point where locking
>probably isn't so bad an idea any more.
>
> Linus
>
>
Balbir
[-- Attachment #2: Wipro_Disclaimer.txt --]
[-- Type: text/plain, Size: 853 bytes --]
----------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:05 ` Linus Torvalds
2001-10-10 5:17 ` BALBIR SINGH
@ 2001-10-10 6:16 ` Paul Mackerras
2001-10-10 6:30 ` Linus Torvalds
2001-10-10 7:36 ` Paul Mackerras
2001-10-10 11:54 ` Keith Owens
3 siblings, 1 reply; 35+ messages in thread
From: Paul Mackerras @ 2001-10-10 6:16 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Linus Torvalds writes:
> And THAT is the hard part. Doing lookup without locks ends up being
> pretty much worthless, because you need the locks for the removal
> anyway, at which point the whole thing looks pretty moot.
>
> Did I miss something?
I believe this all becomes (much more) useful when you are doing
read-copy-update.
There is an assumption that anyone modifying the list (inserting or
deleting) would take a lock first, so the deletion is just a pointer
assignment. Any reader traversing the list (without a lock) sees
either the old pointer or the new, which is fine.
The difficulty is in making sure that no reader is still inspecting
the list element you just removed before you free it, or modify any
field that the reader would be looking at (particularly the `next'
field :). One way of doing that is to defer the free or modification
to a quiescent point. If you have a separate `next_free' field, you
could safely put the element on a list of elements to be freed at the
next quiescent point.
Paul.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 6:16 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul Mackerras
@ 2001-10-10 6:30 ` Linus Torvalds
0 siblings, 0 replies; 35+ messages in thread
From: Linus Torvalds @ 2001-10-10 6:30 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-kernel
On Wed, 10 Oct 2001, Paul Mackerras wrote:
>
> There is an assumption that anyone modifying the list (inserting or
> deleting) would take a lock first, so the deletion is just a pointer
> assignment. Any reader traversing the list (without a lock) sees
> either the old pointer or the new, which is fine.
Right, that's not the problem.
> The difficulty is in making sure that no reader is still inspecting
> the list element you just removed before you free it, or modify any
> field that the reader would be looking at (particularly the `next'
> field :).
..which implies _some_ sort of locking, even if it may be deferred.
The locking can be per-CPU, whatever - have a per-CPU count for "this many
traversals in progress", and have every lookup increment it before
starting, and decrement it after stopping.
Then the deleter can actually free the thing once he has seen every CPU go
down to zero, with the proper memory barriers.
Yes, I see that it can work. But it sounds like a _lot_ of complexity for
not very much gain.
Right now, you already have to have eight CPU's to see locking as a large
problem in normal life. People have normal patches to bring that easily up
to 16. Then how much hard-to-debug-with-subtle-memory-ordering-issues code
do you want to handle the few machines that aren't in that range?
I'm just trying to inject a bit of realism here.
Linus
^ permalink raw reply [flat|nested] 35+ messages in thread
* kdb requires kallsyms
2001-10-10 5:46 ` Linus Torvalds
2001-10-10 6:01 ` BALBIR SINGH
@ 2001-10-10 7:14 ` Kirill Ratkin
2001-10-10 7:38 ` BALBIR SINGH
1 sibling, 1 reply; 35+ messages in thread
From: Kirill Ratkin @ 2001-10-10 7:14 UTC (permalink / raw)
To: linux-kernel
Hi.
I've trouble with kdb. I've patched my kernel (stable
2.4.10) and tried to make kernel with kdb (from SGI)
and I see :
/bin/sh: /sbin/kallsyms: No such file or directory
make[1]: *** [kallsyms] error 127
Where can I find this kallsyms?
Regards,
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:05 ` Linus Torvalds
2001-10-10 5:17 ` BALBIR SINGH
2001-10-10 6:16 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul Mackerras
@ 2001-10-10 7:36 ` Paul Mackerras
2001-10-10 15:54 ` Victor Yodaiken
2001-10-10 11:54 ` Keith Owens
3 siblings, 1 reply; 35+ messages in thread
From: Paul Mackerras @ 2001-10-10 7:36 UTC (permalink / raw)
To: torvalds, linux-kernel
Linus Torvalds writes:
> And THAT is the hard part. Doing lookup without locks ends up being
> pretty much worthless, because you need the locks for the removal
> anyway, at which point the whole thing looks pretty moot.
>
> Did I miss something?
I believe this all becomes (much more) useful when you are doing
read-copy-update.
There is an assumption that anyone modifying the list (inserting or
deleting) would take a lock first, so the deletion is just a pointer
assignment. Any reader traversing the list (without a lock) sees
either the old pointer or the new, which is fine.
The difficulty is in making sure that no reader is still inspecting
the list element you just removed before you free it, or modify any
field that the reader would be looking at (particularly the `next'
field :). One way of doing that is to defer the free or modification
to a quiescent point. If you have a separate `next_free' field, you
could safely put the element on a list of elements to be freed at the
next quiescent point.
Paul.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: kdb requires kallsyms
2001-10-10 7:14 ` kdb requires kallsyms Kirill Ratkin
@ 2001-10-10 7:38 ` BALBIR SINGH
0 siblings, 0 replies; 35+ messages in thread
From: BALBIR SINGH @ 2001-10-10 7:38 UTC (permalink / raw)
To: Kirill Ratkin; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 848 bytes --]
Kirill Ratkin wrote:
>Hi.
>
>I've trouble with kdb. I've patched my kernel (stable
>2.4.10) and tried to make kernel with kdb (from SGI)
>and I see :
>/bin/sh: /sbin/kallsyms: No such file or directory
>make[1]: *** [kallsyms] error 127
>
>Where can I find this kallsyms?
>
modutils provides this executable. please use
rpm -q --whatprovides `type <name of file>' to see which package provides
the executable.
Regards,
Balbir
>
>Regards,
>
>
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Make a great connection at Yahoo! Personals.
>http://personals.yahoo.com
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
[-- Attachment #2: Wipro_Disclaimer.txt --]
[-- Type: text/plain, Size: 853 bytes --]
----------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 5:05 ` Linus Torvalds
` (2 preceding siblings ...)
2001-10-10 7:36 ` Paul Mackerras
@ 2001-10-10 11:54 ` Keith Owens
2001-10-10 13:42 ` AIC7XXX war
3 siblings, 1 reply; 35+ messages in thread
From: Keith Owens @ 2001-10-10 11:54 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
On Wed, 10 Oct 2001 05:05:10 +0000 (UTC),
torvalds@transmeta.com (Linus Torvalds) wrote:
>Now, before people get all excited, what is this particular code
>actually _good_ for?
>
>Creating a lock-free list that allows insertion concurrently with lookup
>is _easy_.
>
>But what's the point? If you insert stuff, you eventually have to remove
>it. What goes up must come down. Insert-inane-quote-here.
>
>And THAT is the hard part. Doing lookup without locks ends up being
>pretty much worthless, because you need the locks for the removal
>anyway, at which point the whole thing looks pretty moot.
<pedantic>
It is possible to do completely lock free queue management, I have done
it (once). There are several major requirements :-
* Storage must never change its type (type stable storage). Once a
block has been assigned as struct foo, it must always contain struct
foo. This can be relaxed slightly as long as the data types have a
common header format.
The biggest problem this causes is that storage can never be released
and unmapped. You never know if somebody is going to follow an old
pointer to access storage that you freed. You must put the storage
on a free list for struct foo instead of unmapping it, to maintain
the type stable storage.
* Every piece of code that traverses the data tree for structure foo
must take a copy of each struct foo into local storage. After taking
a copy it must verify that its local copy is self consistent, via
validity indicators in each struct. The validity indicators are
typically generation numbers, whatever you use, the indicators must
be atomically updated and atomically read, with suitable wmb and rmb
barriers for machines with weak memory ordering.
* After following a pointer in your local copy of struct foo to access
another data area, you must verify that the master version of your
local copy has not been changed. If the master copy has changed then
the pointer you just followed is no longer reliable. In almost every
case you have to start the traversal from the beginning. It makes
for very convoluted reader and updater code.
</pedantic>
The only reason I used lock free read and update was to hook into an
existing system that mandated sub second responses. Some of the new
operations that were performed during list traversal and update were
subject to unbounded delays that were completely outside my control. I
could not afford to lock the data structures during traversal because
any delay in the new operations would completely stall the existing
system, also the existing system had to be able to retrieve and delete
data for the new operations at any time.
I don't recommend doing lock free unless you have absolutely no
alternative. It requires convoluted code, it is difficult to debug, it
is expensive on memory bandwidth (forget zero copy) and tends to be
expensive on storage as well.
If you are interested in lock free work, take a look at
http://www.cs.pitt.edu/~moir/papers.html, particularly Practical
Implementations of Non-Blocking Synchronization Primitives. But
beware, that paper has an error which caused intermittent bugs that
took me 5 months to track down. Section 3.3, proc Copy, line 6 should
be
6: y := addr->data[i];
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
2001-10-10 5:05 ` Linus Torvalds
@ 2001-10-10 13:24 ` Ivan Kokshaysky
2001-10-10 13:41 ` Andrea Arcangeli
1 sibling, 1 reply; 35+ messages in thread
From: Ivan Kokshaysky @ 2001-10-10 13:24 UTC (permalink / raw)
To: Andrea Arcangeli
Cc: Paul McKenney, Richard Henderson, linux-kernel, lse-tech,
Jay.Estabrook, Peter Rival
On Wed, Oct 10, 2001 at 04:05:02AM +0200, Andrea Arcangeli wrote:
> So before changing any code, I would prefer to double check with the
> current alpha architects that the read dependency really isn't enough to
> enforce read ordering without the need of rmb also on the beleeding edge
> ev6/ev67/etc.. cores. So potentially as worse we'd need to redefine
> wmb() as wmbdd() (and friends) only for EV5+SMP compiles of the kernel,
> but we wouldn't be affected with any recent hardware compiling for
> EV6/EV67. Jay, Peter, comments?
21264 Compiler Writer's Guide [appendix C] explicitly says that the
second load cannot issue if its address depends on a result of previous
load until that result is available. I refuse to believe that it isn't
true for older alphas, especially because they are strictly in-order
machines, unlike ev6.
I suspect some confusion here - probably that architect meant loads
to independent addresses. Of course, in this case mb() is required
to assure ordering.
Ivan.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 13:24 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Ivan Kokshaysky
@ 2001-10-10 13:41 ` Andrea Arcangeli
0 siblings, 0 replies; 35+ messages in thread
From: Andrea Arcangeli @ 2001-10-10 13:41 UTC (permalink / raw)
To: Ivan Kokshaysky
Cc: Paul McKenney, Richard Henderson, linux-kernel, lse-tech,
Jay.Estabrook, Peter Rival
On Wed, Oct 10, 2001 at 05:24:31PM +0400, Ivan Kokshaysky wrote:
> On Wed, Oct 10, 2001 at 04:05:02AM +0200, Andrea Arcangeli wrote:
> > So before changing any code, I would prefer to double check with the
> > current alpha architects that the read dependency really isn't enough to
> > enforce read ordering without the need of rmb also on the beleeding edge
> > ev6/ev67/etc.. cores. So potentially as worse we'd need to redefine
> > wmb() as wmbdd() (and friends) only for EV5+SMP compiles of the kernel,
> > but we wouldn't be affected with any recent hardware compiling for
> > EV6/EV67. Jay, Peter, comments?
>
> 21264 Compiler Writer's Guide [appendix C] explicitly says that the
> second load cannot issue if its address depends on a result of previous
> load until that result is available. I refuse to believe that it isn't
Fine, btw I also recall to have read something on those lines, and not
even in the 21264 manual but in the alpha reference manual that would
apply to all the chips but I didn't find it with a short lookup. Thanks
for checking!
> true for older alphas, especially because they are strictly in-order
> machines, unlike ev6.
Yes, it sounds strange. However According to Paul this would not be the
cpu but a cache coherency issue. rmb() would enforce the cache coherency
etc... so maybe the issue is related to old SMP motherboard etc... not
even to the cpus ... dunno. But as said it sounded very strange that
also new chips and new boards have such a weird reodering trouble.
> I suspect some confusion here - probably that architect meant loads
> to independent addresses. Of course, in this case mb() is required
> to assure ordering.
>
> Ivan.
Andrea
^ permalink raw reply [flat|nested] 35+ messages in thread
* AIC7XXX
2001-10-10 11:54 ` Keith Owens
@ 2001-10-10 13:42 ` war
2001-10-10 21:40 ` AIC7XXX Luigi Genoni
0 siblings, 1 reply; 35+ messages in thread
From: war @ 2001-10-10 13:42 UTC (permalink / raw)
To: linux-kernel
I'll try the new one out, but when I tried it out when it was first
introduced into the kernel, it had a lot of errors accessing my SCSI cdrom
drives.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 6:01 ` BALBIR SINGH
@ 2001-10-10 15:23 ` Victor Yodaiken
0 siblings, 0 replies; 35+ messages in thread
From: Victor Yodaiken @ 2001-10-10 15:23 UTC (permalink / raw)
To: BALBIR SINGH; +Cc: Linus Torvalds, linux-kernel
On Wed, Oct 10, 2001 at 11:31:08AM +0530, BALBIR SINGH wrote:
> Linus Torvalds wrote:
> >I can't think of many lists like that. The PCI lists certainly are both
> >add/remove: cardbus bridges and hotplug-PCI means that they are not just
> >purely "enumerate at bootup".
> >
>
> I agree, I just thought of one case quickly. Assume that somebody did a cat /proc/pci.
> Meanwhile somebody is adding a new pci device (hotplug PCI) simultaneously (which is very rare).
> I would not care if the new device showed up in the output of /proc/pci this time. It would
> definitely show up next time. Meanwhile locking the list (just in case it changes) is an
> overhead in the case above. I was referring to these cases in my earlier mail.
So you make the data structure and algorithms more complex and hard to maintain in
order to get an undetectable improvement in the speed of something that almost
never happens and and that is not even in the same neighborhood as being a
bottleneck?
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 7:36 ` Paul Mackerras
@ 2001-10-10 15:54 ` Victor Yodaiken
2001-10-10 21:56 ` Keith Owens
0 siblings, 1 reply; 35+ messages in thread
From: Victor Yodaiken @ 2001-10-10 15:54 UTC (permalink / raw)
To: Paul Mackerras; +Cc: torvalds, linux-kernel
On Wed, Oct 10, 2001 at 05:36:18PM +1000, Paul Mackerras wrote:
> Linus Torvalds writes:
>
> > And THAT is the hard part. Doing lookup without locks ends up being
> > pretty much worthless, because you need the locks for the removal
> > anyway, at which point the whole thing looks pretty moot.
> >
> > Did I miss something?
>
> I believe this all becomes (much more) useful when you are doing
> read-copy-update.
>
> There is an assumption that anyone modifying the list (inserting or
> deleting) would take a lock first, so the deletion is just a pointer
> assignment. Any reader traversing the list (without a lock) sees
> either the old pointer or the new, which is fine.
>
> The difficulty is in making sure that no reader is still inspecting
> the list element you just removed before you free it, or modify any
> field that the reader would be looking at (particularly the `next'
> field :). One way of doing that is to defer the free or modification
> to a quiescent point. If you have a separate `next_free' field, you
> could safely put the element on a list of elements to be freed at the
> next quiescent point.
And the "next quiescent point" must be a synchronization point and that must
have spinlocks around it!
Although I kind of like the idea of
normal operation create mess by avoiding synchronization
when system seems idle, get BKL, and clean up.
>
> Paul.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 3:33 ` Paul Mackerras
@ 2001-10-10 17:02 ` Richard Henderson
0 siblings, 0 replies; 35+ messages in thread
From: Richard Henderson @ 2001-10-10 17:02 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Paul McKenney, linux-kernel, lse-tech
On Wed, Oct 10, 2001 at 01:33:58PM +1000, Paul Mackerras wrote:
> 1. Define an rmbdd() which is a no-op on all architectures except for
> alpha, where it is an rmb. Richard can then have the job of
> finding all the places where an rmbdd is needed, which sounds like
> one of the smellier labors of Hercules to me. :)
I don't think it's actually all that bad. There won't be all
that many places that require the rmbdd, and they'll pretty
much exactly correspond to the places in which you have to put
wmb for all architectures anyway.
r~
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: AIC7XXX
2001-10-10 13:42 ` AIC7XXX war
@ 2001-10-10 21:40 ` Luigi Genoni
0 siblings, 0 replies; 35+ messages in thread
From: Luigi Genoni @ 2001-10-10 21:40 UTC (permalink / raw)
To: war; +Cc: linux-kernel
I had similar problems at the beginning, but now this new driver is well
working, ate less for me.
Luigi
On Wed, 10 Oct 2001, war wrote:
> I'll try the new one out, but when I tried it out when it was first
> introduced into the kernel, it had a lot of errors accessing my SCSI cdrom
> drives.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 15:54 ` Victor Yodaiken
@ 2001-10-10 21:56 ` Keith Owens
2001-10-10 22:24 ` Victor Yodaiken
0 siblings, 1 reply; 35+ messages in thread
From: Keith Owens @ 2001-10-10 21:56 UTC (permalink / raw)
To: Victor Yodaiken; +Cc: Paul Mackerras, torvalds, linux-kernel
On Wed, 10 Oct 2001 09:54:36 -0600,
Victor Yodaiken <yodaiken@fsmlabs.com> wrote:
>Although I kind of like the idea of
> normal operation create mess by avoiding synchronization
> when system seems idle, get BKL, and clean up.
That does not work. A process can read an entry from a list then
perform an operation that puts the process to sleep. When it wakes up
again, how can it tell if the list has been changed? How can the
cleanup code tell if any process has slept while it was traversing a
list? An idle system does not prevent processes from sleeping at the
wrong point.
Don't even think of requiring "processes must not sleep while
traversing a lock free list". Programmers cannot get "processes must
not sleep while holding a lock" correct and that error is much easier
to detect.
The inability for update code to know when a lock free list is being
traversed is the reason that most lock free work requires type stable
storage. You can mark a list entry as free and put it on a free chain
but you can never unmap the storage nor use the free entry for data of
a different type. That is the only way to guarantee that a process can
safely determine if the list has changed under it during traversal
while still allowing the process to be interrupted or to sleep.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 21:56 ` Keith Owens
@ 2001-10-10 22:24 ` Victor Yodaiken
2001-10-10 23:46 ` David S. Miller
0 siblings, 1 reply; 35+ messages in thread
From: Victor Yodaiken @ 2001-10-10 22:24 UTC (permalink / raw)
To: Keith Owens; +Cc: Victor Yodaiken, Paul Mackerras, torvalds, linux-kernel
On Thu, Oct 11, 2001 at 07:56:43AM +1000, Keith Owens wrote:
> On Wed, 10 Oct 2001 09:54:36 -0600,
> Victor Yodaiken <yodaiken@fsmlabs.com> wrote:
> >Although I kind of like the idea of
> > normal operation create mess by avoiding synchronization
> > when system seems idle, get BKL, and clean up.
>
> That does not work. A process can read an entry from a list then
> perform an operation that puts the process to sleep. When it wakes up
> again, how can it tell if the list has been changed? How can the
In general you're right, and always its better to
reduce contention than to come up with silly algorithms for
reducing the cost of contention, but if you want to live
dangerously:
reader:
atomic increment read_count
do stuff; skip queue elements marked
as zombie
atomic decrement read_count
writer:
spin lock queue
to delete element
mark element as zombie
unspin
cleanup:
spin lock queue
if(read_count == 0){
get big kernel lock
if(read_count is still 0)
// now nobody will be able to get to queue
clean up queue
unlock kernel
}
unlock spin
So you accomplished making the code harder to read and maintain, slowing
down worst case, and maybe reducing average case read spinlock delay.
For some very carefully selected cases this may be a win, but ...
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 22:24 ` Victor Yodaiken
@ 2001-10-10 23:46 ` David S. Miller
2001-10-11 0:24 ` Davide Libenzi
0 siblings, 1 reply; 35+ messages in thread
From: David S. Miller @ 2001-10-10 23:46 UTC (permalink / raw)
To: yodaiken; +Cc: kaos, paulus, torvalds, linux-kernel
From: Victor Yodaiken <yodaiken@fsmlabs.com>
Date: Wed, 10 Oct 2001 16:24:19 -0600
In general you're right, and always its better to
reduce contention than to come up with silly algorithms for
reducing the cost of contention,
I want to second this and remind people that the "cost" of spinlocks
is mostly not "spinning idly waiting for lock", rather the big cost
is shuffling the dirty cacheline ownership between the processors.
Any scheme involving shared data which is written (the read counts
in the various "lockless" schemes are examples) have the same "cost"
assosciated with them.
In short, I see no performance gain from the lockless algorithms
even in the places where they can be applied.
I spent some time oogling over lockless algorithms a few years ago,
but I stopped once I realized where the true costs were. In my view,
the lockless algorithms perhaps are a win in parallel processing
environments (in fact, the supercomputing field is where a lot of the
lockless algorithm research comes from) but not in the kinds of places
and with the kinds of data structure usage the Linux kernel has.
Franks a lot,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
2001-10-10 23:46 ` David S. Miller
@ 2001-10-11 0:24 ` Davide Libenzi
0 siblings, 0 replies; 35+ messages in thread
From: Davide Libenzi @ 2001-10-11 0:24 UTC (permalink / raw)
To: David S. Miller; +Cc: yodaiken, kaos, paulus, torvalds, linux-kernel
On Wed, 10 Oct 2001, David S. Miller wrote:
> From: Victor Yodaiken <yodaiken@fsmlabs.com>
> Date: Wed, 10 Oct 2001 16:24:19 -0600
>
> In general you're right, and always its better to
> reduce contention than to come up with silly algorithms for
> reducing the cost of contention,
>
> I want to second this and remind people that the "cost" of spinlocks
> is mostly not "spinning idly waiting for lock", rather the big cost
> is shuffling the dirty cacheline ownership between the processors.
>
> Any scheme involving shared data which is written (the read counts
> in the various "lockless" schemes are examples) have the same "cost"
> assosciated with them.
>
> In short, I see no performance gain from the lockless algorithms
> even in the places where they can be applied.
>
> I spent some time oogling over lockless algorithms a few years ago,
> but I stopped once I realized where the true costs were. In my view,
> the lockless algorithms perhaps are a win in parallel processing
> environments (in fact, the supercomputing field is where a lot of the
> lockless algorithm research comes from) but not in the kinds of places
> and with the kinds of data structure usage the Linux kernel has.
Agree.
To have a complete list handling you've to end up locking or
write stressing counter variables to simulate locks.
Just only having special handled lists that removes write ops from irq
handlers can make you save a big cost of ..._irqsave()/restore().
And these can be realized by having an extra list of insert/remove ops
that is filled with no locks by irq handlers and is truncated/flushed by a
__xchg() done by readers.
- Davide
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2001-10-11 0:18 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-09 15:45 RFC: patch to allow lock-free traversal of lists with insertion Paul McKenney
2001-10-09 17:00 ` Richard Henderson
2001-10-10 3:33 ` Paul Mackerras
2001-10-10 17:02 ` Richard Henderson
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
2001-10-10 5:05 ` Linus Torvalds
2001-10-10 5:17 ` BALBIR SINGH
2001-10-10 5:29 ` Davide Libenzi
2001-10-10 5:46 ` Linus Torvalds
2001-10-10 6:01 ` BALBIR SINGH
2001-10-10 15:23 ` Victor Yodaiken
2001-10-10 7:14 ` kdb requires kallsyms Kirill Ratkin
2001-10-10 7:38 ` BALBIR SINGH
2001-10-10 6:16 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul Mackerras
2001-10-10 6:30 ` Linus Torvalds
2001-10-10 7:36 ` Paul Mackerras
2001-10-10 15:54 ` Victor Yodaiken
2001-10-10 21:56 ` Keith Owens
2001-10-10 22:24 ` Victor Yodaiken
2001-10-10 23:46 ` David S. Miller
2001-10-11 0:24 ` Davide Libenzi
2001-10-10 11:54 ` Keith Owens
2001-10-10 13:42 ` AIC7XXX war
2001-10-10 21:40 ` AIC7XXX Luigi Genoni
2001-10-10 13:24 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Ivan Kokshaysky
2001-10-10 13:41 ` Andrea Arcangeli
-- strict thread matches above, loose matches on Subject: below --
2000-12-18 1:03 aic7xxx Douglas Gilbert
2000-12-17 2:12 aic7xxx Mathias Wiklander
2000-12-17 7:41 ` aic7xxx stewart
2000-12-17 9:08 ` aic7xxx Mathias Wiklander
2000-12-17 10:30 ` aic7xxx Mohammad A. Haque
2000-12-17 10:49 ` aic7xxx Mathias Wiklander
2000-12-17 14:41 ` aic7xxx stewart
2000-12-17 21:14 ` aic7xxx Mohammad A. Haque
2000-12-19 21:22 ` aic7xxx Mathias Wiklander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox