public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>,
	Nicholas Bellinger <nab@linux-iscsi.org>,
	linux-scsi@vger.kernel.org
Subject: Re: Proposal for a scalable SCSI midlayer
Date: Wed, 26 Feb 2014 11:12:13 -0600	[thread overview]
Message-ID: <1393434733.2274.10.camel@dabdike> (raw)
In-Reply-To: <530DC92C.5070603@acm.org>

On Wed, 2014-02-26 at 11:59 +0100, Bart Van Assche wrote:
> On 02/23/14 21:10, James Bottomley wrote:
> > Right ... my ideal here if we can achieve it would be lockless threaded
> > models, where we could make guarantees like single thread of execution
> > per command, so all command state could be lockless.
> 
> This approach sounds interesting but could be challenging to implement.
> With this approach it would no longer be safe to access the SCSI command
> state from interrupt nor from tasklet context.

I don't think so: a SCSI command has to be in a distinct state, either
preparing, dispatching (at HBA) or returning (or a variety of states in
between).  It can't be in more than one state, so we can still guarantee
the per command variables can be accessed locklessly from any context
because if more than one CPU is operating on it simultaneously, we just
broke the state machine.

The challenge comes from the device variables:  a device can have a
bunch of commands in various states.  However, if we can guarantee
single CPU dispatch per device queue, then we could also use lockless
plus sloppy counters on the device variables because the CPU can only be
in a single state per queue even if multiple commands in the queue are
in different states.  The times we need to see the per-queue state
rolled up are fairly well defined, so we can shift the expense of the
rollup operation to the aggregation phase, hence sloppy counters.


James


>  That means that the I/O
> completion path would have to be modified such that instead of using an
> IPI to invoke a tasklet at the CPU that submitted the SCSI command a new
> mechanism would have to be used that causes the I/O completion code to
> run directly on the context of the thread that submitted the SCSI command.
> 
> Bart.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




      reply	other threads:[~2014-02-26 17:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 12:39 Proposal for a scalable SCSI midlayer Christoph Hellwig
2014-02-23 20:10 ` James Bottomley
2014-02-24  4:25   ` Christoph Hellwig
2014-02-26 10:59   ` Bart Van Assche
2014-02-26 17:12     ` James Bottomley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393434733.2274.10.camel@dabdike \
    --to=james.bottomley@hansenpartnership.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox