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 fla

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 uncond

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 t

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 > spin_unlock

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 dr

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 th

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 f

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? > > I

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

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

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 i

io_request_lock question (2.2)

2000-12-07 Thread Reto Baettig
Hi I'm trying to write a block device driver which does some network stuff to satisfy the requests. The problem is, that the network stuff wants to grab the io_request_lock which does not work because this lock is already locked when I come into the request_fn of my device. I looked at the im