public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Michael Kerrisk <mtk-manpages@gmx.net>
Cc: "\"David Härdeman\"" <david@hardeman.nu>,
	lee.schermerhorn@hp.com, torvalds@linux-foundation.org,
	vda.linux@googlemail.com, rdunlap@xenotime.net, corbet@lwn.net,
	hch@lst.de, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, geoff@gclare.org.uk,
	drepper@redhat.com, davidel@xmailserver.org
Subject: Re: RFC: A revised timerfd API
Date: Tue, 18 Sep 2007 11:27:15 +0200	[thread overview]
Message-ID: <1190107635.2995.109.camel@chaos> (raw)
In-Reply-To: <20070918090110.235160@gmx.net>

On Tue, 2007-09-18 at 11:01 +0200, Michael Kerrisk wrote:
> > With solution c) you have to keep two
> > references to the same timer around and use one of them depending on what
> > you want to do with the timer.
> 
> Yes.  (And the same for option (d).)
> 
> > Also, if the timerfd is close():d, does that remove the underlying timer
> > (invalidate the timerid) as well?
> 
> My gut feeling would be to say that closing the timerfd would not
> remove the underlying timer (so the timerid would remain valid).
> One could even do things like recreating a file descriptor
> for the timer using another timerfd() call.  
> 
> But now that raises the question: what are the semantics if
> timerfd() is called  more than once on the same timerid? 
> Perhaps a read() from any one of them (destructively)
> reads the expiration count, as though one had read from a 
> dup()ed the file descriptor.  All in all, solution (c) 
> starts to look overly complex, and maybe suffers from 
> various dirty corners in the API.  (Solution (d) feels 
> slightly better, because the creation of the file descriptor
> and the timerid are integrated into a single call, and the
> fact that it integrates with an existing API, but
> it still has the limitation you describe above.)

I don't think it is a big problem to have several open file descriptors
on a single posix timer without having destructive reads, we just need
to store the event count per file descriptor in file->private_data. We
solved this in the UIO code already and it works perfectly fine.

	tglx



  reply	other threads:[~2007-09-18  9:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18  7:27 RFC: A revised timerfd API Michael Kerrisk
2007-09-18  7:30 ` Michael Kerrisk
2007-09-18  8:05   ` David Härdeman
2007-09-18  9:01     ` Michael Kerrisk
2007-09-18  9:27       ` Thomas Gleixner [this message]
2007-09-18  9:10   ` Thomas Gleixner
2007-09-18  9:30     ` Michael Kerrisk
2007-09-18  9:42       ` Thomas Gleixner
2007-09-18 11:08         ` Michael Kerrisk
2007-09-18 11:30           ` Thomas Gleixner
2007-09-18 13:13             ` David Härdeman
2007-09-22 13:03               ` Michael Kerrisk
2007-09-18 16:51 ` Davide Libenzi
2007-09-22 13:12   ` Michael Kerrisk
2007-09-22 14:32     ` Bernd Eckenfels
2007-09-22 16:07       ` Michael Kerrisk
2007-09-22 17:05         ` Thomas Gleixner
2007-09-22 23:37         ` David Härdeman
2007-09-22 17:10     ` Thomas Gleixner
2007-09-22 21:07     ` Davide Libenzi
2007-09-22 21:26       ` Thomas Gleixner
2007-09-22 23:21         ` Davide Libenzi
2007-09-23 17:33       ` Michael Kerrisk
2007-09-23 18:33         ` Davide Libenzi
2007-09-23 18:41           ` Davide Libenzi
2007-09-23 19:03             ` Michael Kerrisk

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=1190107635.2995.109.camel@chaos \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=david@hardeman.nu \
    --cc=davidel@xmailserver.org \
    --cc=drepper@redhat.com \
    --cc=geoff@gclare.org.uk \
    --cc=hch@lst.de \
    --cc=lee.schermerhorn@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk-manpages@gmx.net \
    --cc=rdunlap@xenotime.net \
    --cc=torvalds@linux-foundation.org \
    --cc=vda.linux@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox