lkml.org 
[lkml]   [2011]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mremap: skip page table lookup for non-faulted anonymous VMAs
From
On Mon, Nov 7, 2011 at 11:32 PM, Andrea Arcangeli <aarcange@redhat.com> wrote:
> On Mon, Nov 07, 2011 at 12:21:35PM +0800, Nai Xia wrote:
>> If an anonymous vma has not yet been faulted, move_page_tables() in move_vma()
>> is not necessary for it.
>
> I actually thought of adding that (in fact fork has it and it's more
> likely to be beneficial for fork than for mremap I suspect), but this
> adds a branch to the fast path for a case that shouldn't normally
> materialize. So I don't think it's worth adding it as I expect it to
> add overhead in average.
>

Well, it seems like I forgot to embrace it with unlikely(), with instr
prefetching this line seems a trivial even for the average cases.

But in case it really materializes, it may avoid tedious page table
locking and pmd allocation and furthermore, a semantically
confusing operation of move_page_tables() on a same VMA.

Anyway, it's not a big deal, indeed. You are the maintainers,
it's left for you to decide.


\
 
 \ /
  Last update: 2011-11-07 17:15    [W:0.046 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site