From: Neil Horman <nhorman@tuxdriver.com>
To: Jim Gettys <jg@laptop.org>
Cc: Paul Mackerras <paulus@samba.org>, Andi Kleen <ak@suse.de>,
a.zummo@towertech.it, jg@freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RTC: Add mmap method to rtc character driver
Date: Fri, 28 Jul 2006 07:59:56 -0400 [thread overview]
Message-ID: <20060728115956.GA5577@hmsreliant.homelinux.net> (raw)
In-Reply-To: <1154057388.10570.132.camel@localhost.localdomain>
On Thu, Jul 27, 2006 at 11:29:48PM -0400, Jim Gettys wrote:
> The only awkward thing about the current interfaces is that you have to
> go from seconds and microseconds, to milliseconds, but only really when
> you represent time to X clients, which requires a bit of 64 bit of
> math... It is true that since you have two values in the timeval
> structure, the update might require some sort of locking, which could be
> a performance lose; but there are other simple solutions to that (e.g.
> simple ring representations where you rely on the store of an index
> value to be atomic without requiring full locks and increment the index
> after updating both values, but a simple memory barrier), but those
> implementation tricks should be hidden behind an interface, and not
> exposed to application programmers..
>
> In theory, that conversion to milliseconds only actually has to be done
> if the time is (significantly) different.
>
> I can't forsee that this is a big deal on (most of) today's machines.
> Last I looked, the CPU runs the same speed in kernel mode as user
> mode ;-).
>
> On the other hand, the idea of a one off Linux specific "oh, there is
> this magic file you mmap, and then you can poke at a magic location",
> strikes me as a one-off hack, and that Linux would be better off
> spending the same effort to speed up the general interface (which might
> very well do this mmap trick trick behind the scenes, as far as I'm
> concerned).
>
> The difference is one is a standard, well known interface, which to an
> application programmer has very well defined semantics; the other, to be
> honest, is a kludge, which may expose applications to too many details
> of the hardware. For example, exact issues of cache coherency and
> memory barriers differ between machines.
> Regards,
> - Jim
>
>
> If it's to be a kludge, it might as well be a X driver kludge (which is
> where we put it in the '80's).
>
>
So, setting aside for the moment any potential usefullness to X, what about the
same question in the general sense? Is this a usefull interface to add to the
rtc driver in general, without consideration for what applications might use it?
Neil
>
>
> On Fri, 2006-07-28 at 09:53 +1000, Paul Mackerras wrote:
> > Andi Kleen writes:
> >
> > > No, no, it's wrong. They should use gettimeofday and the kernel's job
> > > is to make it fast enough that they can.
> >
> > Not necessarily - maybe gettimeofday's seconds + microseconds
> > representation is awkward for them to use, and some other kernel
> > interface would be more efficient for them to use, while being as easy
> > or easier for the kernel to compute. Jim, was that your point?
> >
> > Paul.
> --
> Jim Gettys
> One Laptop Per Child
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
/***************************************************
*Neil Horman
*Software Engineer
*gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
***************************************************/
prev parent reply other threads:[~2006-07-28 12:00 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-25 17:41 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
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 [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=20060728115956.GA5577@hmsreliant.homelinux.net \
--to=nhorman@tuxdriver.com \
--cc=a.zummo@towertech.it \
--cc=ak@suse.de \
--cc=jg@freedesktop.org \
--cc=jg@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®