Re: io_request_lock question (2.2)

2000-12-08 Thread Andi Kleen
On Fri, Dec 08, 2000 at 04:19:45PM -0800, Matthew Jacob wrote: > > > > > > > On Fri, 8 Dec 2000, Alan Cox wrote: > > > > > > > > Yes, and I believe that this is what's broken about the SCSI midlayer. The >the > > > > > io_request_lock cannot be completely released in a SCSI HBA because the

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
> > You can drop it with spin_unlock_irq and that is fine. I do that with no > > problems in the I2O scsi driver for example > > I am (like, I think I *finally* got locking sorta right in my QLogic driver), > but doesn't this still leave ints blocked for this CPU at least? spin_unlock_irq

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
> > > > On Fri, 8 Dec 2000, Alan Cox wrote: > > > > > > Yes, and I believe that this is what's broken about the SCSI midlayer. The the > > > > io_request_lock cannot be completely released in a SCSI HBA because the flags > > > > > > You can drop it with spin_unlock_irq and that is fine. I do

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
> > I am actually concerned about the following case: > > The add_request ON CPU_1 function calls > spin_lock_irqsave(_request_lock,flags); > > Our I/O Function unlocks the spinlock and goes to sleep. > > Finally, the add_request function, NOW ON CPU_2 calls >

Re: io_request_lock question (2.2)

2000-12-08 Thread Andi Kleen
On Fri, Dec 08, 2000 at 04:03:58PM -0800, Matthew Jacob wrote: > > > On Fri, 8 Dec 2000, Alan Cox wrote: > > > > Yes, and I believe that this is what's broken about the SCSI midlayer. The the > > > io_request_lock cannot be completely released in a SCSI HBA because the flags > > > > You can

Re: io_request_lock question (2.2)

2000-12-08 Thread Reto Baettig
> > > > On Fri, 8 Dec 2000, Alan Cox wrote: > > > > Yes, and I believe that this is what's broken about the SCSI midlayer. The the > > > io_request_lock cannot be completely released in a SCSI HBA because the flags > > > > You can drop it with spin_unlock_irq and that is fine. I do that with

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
On Fri, 8 Dec 2000, Alan Cox wrote: > > Yes, and I believe that this is what's broken about the SCSI midlayer. The the > > io_request_lock cannot be completely released in a SCSI HBA because the flags > > You can drop it with spin_unlock_irq and that is fine. I do that with no > problems in

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
> Yes, and I believe that this is what's broken about the SCSI midlayer. The the > io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with spin_unlock_irq and that is fine. I do that with no problems in the I2O scsi driver for example - To unsubscribe

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
> > spin_lock_irq(_request_lock); > > we finish the request and return to the add_request function which calls > > spin_unlock_irqrestore(_request_lock,flags); > > and restores the flags. > > > > Isn't it possible now that the flags which we restore are out of date now? > > Is

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
> spin_lock_irq(_request_lock); > we finish the request and return to the add_request function which calls > spin_unlock_irqrestore(_request_lock,flags); > and restores the flags. > > Isn't it possible now that the flags which we restore are out of date now? > Is this idiom the

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
spin_lock_irq(io_request_lock); we finish the request and return to the add_request function which calls spin_unlock_irqrestore(io_request_lock,flags); and restores the flags. Isn't it possible now that the flags which we restore are out of date now? Is this idiom the

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
spin_lock_irq(io_request_lock); we finish the request and return to the add_request function which calls spin_unlock_irqrestore(io_request_lock,flags); and restores the flags. Isn't it possible now that the flags which we restore are out of date now? Is this idiom

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with spin_unlock_irq and that is fine. I do that with no problems in the I2O scsi driver for example - To unsubscribe

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
On Fri, 8 Dec 2000, Alan Cox wrote: Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with spin_unlock_irq and that is fine. I do that with no problems in the I2O

Re: io_request_lock question (2.2)

2000-12-08 Thread Reto Baettig
On Fri, 8 Dec 2000, Alan Cox wrote: Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with spin_unlock_irq and that is fine. I do that with no problems

Re: io_request_lock question (2.2)

2000-12-08 Thread Andi Kleen
On Fri, Dec 08, 2000 at 04:03:58PM -0800, Matthew Jacob wrote: On Fri, 8 Dec 2000, Alan Cox wrote: Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
I am actually concerned about the following case: The add_request ON CPU_1 function calls spin_lock_irqsave(io_request_lock,flags); Our I/O Function unlocks the spinlock and goes to sleep. Finally, the add_request function, NOW ON CPU_2 calls

Re: io_request_lock question (2.2)

2000-12-08 Thread Matthew Jacob
On Fri, 8 Dec 2000, Alan Cox wrote: Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can drop it with spin_unlock_irq and that is fine. I do that with no

Re: io_request_lock question (2.2)

2000-12-08 Thread Alan Cox
You can drop it with spin_unlock_irq and that is fine. I do that with no problems in the I2O scsi driver for example I am (like, I think I *finally* got locking sorta right in my QLogic driver), but doesn't this still leave ints blocked for this CPU at least? spin_unlock_irq

Re: io_request_lock question (2.2)

2000-12-08 Thread Andi Kleen
On Fri, Dec 08, 2000 at 04:19:45PM -0800, Matthew Jacob wrote: On Fri, 8 Dec 2000, Alan Cox wrote: Yes, and I believe that this is what's broken about the SCSI midlayer. The the io_request_lock cannot be completely released in a SCSI HBA because the flags You can

Re: io_request_lock question (2.2)

2000-12-07 Thread Reto Baettig
> > > I looked at the implementation of the nbd which just calls > > > > spin_unlock_irq(_request_lock); > > ... do network io ... > > spin_lock_irq(_request_lock); > > > > This seems to work but it looks very dangerous to me (and ugly, too). Isn't there >a better way to do this?

Re: io_request_lock question (2.2)

2000-12-07 Thread Alan Cox
> I looked at the implementation of the nbd which just calls > > spin_unlock_irq(_request_lock); > ... do network io ... > spin_lock_irq(_request_lock); > > This seems to work but it looks very dangerous to me (and ugly, too). Isn't there a >better way to do this? It is

Re: io_request_lock question (2.2)

2000-12-07 Thread Alan Cox
I looked at the implementation of the nbd which just calls spin_unlock_irq(io_request_lock); ... do network io ... spin_lock_irq(io_request_lock); This seems to work but it looks very dangerous to me (and ugly, too). Isn't there a better way to do this? It is only

Re: io_request_lock question (2.2)

2000-12-07 Thread Reto Baettig
I looked at the implementation of the nbd which just calls spin_unlock_irq(io_request_lock); ... do network io ... spin_lock_irq(io_request_lock); This seems to work but it looks very dangerous to me (and ugly, too). Isn't there a better way to do this? It is