lkml.org 
[lkml]   [2018]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: Add new vma flag VM_LOCAL_CPU
From
Date
On 05/22/2018 10:51 AM, Matthew Wilcox wrote:
> But CR3 is a per-CPU register. So it'd be *possible* to allocate one
> PGD per CPU (per process). Have them be identical in all but one of
> the PUD entries. Then you've reserved 1/512 of your address space for
> per-CPU pages.
>
> Complicated, ugly, memory-consuming. But possible.

Yep, and you'd probably want a cache of them so you don't end up having
to go rewrite half of the PGD every time you context-switch. But, on
the plus side, the logic would be pretty similar if not identical to the
way that we manage PCIDs. If your mm was recently active on the CPU,
you can use a PGD that's already been constructed. If not, you're stuck
making a new one.

Andy L. was alto talking about using this kind of mechanism to simplify
the entry code. Instead of needing per-cpu areas where we index by the
CPU number, or by using %GS, we could have per-cpu data or code that has
a fixed virtual address.

It'd be a fun project, but it might not ever pan out.

\
 
 \ /
  Last update: 2018-05-23 19:30    [W:0.082 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site