Re: [PATCH] bsg: Add support for submitting requests at tail of queue

FUJITA Tomonori
2009-01-23T06:15:17Z

On Thu, 22 Jan 2009 16:27:59 -0600
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

> On Fri, 2009-01-23 at 07:03 +0900, FUJITA Tomonori wrote:
> > So, Boaz, what do you want to do exactly? It should have in the patch
> > description. I don't want to add something that nobody uses.
>
> OK, can we step back a bit from this? Everyone seems to be talking past
> each other. The original complaint was that multiple commands against
> the same device issued by SG_IO could be executed "out of order". This
> is really irrelevant because we never guarantee execution order in the
> first place.
>
> However, if you consider our current at head insertion policy coupled
> with a multi-threaded application issuing hundreds of SG_IO requests at
> once, you can see we have a potential starvation issue: Commands at the
> tail of the queue end up pushed further and further back as more
> commands are added to the head. This starvation issue is worth
> addressing, I think, and it can only be addressed by allowing tail
> insertion.

Ah, I see. Thanks. We could see this with something busy.

BTW, bsg write interface enables you to send a command asynchronously
so a single-thread-ed application could cause this.