From: Jeff Dike <jdike@addtoit.com>
To: linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net
Subject: [RFC] PATCH 0/4 - Time virtualization
Date: Thu, 13 Apr 2006 13:19:36 -0400 [thread overview]
Message-ID: <200604131719.k3DHJcZG004674@ccure.user-mode-linux.org> (raw)
This set of patches implements
time virtualization by creating a time namespace
an interface to it through unshare
a ptrace extension to allow UML to take advantage of this
UML support
The guts of the namespace is just an offset from the system time. Within
the container, gettimeofday adds this offset to the system time. settimeofday
changes the offset without touching the system time. As such, within a
namespace, settimeofday is unprivileged.
The interface to it is through unshare(CLONE_TIME). This creates the new
namespace, initialized with a zero offset from the system time.
The advantage of this for UML is that it can create a time namespace for itself
and subsequently let its process' gettimeofday run on the host, without
being intercepted and run inside UML. As such, it should basically run at
native speed.
In order to allow this, we need selective system call interception. The
third patch implements PTRACE_SYSCALL_MASK, which specifies, through a
bitmask, which system calls are intercepted and which aren't.
Finally, the UML support is straightforward. It calls unshare(CLONE_TIME)
to create the new namespace, sets gettimeofday to run without being
intercepted, and makes settimeofday call the host's settimeofday instead
of maintaining the time offset itself.
As expected, a gettimeofday loop runs basically at native speed. The two
quick tests I did had it running inside UML at 98.8 and 99.2 % of native.
BUG - as I was writing this, I realized that refcounting of the time_ns
structures is wrong - they need to be incremented at process creation and
decremented at process exit.
Jeff
next reply other threads:[~2006-04-13 18:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 17:19 Jeff Dike [this message]
2006-04-14 0:31 ` [RFC] PATCH 0/4 - Time virtualization john stultz
2006-04-14 1:53 ` [uml-devel] " Jeff Dike
2006-04-14 16:24 ` john stultz
2006-04-19 8:25 ` Eric W. Biederman
2006-04-26 18:01 ` Jeff Dike
2006-04-28 11:33 ` [uml-devel] " Blaisorblade
2006-04-28 11:48 ` Jeff Dike
2006-04-28 12:14 ` Jeff Dike
2006-04-28 13:54 ` Blaisorblade
2006-04-28 15:15 ` Jeff Dike
2006-04-28 20:10 ` Blaisorblade
2006-04-28 16:18 ` Eric W. Biederman
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=200604131719.k3DHJcZG004674@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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