lkml.org 
[lkml]   [2010]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] mm,migration: Fix race between shift_arg_pages and rmap_walk by guaranteeing rmap_walk finds PTEs created within the temporary stack


On Sun, 9 May 2010, Linus Torvalds wrote:
>
> Also - the thing is, we can easily choose to do this _just_ for the case
> of shifting argument pages, which really is a special case (the generic
> case of "mremap()" is a lot more complicated, and doesn't have the issue
> with rmap because it's doing all the "new vma" setup etc).

Looking at the stack setup code, we have other things we probably might
want to look at.

For example, we do that "mprotect_fixup()" to fix up possible vm_flags
issues (notably whether execute bit is set or not), and that's absolutely
something that we probably should do at the same time as moving the stack,
so that we don't end up walking - and changing - the page tables _twice_.

So the stack setup really is a total special case, and it looks like we do
some rather stupid things there. Havign a specialized routine that does
just:

- if we're moving things, fill in the new page tables (we know they are
dense, so my "stupid" routine actually does the right thing despite
being pretty simplistic) before moving.

- if we're moving _or_ changing protections, do a

for_each_page()
move_andor_fix_protection()

which kind of looks like the current "move_page_tables()", except we
know it doesn't need new allocations.

Hmm?

Linus


\
 
 \ /
  Last update: 2010-05-09 22:27    [W:0.355 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site