lkml.org 
[lkml]   [2011]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] Fixup write permission of TLB on powerpc e500 core
From
Date
On Fri, 2011-07-15 at 11:18 -0400, Shan Hai wrote:

> >> + vma = find_vma(mm, address);
> > Uhm, find_vma() needs mmap_sem, and futex_atomic_cmpxchg_inatomic() is
> > most certainly not called with that lock held.
> >
>
> My fault, that will be fixed in the V2 patch.

But you cannot, the function isn't called _atomic_ just for kicks, its
used while holding spinlocks.

> >> + if (likely(vma)) {
> >> + /* only fixup present page */
> >> + if (follow_page(vma, address, FOLL_WRITE)) {
> >> + handle_mm_fault(mm, vma, address, FAULT_FLAG_WRITE);
> > So how can this toggle your sw dirty/young tracking, that's pretty much
> > what gup(.write=1) does too!
> >
>
> because of the kernel read only permission of the page is transparent
> to the follow_page(), the handle_mm_fault() is not to be activated
> in the __get_use_pages(), so the gup(.write=1) could not help to fixup
> the write permission.

So why do you need the vma? Is it like I wrote earlier that you don't
have spare PTE bits and need the vma flags to see if it may become
writable?

gup(.write=1) not triggering this is a serious problem though, not
something you can just paper over. I wouldn't be at all surprised to
find there's more things broken because of that.


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