lkml.org 
[lkml]   [2011]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFT/PATCH v2 1/6] x86-64: Clean up vdso/kernel shared variables

* Andy Lutomirski <luto@MIT.EDU> wrote:

> Variables that are shared between the vdso and the kernel are
> currently a bit of a mess. They are each defined with their own
> magic, they are accessed differently in the kernel, the vsyscall page,
> and the vdso, and one of them (vsyscall_clock) doesn't even really
> exist.
>
> This changes them all to use a common mechanism. All of them are
> delcared in vvar.h with a fixed address (validated by the linker
> script). In the kernel (as before), they look like ordinary
> read-write variables. In the vsyscall page and the vdso, they are
> accessed through a new macro VVAR, which gives read-only access.
>
> The vdso is now loaded verbatim into memory without any fixups. As a
> side bonus, access from the vdso is faster because a level of
> indirection is removed.

Ok, that's a pretty nice consolidation and speedup.

This layout:

> +DECLARE_VVAR(0, volatile unsigned long, jiffies)
> +DECLARE_VVAR(128, struct vsyscall_gtod_data, vsyscall_gtod_data)
> +DECLARE_VVAR(256, int, vgetcpu_mode)

Is spread out too much, using up several separate cachelines with nothing else
on them. Why not pack it tightly, with natural alignment taken into
consideration?

Thanks,

Ingo


\
 
 \ /
  Last update: 2011-04-07 22:35    [W:1.166 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site