lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: thp and memory barrier assumptions
From
Date
On Thu, 2012-07-26 at 22:31 +0200, Peter Zijlstra wrote:
> __do_huge_pmd_anonymous_page() contains:
>
> /*
> * The spinlocking to take the lru_lock inside
> * page_add_new_anon_rmap() acts as a full memory
> * barrier to be sure clear_huge_page writes become
> * visible after the set_pmd_at() write.
> */
> page_add_new_anon_rmap(page, vma, haddr);
>
>
> page_add_new_anon_rmap() doesn't look to actually do a LOCK+UNLOCK
> except for unevictable pages.
>
> But even if it did do an unconditional LOCK+UNLOCK that doesn't make a
> full memory barrier, see Documentation/memory-barriers.txt.
>
> In particular:
>
> *A = a;
> LOCK
> UNLOCK
> *B = b;
>
> may occur as:
>
> LOCK, STORE *B, STORE *A, UNLOCK
>


Also, what is that barrier() in handle_mm_fault() doing? And why doesn't
it have a comment explaining that?


\
 
 \ /
  Last update: 2012-07-26 23:21    [W:0.048 / U:2.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site