This is the mail archive of the
mailing list for the glibc project.
Re: FOR REVIEW: New x86-64 vsyscall vgetcpu()
- From: Chase Venters <chase dot venters at clientec dot com>
- To: Zoltan Menyhart <Zoltan dot Menyhart at bull dot net>
- Cc: Andi Kleen <ak at suse dot de>, Jes Sorensen <jes at sgi dot com>, Tony Luck <tony dot luck at intel dot com>, discuss at x86-64 dot org, linux-kernel at vger dot kernel dot org, libc-alpha at sourceware dot org, vojtech at suse dot cz, linux-ia64 at vger dot kernel dot org
- Date: Fri, 16 Jun 2006 16:12:05 -0500 (CDT)
- Subject: Re: FOR REVIEW: New x86-64 vsyscall vgetcpu()
- References: <email@example.com> <44929CE6.firstname.lastname@example.org> <4492A5E4.email@example.com> <firstname.lastname@example.org> <4492CEC0.email@example.com>
On Fri, 16 Jun 2006, Zoltan Menyhart wrote:
Andi Kleen wrote:
That is not how user space TLS works. It usually has a base a register.
Can you please give me a real life (simplified) example?
This means it cannot be cache colored (because you would need a static
offset) and you couldn't share task_structs on a page.
I do not see the problem. Can you explain please?
E.g. the scheduler pulls a task instead of the current one. The CPU
will see "current->thread_info.cpu"-s of all the tasks at the same
Memory maps have to fall on page boundaries for lots of various reasons.
Assuming a 16-word cache line, you've got plenty of spots you could align
task_struct to within a page. (That number of spots is actually
constrained by either sizeof(task_struct) or the number of colors).
The bottom line is that task_struct won't always be on a page boundary. If
it's not on a page boundary in the physical page frames, it's not going to
be on a page boundary in virtual memory either.
(Note also that if two task_structs shared a page, you'd have an
information leak. I'm not sure with sizeof(task_struct) and cache
alignment if task_structs are small enough for sharing, though. Definitely