From: Neil Horman <nhorman@tuxdriver.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dave Airlie <airlied@gmail.com>,
Segher Boessenkool <segher@kernel.crashing.org>,
linux-kernel@vger.kernel.org, a.zummo@towertech.it,
jg@freedesktop.org
Subject: Re: [PATCH] RTC: Add mmap method to rtc character driver
Date: Tue, 25 Jul 2006 20:03:14 -0400 [thread overview]
Message-ID: <20060726000314.GB5147@localhost.localdomain> (raw)
In-Reply-To: <44C6A7B7.8010604@zytor.com>
On Tue, Jul 25, 2006 at 04:22:31PM -0700, H. Peter Anvin wrote:
> Neil Horman wrote:
> >>>
> >>Quick hacks are frowned upon in the Linux universe. The kernel-user
> >>space interface is supposed to be stable, and thus a hack like this has
> >>to be maintained indefinitely.
> >>
> >>Putting temporary hacks like this in is not a good idea.
> >>
> >Only if you make the mental leap that this is a hack; its not. Its a new
> >feature for a driver. mmap on device drivers is a well known and
> >understood
> >interface. There is nothing hackish about it. And there is no need for
> >it to
> >be temporary either. Why shouldn't the rtc driver be able to export a
> >monotonic
> >counter via the mmap interface? mmtimer does it already, as do many other
> >drivers. Theres nothing unstable about this interface, and it need not be
> >short
> >lived. It can live in perpituity, and applications can choose to use it,
> >or
> >migrate away from it should something else more efficient become available
> >(a
> >gettimeofday vsyscall). More importantly, it can continue to be used in
> >those
> >situations where a vsyscall is not feasable, or simply maps to the nominal
> >slow
> >path kernel trap that one would find to heavy-weight to use in comparison
> >to an
> >mmaped page.
> >
>
> The reason it is a hack is because you're hard-coding the fact that
> you're taking a global, periodic interrupt. Yes, it can be dealt with
> scheduler hacks in tickless case, but that seems really heavyweight.
>
I think that is an enormous overstatement.
My patch most certainly does not export that fact. The only thing it provides
to userspace is a regular monotonically increasing counter independent of any
userspace scheduling. The implementation using a regular interrupt is
completely hidden from userspace. The rtc driver itself is whats responsible
for the global periodic interrupt. By your logic the driver itself is a hack.
Honestly, this patch doesn't do any harm. Any application using it currently
creates the same interrupt behavior that it would if it used the mmap interface.
I think the only argument here is that applications using other timing
facilities would create additional interrupts, but given that those applications
are using interfaces with more overhead than this one, making the switch would
be a net gain.
Neil
> -hpa
next prev parent reply other threads:[~2006-07-26 0:07 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-25 17:41 [PATCH] RTC: Add mmap method to rtc character driver Neil Horman
2006-07-25 17:55 ` Arjan van de Ven
2006-07-25 18:01 ` Jim Gettys
2006-07-25 18:22 ` Neil Horman
2006-07-25 18:32 ` Arjan van de Ven
2006-07-25 18:43 ` Neil Horman
2006-07-25 18:53 ` Arjan van de Ven
2006-07-25 19:03 ` Neil Horman
2006-07-25 19:06 ` Arjan van de Ven
2006-07-25 19:07 ` John W. Linville
2006-07-25 19:16 ` Arjan van de Ven
2006-07-25 19:08 ` H. Peter Anvin
2006-07-25 17:57 ` Segher Boessenkool
2006-07-25 18:28 ` Neil Horman
2006-07-25 18:56 ` Segher Boessenkool
2006-07-25 19:07 ` Neil Horman
2006-07-25 19:10 ` H. Peter Anvin
2006-07-25 19:21 ` Neil Horman
2006-07-25 19:31 ` Segher Boessenkool
2006-07-25 19:47 ` Neil Horman
2006-07-25 20:04 ` Dave Airlie
2006-07-25 20:24 ` H. Peter Anvin
2006-07-25 20:47 ` Neil Horman
2006-07-25 20:50 ` H. Peter Anvin
2006-07-25 22:25 ` Neil Horman
2006-07-25 22:33 ` H. Peter Anvin
2006-07-25 23:10 ` Neil Horman
2006-07-25 23:22 ` H. Peter Anvin
2006-07-26 0:03 ` Neil Horman [this message]
2006-07-25 23:29 ` David Lang
2006-07-26 0:18 ` Neil Horman
2006-07-25 23:29 ` Segher Boessenkool
2006-07-25 23:56 ` Neil Horman
2006-07-26 0:02 ` H. Peter Anvin
2006-07-26 0:20 ` Neil Horman
2006-07-26 0:36 ` H. Peter Anvin
2006-07-26 14:45 ` A better interface, perhaps: a timed signal flag Theodore Tso
2006-07-28 13:33 ` Steven Rostedt
2006-07-28 14:52 ` Theodore Tso
2006-07-28 15:05 ` Steven Rostedt
2006-07-28 16:41 ` Alan Cox
2006-07-28 16:44 ` Steven Rostedt
2006-07-28 20:01 ` Alan Cox
2006-07-28 20:12 ` Steven Rostedt
2006-07-28 20:36 ` Alan Cox
2006-07-28 20:31 ` Steven Rostedt
2006-07-28 17:11 ` H. Peter Anvin
2006-07-25 20:58 ` [PATCH] RTC: Add mmap method to rtc character driver Jim Gettys
2006-07-25 21:04 ` H. Peter Anvin
2006-07-25 21:14 ` Jim Gettys
2006-07-25 21:18 ` H. Peter Anvin
2006-07-25 21:39 ` Jim Gettys
2006-07-29 4:28 ` Bill Huey
2006-07-29 12:54 ` Neil Horman
2006-07-29 20:41 ` Bill Huey
2006-07-29 21:43 ` Neil Horman
2006-07-29 22:45 ` Keith Packard
2006-07-29 23:18 ` Edgar Toernig
2006-07-29 21:49 ` Edgar Toernig
2006-07-29 22:51 ` itimer again (Re: [PATCH] RTC: Add mmap method to rtc character driver) Bill Huey
2006-07-29 23:35 ` Nicholas Miell
2006-07-30 1:00 ` Bill Huey
2006-07-30 1:22 ` Nicholas Miell
2006-07-30 1:39 ` Bill Huey
2006-07-30 2:02 ` Nicholas Miell
2006-07-30 14:33 ` Theodore Tso
2006-07-30 22:20 ` Bill Huey
2006-07-31 15:40 ` Theodore Tso
2006-07-30 0:16 ` Edgar Toernig
2006-07-30 0:24 ` Bill Huey
2006-07-29 14:02 ` [PATCH] RTC: Add mmap method to rtc character driver Thomas Gleixner
2006-07-26 13:17 ` Martin J. Bligh
2006-08-02 3:54 ` john stultz
2006-08-02 4:26 ` H. Peter Anvin
2006-08-02 4:34 ` john stultz
2006-07-25 23:26 ` Segher Boessenkool
2006-07-26 0:10 ` Neil Horman
2006-07-25 20:03 ` Paul Mackerras
2006-07-25 23:27 ` Segher Boessenkool
2006-07-26 0:06 ` Neil Horman
2006-07-25 18:00 ` Jim Gettys
2006-07-25 18:17 ` Neil Horman
2006-07-26 15:16 ` Andi Kleen
2006-07-26 17:25 ` Jim Gettys
2006-07-27 23:53 ` Paul Mackerras
2006-07-28 3:29 ` Jim Gettys
2006-07-28 11:59 ` Neil Horman
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=20060726000314.GB5147@localhost.localdomain \
--to=nhorman@tuxdriver.com \
--cc=a.zummo@towertech.it \
--cc=airlied@gmail.com \
--cc=hpa@zytor.com \
--cc=jg@freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=segher@kernel.crashing.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