lkml.org 
[lkml]   [2010]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 6/8] mm: handle_speculative_fault()


On Thu, 7 Jan 2010, Paul E. McKenney wrote:
> > +
> > + spin_lock(&mm->page_table_lock);
> > + if (vma->vm_end == cur_brk) {
> > + vma->vm_end = brk;
> > + mm->brk = brk;
> > + cur_brk = brk;
> > + }
> > + spin_unlock(&mm->page_table_lock);
> > +
> > + if (cur_brk != brk)
>
> Can this be "if (cur_brk < brk)"? Seems like it should, given the
> earlier tests, but I don't claim to understand the VM code.

It's really just a flag, to test whether the final check (inside the
spinlock) succeeded, or whether we perhaps raced with _another_ brk() call
that also had the mm_sem for reading.

We know that cur_brk was different from brk before - because otherwise
we'd have just returned early (or done the slow case). So testing whether
it's different afterwards really only tests whether that

cur_brk = brk;

statment was executed or not.

I could have used a separate flag called "success" or something.

Linus


\
 
 \ /
  Last update: 2010-01-07 21:11    [W:0.863 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site