From: Helge Deller <deller@gmx.de>
To: Theodore Tso <tytso@mit.edu>
Cc: Matt Mackall <mpm@selenic.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Time-based RFC 4122 UUID generator
Date: Wed, 21 Nov 2007 00:30:05 +0100 [thread overview]
Message-ID: <200711210030.05961.deller@gmx.de> (raw)
In-Reply-To: <20071120230012.GF26022@thunk.org>
On Wednesday 21 November 2007, Theodore Tso wrote:
> On Tue, Nov 20, 2007 at 10:59:58PM +0100, Helge Deller wrote:
> > > Even with a futex? Or userspace atomics?
> >
> > Yes, you'll need a futex or similiar.
> >
> > The problem is then more, where will you put that futex to be able
> > to protect against other processes ?
> >
> > Best solution is probably shared memory, but then the question will
> > be, who is allowed to access this memory/futex ?
> >
> > Will any process (shared library) be allowed to read/write/delete it?
> >
> > At this stage you then suddenly run from a locking-problem into a
> > security problem, which is probably equally hard to solve.
>
> Basically, the only way to solve this problem 100% in userspace would
> be with a userspace daemon running as a privileged user, and some kind
> of Unix domain socket.
Yes, probably.
> Patches to implement this in the e2fsprogs UUID library would be
> greatfully accepted.
>
> > Sounds simple and is probably fast enough.
> >
> > But do you really want to add then another daemon to the Linux
> > system, just in case "some" application needs somewhen a UUID ?
> >
> > And I think such an implementation is more complex, would need more
> > memory, file handles, and so on than this simple kernel patch.
>
> Well, it probably is less code, but keep in mind to really get things
> right, you need to store the UUID counter on disk, so there is some
> complexity which is needed in userspace anyway.
Yes, it's at least needed for the case when the wall clock is wrong.
If it's syncronized with NTP (or similiar), it's not really needed.
Anyway, if this patch is accepted, I'll be happy send patches against the
various bootup scripts to save the last seq_number at shutdown and
restore it at bootup. Maybe something similiar as the /var/lib/random-seed
which is saved by /etc/init.d/halt in Fedora.
> One bigger question which is why do you want to use time-based UUID's?
> With the kernels random number generator, the random UUID's should be
> quite good enough for your purposes.
The big difference between random UUIDs and time-based UUIDs is that
time-based UUIDs can be used more efficiently as indexing keys in databases.
The true randomness of random UUIDs just break performance, while
with some further tricks you can get time-based UUIDs easily sorted.
At least we saw a big speed difference when we used time-based keys, as
they e.g. were used on Windows with MS SQL server. On Linux I personally
would like to see a similiar speedup and for that really unique time-based
UUIDs are needed.
> > I think mkfs was a very bad example from my side. I should not have
> > mentioned this one. Nevertheless, time-based UUIDs are used in
> > quite many other and more critical applications than e2fsprogs
> > tools.
>
> Actually, these days e2fsprogs uses random-based UUID's.
Yes, but still libuuid from e2fsprogs does a good job for what's really
needed and sufficient for the e2fsprogs tools like mkfs.
Sadly the time-based variant of libuuid still hase some way to go.
Initially I really wanted to send patches for libuuid to fix the
time-based variant, but now I really think the kernel-solution is
the better, smaller, cleaner and more reliable approach.
Helge
next prev parent reply other threads:[~2007-11-20 23:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-18 19:38 [PATCH] Time-based RFC 4122 UUID generator Helge Deller
2007-11-18 21:05 ` Andrew Morton
2007-11-18 21:34 ` Sam Ravnborg
2007-11-18 21:43 ` Helge Deller
2007-11-19 21:56 ` David Schwartz
2007-11-19 22:58 ` Alan Cox
2007-11-20 6:44 ` H. Peter Anvin
2007-11-20 22:58 ` Helge Deller
2007-11-21 0:20 ` Alan Cox
2007-11-18 21:40 ` Helge Deller
2007-11-20 6:31 ` Matt Mackall
2007-11-20 21:59 ` Helge Deller
2007-11-20 22:55 ` Matt Mackall
2007-11-20 23:11 ` Helge Deller
2007-11-20 23:34 ` Matt Mackall
2007-11-20 23:00 ` Theodore Tso
2007-11-20 23:30 ` Helge Deller [this message]
2007-12-10 5:36 ` [e2fsprogs PATCH] Userspace solution to time-based UUID without duplicates Theodore Tso
2007-12-16 21:53 ` Helge Deller
2007-12-17 0:07 ` Theodore Tso
2007-11-20 6:15 ` [PATCH] Time-based RFC 4122 UUID generator Andrew Morton
2007-11-20 22:40 ` Helge Deller
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=200711210030.05961.deller@gmx.de \
--to=deller@gmx.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=tytso@mit.edu \
/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