All of lore.kernel.org
 help / color / mirror / Atom feed
From: willy@linux.intel.com (Matthew Wilcox)
Subject: Proposal for handling async event requests
Date: Fri, 31 May 2013 12:53:01 -0400	[thread overview]
Message-ID: <20130531165301.GH8211@linux.intel.com> (raw)
In-Reply-To: <5E6652408D93274292C8F06C9A4A26008454B480@NTXBOIMBX05.micron.com>

On Fri, May 31, 2013@03:04:41PM +0000, Neal Galbo (ngalbo) wrote:
> I think handling should be localized and associated through an existing, running NVMe driver, i.e. not a separate daemon.

OK, so we're fundamentally in agreement, it's just a matter of negotiating
the API?  :-)

> 1) User space (or supervisor) issues ioctl to "open" and enable AEN feature to a loaded, running driver in anticipation of receiving async events. Ioctl parameters contain pointer to callback routine and buffer space to receive AEN's.
> 2) When driver receives ioctl it saves incoming parameters, sets up to receive AEN's (otherwise it's "closed"/disabled). The driver can manage the AEN's within, directly or could launch an AEN handler worker thread that it owns or various other ways.
> 3) When AEN is received, driver or AEN manager calls back through pointer, deposits AEN info.
> 4) Provide a corresponding "close" ioctl to disable the AEN chatter when not needed.
> 5) ??? provide unique tags/id's in ioctl parameters to allow multiple openers. Unique tag generator should be located at a central point ... like the driver? (another ioctl to get a unique tag?)

Yes, this approach definitely works.  Essentially, we're putting a
completion queue in userspace.  How do you envisage notifying userspace
that it has new entries?  The advantage of read() on the character device
is that it can block.  We can also use the poll() mechanism to wake up
tasks that are waiting for new entries.  I suppose we could also use
poll() with your scheme.

Another approach would be zero-copy; userspace could mmap the character
device and get a completion queue that way.  I'm not expecting this to
be sufficiently high performance to warrant such an approach :-)

  reply	other threads:[~2013-05-31 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 13:35 Proposal for handling async event requests Matthew Wilcox
2013-05-31 15:04 ` Neal Galbo (ngalbo)
2013-05-31 16:53   ` Matthew Wilcox [this message]
2013-05-31 19:26     ` Neal Galbo (ngalbo)

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=20130531165301.GH8211@linux.intel.com \
    --to=willy@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.