Messages in this thread | | | Date | Mon, 4 Jan 2010 21:10:29 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: [RFC][PATCH 6/8] mm: handle_speculative_fault() |
| |
On Tue, 5 Jan 2010, KAMEZAWA Hiroyuki wrote: > > Then, my patch dropped speculative trial of page fault and did synchronous > job here. I'm still considering how to insert some barrier to delay calling > remove_vma() until all page fault goes. One idea was reference count but > it was said not-enough crazy.
What lock would you use to protect the vma lookup (in order to then increase the refcount)? A sequence lock with RCU lookup of the vma?
Sounds doable. But it also sounds way more expensive than the current VM fault handling, which is pretty close to optimal for single-threaded cases.. That RCU lookup might be cheap, but just the refcount is generally going to be as expensive as a lock.
Are there some particular mappings that people care about more than others? If we limit the speculative lookup purely to anonymous memory, that might simplify the problem space?
[ From past experiences, I suspect DB people would be upset and really want it for the general file mapping case.. But maybe the main usage scenario is something else this time? ]
Linus
| |