All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Andy Grover <agrover@redhat.com>, Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com, mpatocka@redhat.com
Subject: Re: [PATCH 1/3] dm: a basic support for using the select or poll function
Date: Fri, 12 May 2017 08:48:53 +0200	[thread overview]
Message-ID: <1494571733.4987.2.camel@suse.com> (raw)
In-Reply-To: <b14635cd-095f-a466-18cd-ced079b949f6@redhat.com>

On Thu, 2017-05-11 at 14:46 -0700, Andy Grover wrote:
> 
> a) Application notes initial event_nrs for all relevant devices
> while (1)
>      b) Application calls ARM_POLL
>      c) Application gets updated event_nrs from LIST_DEVICES and
> handles
>      d) Application calls poll()
> 
> If events arrive between b and c, app sees them.
> If events arrive between c and d, dm_global_event_nr is greater than 
> priv->global_event_nr and poll() will indicate fd is ready
> immediately 
> w/o sleeping.
> If events arrive after d, app sleeps in poll() until fd is ready.
> 
> The difference is that you have to ARM_POLL and *then* process
> events 
> before calling poll(). The only small negative consequence is that if
> an 
> event arrives between b and c, it will be handled by c but poll()
> will 
> still see readiness and pop out of the poll() and loop again when it 
> strictly didn't have to. But events won't be lost.

I see, that would work. The call sequence is reversed compared to
"classical" poll() usage. Not a big problem, just something to be aware
of. Will there be some wrapper in libdm to make sure applications
adhere to these semantics?

And how does user space find out whether the kernel supports this
functionality?

Regards,
Martin

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2017-05-12  6:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 19:10 [PATCH 0/3] poll()able DM events Andy Grover
2017-05-09 19:10 ` [PATCH 1/3] dm: a basic support for using the select or poll function Andy Grover
2017-05-11  9:39   ` Martin Wilck
2017-05-11  9:43     ` Martin Wilck
2017-05-11 13:21       ` Mike Snitzer
2017-05-11 18:10         ` Andy Grover
2017-05-11 19:49           ` Martin Wilck
2017-05-11 20:21             ` Alasdair G Kergon
2017-05-11 20:45               ` Martin Wilck
2017-05-11 21:38                 ` Alasdair G Kergon
2017-05-11 19:30         ` Martin Wilck
2017-05-11 21:46           ` Andy Grover
2017-05-12  6:48             ` Martin Wilck [this message]
2017-05-11 21:50           ` Alasdair G Kergon
2017-05-12 15:52           ` Mikulas Patocka
2017-05-09 19:10 ` [PATCH 2/3] dm-ioctl: add a new DM_DEV_ARM_POLL ioctl Andy Grover
2017-05-09 19:10 ` [PATCH 3/3] dm-ioctl: report event number in DM_LIST_DEVICES Andy Grover
2017-05-09 21:14 ` [PATCH 0/3] poll()able DM events Mike Snitzer
2017-09-17  2:41 ` [PATCH 3/3] dm-ioctl: report event number in DM_LIST_DEVICES Eugene Syromiatnikov
2017-09-19 16:47   ` Andy Grover
2017-09-20 11:29   ` [PATCH] dm-ioctl: fix alignment of event number in the device list Mikulas Patocka

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=1494571733.4987.2.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=agrover@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@redhat.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.