Re: mm: Question: pte SMP data race in do_anomyous_page()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 25, 2023 at 11:06:40AM +0100, Karim Manaouil wrote:
> Hi,
> 
> In do_anonymous_page(), a new page is allocated and zeroed, and the 
> corresponding page struct is initialised (setting flags PageUptodate,
> PageSwapBacked, etc. and initialising the various counters).
> 
> Then, set_pte_at() is called directly without calling smp_wmb() to make
> the updates above visible on other CPUs.

How are you able to read the code without reading the comment
that explains this?

        /*
         * The memory barrier inside __SetPageUptodate makes sure that
         * preceding stores to the page contents become visible before
         * the set_pte_at() write.
         */
        __SetPageUptodate(page);

        entry = mk_pte(page, vma->vm_page_prot);

That comment has been there since 2013.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux