public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Percpu data in a vsyscall page
@ 2005-11-02 10:54 Vojtech Pavlik
  2005-11-03  1:51 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Vojtech Pavlik @ 2005-11-02 10:54 UTC (permalink / raw)
  To: rusty; +Cc: linux-kernel

Hi!

I'm working on a RDTSCP support on x86-64, and for that, I'll need
per-cpu time offset table in a vsyscall page. I saw the percpu.h header,
and thought - "Hey, I could use that!", but I think I really can't.

The data need to be in a vsyscall page, which is mapped to userspace via
linker magic, and the percpu stuff uses a different mapping.

I'm using a simple array instead, because the address will be different
in a vsyscall from the one the kernel sees anyway, and RDTSCP will give
me an index to that array atomically.

Is there any problem with that approach? Is there any reason using
percpu.h would be better? 

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Percpu data in a vsyscall page
  2005-11-02 10:54 Percpu data in a vsyscall page Vojtech Pavlik
@ 2005-11-03  1:51 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2005-11-03  1:51 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

On Wed, 2005-11-02 at 11:54 +0100, Vojtech Pavlik wrote:
> Hi!
> 
> I'm working on a RDTSCP support on x86-64, and for that, I'll need
> per-cpu time offset table in a vsyscall page. I saw the percpu.h header,
> and thought - "Hey, I could use that!", but I think I really can't.
> 
> The data need to be in a vsyscall page, which is mapped to userspace via
> linker magic, and the percpu stuff uses a different mapping.

Yes.  The percpu stuff uses a single add to find the local value of a
variable.  This per-cpu offset can be kept in a register (I think
Sparc64 already does this) making it v. fast.

You're going to have to stick with an array I think.

Sorry,
Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-03  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-02 10:54 Percpu data in a vsyscall page Vojtech Pavlik
2005-11-03  1:51 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox