Re: [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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

On Sun, 9 May 2010, Linus Torvalds wrote:

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] Fix migration races in rmap_walk() V7, Mel Gorman, (Thu May 6, 4:20 pm)
Re: [PATCH 0/2] Fix migration races in rmap_walk() V7, KAMEZAWA Hiroyuki, (Fri May 7, 1:13 am)
Re: [PATCH 2/2] mm,migration: Fix race between shift_arg_p ..., Linus Torvalds, (Sun May 9, 1:20 pm)
Re: [PATCH 2/2] mm,migration: Fix race between shift_arg_p ..., KAMEZAWA Hiroyuki, (Mon May 10, 4:55 pm)