[8217] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: semaphores and queueing commands

daemon@ATHENA.MIT.EDU (Matthew Dharm)
Thu Feb 24 16:44:33 2000

Date:   Thu, 24 Feb 2000 09:27:48 -0800 (PST)
From: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: The Linux SCSI list <linux-scsi@vger.rutgers.edu>
In-Reply-To: <E12NwoA-0005gm-00@the-village.bc.nu>
Message-ID: <Pine.LNX.4.10.10002240925000.19400-100000@ziggy.one-eyed-alien.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 24 Feb 2000, Alan Cox wrote:

> > do lots more stuff
> > call the scsi_done() function
> 
> Do you call scsi_done holding the io_request lock ?

I don't think so.  At least, I never explicitly request this lock.  Is
someone else requesting it for me?

> > And, while I'm writting this, is there some generic kernel queuing code
> > that I can use somewhere?  i.e. something that allows me to declare a
> 
> The sk_buff code has some examples of generic irq safe queueing code. It
> basically does
> 
> add_
> 	spin_lock_irqsave(&queue_lock, flags);
> 	item->next=NULL;
> 	queue->tail=item;
> 	spin_unlock_irqrestore(queue_lock, flags)
> 
> etc. and spinlocks very short pieces of code.

I've seen this sort of construction before, but there is no clear
documentation on exactly how to use spin locks, or what the parameters
mean.  Could you shed some light on the subject?  Also, this looks like it
just protects the data structure without giving me a way to block a thread
on queue input.  Is that the case, or am I reading it wrong?

Matt Dharm

-- 
Matthew Dharm                              Home: mdharm@one-eyed-alien.net 
Engineer, Qualcomm, Inc.                         Work: mdharm@qualcomm.com

Somebody call an exorcist!
					-- Dust Puppy
User Friendly, 5/16/1998


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post