lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 3/9] mm, pgtable: Add ownership to PTE table
On Tue, Sep 27, 2022 at 05:30:39PM +0000, Nadav Amit wrote:
> > +static inline void set_cow_pte_owner(pmd_t *pmd, pmd_t *owner)
> > +{
> > + smp_store_release(&pmd_page(*pmd)->cow_pte_owner, owner);
> > +}
> > +
> > +static inline bool cow_pte_owner_is_same(pmd_t *pmd, pmd_t *owner)
> > +{
> > + return smp_load_acquire(&pmd_page(*pmd)->cow_pte_owner) == owner;
> > +}
>
> Hiding synchronization primitives in such manner, and especially without
> proper comments, makes it hard to understand what the ordering is supposed
> to achieve.
>

It ensures that every time we write into the pointer, the reader
will ebserve the newest one.
I will add the comments.

Thanks,
Chih-En Lin

\
 
 \ /
  Last update: 2022-09-27 20:23    [W:0.369 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site