All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Jeff Dike <jdike@karaya.com>
Cc: Andi Kleen <ak@muc.de>, john stultz <johnstul@us.ibm.com>,
	Linus Torvalds <torvalds@transmeta.com>,
	lkml <linux-kernel@vger.kernel.org>,
	george anzinger <george@mvista.com>,
	Stephen Hemminger <shemminger@osdl.org>
Subject: Re: [PATCH] linux-2.5.43_vsyscall_A0
Date: Sat, 19 Oct 2002 06:10:19 +0200	[thread overview]
Message-ID: <20021019041019.GI23930@dualathlon.random> (raw)
In-Reply-To: <200210190450.XAA06161@ccure.karaya.com>

On Fri, Oct 18, 2002 at 11:49:59PM -0500, Jeff Dike wrote:
> ak@muc.de said:
> > Guess you'll have some problems then with UML on x86-64, which always
> > uses vgettimeofday. But it's only used for gettimeofday() currently,
> > perhaps it's  not that bad when the UML child runs with the host's
> > time.
> 
> It's not horrible, but it's still broken.  There are people who depend
> on UML being able to keep its own time separately from the host.
> 
> > I guess it would be possible to add some support for UML to map own
> > code over the vsyscall reserved locations. UML would need to use the
> > syscalls then. But it'll be likely ugly. 
> 
> Yeah, it would be.
> 
> My preferred solution would be for libc to ask the kernel where the vsyscall
> area is.  That's reasonably clean and virtualizable.  Andrea doesn't like it
> because it adds a few instructions to the vsyscall address calculation.

yes, my preferred solution is still a runtime /proc entry that turns off
vsyscalls completely by root so you could trap gettimeofday/time via the
usual ptrace. That would be zero cost. Of course this would be needed
only for the special users needing a revirtualized time. I tend to think
most people don't need a revirtualized time in uml, the exceptions can
run slower [not slower than x86 of course except for an additional
call/ret pair that won't matter compared to the ptrace overhread of
every syscall]. I mean, I would prefer to optimize for the people who
needs fast performance, if you can deal with the ptrace overhead at
every sysenter/sysret most probably you don't need the vsyscalls in the
first place.

My argument is that whatever solution to this problem has a penalty of
some kind, and I prefer to keep the penalty on the side of the most
unlikely case, and as far as I can tell it's the case of people needing
uml running with revirtualized real time. certainly I want to make it
possible, but I don't care to optimize for it, I want it (not the
others) to pay for the additional feature it needs.

If the global sysctl is unacceptable, the next fallback would be to have
a per-task information that defaults to vsyscall to execute the syscall,
a check in switch_to could replace the fixmap entry with the one of the
other vsyscall. That would be an additional single unlikely branch in
switch_to unless I'm overlooking something and I could live with it
despite it's not an absolute zero cost. That should be still *much*
better than glibc asking to kernel the address of the vsyscalls using a
syscall after execve and using pointer to functions later at runtime to
invoke the vsyscalls, I don't really like that solution.

So I would go with:

1) global sysctl to turn off vgettimeofday/vtime
2) if 1) is unacceptable then per-task turnoff of vsyscalls would be the
   next viable solution

Comments?

Andrea

  parent reply	other threads:[~2002-10-19  4:04 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-18 22:57 [PATCH] linux-2.5.43_vsyscall_A0 john stultz
2002-10-18 22:58 ` [EXAMPLE CODE] linux-2.5.43_vsyscall_A0 john stultz
2002-10-19  3:52 ` [PATCH] linux-2.5.43_vsyscall_A0 Jeff Dike
2002-10-19  3:10   ` Andi Kleen
2002-10-19  4:49     ` Jeff Dike
2002-10-19  4:02       ` Andi Kleen
2002-10-19  4:16         ` Andrea Arcangeli
2002-10-20  2:59           ` Andi Kleen
2002-10-20  6:44             ` Elladan
2002-10-20  9:27               ` [discuss] " Andi Kleen
2002-10-20 10:58                 ` Elladan
2002-10-20 11:20                   ` Andi Kleen
2002-10-20 14:51             ` Andrea Arcangeli
2002-10-21 16:49               ` george anzinger
2002-10-20 13:19         ` Andreas Jaeger
2002-10-20 14:59           ` Andrea Arcangeli
2002-10-19  4:10       ` Andrea Arcangeli [this message]
2002-10-19  4:45         ` Andi Kleen
2002-10-19  5:01           ` Andrea Arcangeli
2002-10-19 23:43             ` Jeff Dike
2002-10-20  0:15               ` Andrea Arcangeli
2002-10-20  2:03                 ` Jeff Dike
2002-10-20  2:33                   ` Andrea Arcangeli
2002-10-22  5:07                     ` Jeff Dike
2002-10-22  4:15                       ` Andi Kleen
2002-10-22  4:29                         ` Andrew Morton
2002-10-22  9:39                           ` Alan Cox
2002-10-22 16:12                             ` Andrew Morton
2002-10-22  5:08                         ` Andrea Arcangeli
2002-10-22  5:27                       ` Andrea Arcangeli
2002-10-22  7:24                         ` Elladan
2002-10-22  7:40                           ` Andrea Arcangeli
2002-10-23  5:12                             ` Elladan
2002-10-23  5:43                               ` Elladan
2002-10-23 17:51                               ` Gerrit Huizenga
2002-10-21 15:43             ` Stephen Hemminger
2002-10-21 16:26               ` Andi Kleen
2002-10-21 17:10           ` john stultz
2002-10-19 19:14         ` Bill Davidsen
2002-10-20  1:50       ` Rik van Riel
2002-10-20  2:56         ` Andi Kleen
2002-10-24 11:24       ` Pavel Machek
2002-10-24 11:24     ` Pavel Machek
2002-10-19 22:36   ` Ton Hospel

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=20021019041019.GI23930@dualathlon.random \
    --to=andrea@suse.de \
    --cc=ak@muc.de \
    --cc=george@mvista.com \
    --cc=jdike@karaya.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.