From: Muchun Song <songmuchun@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
linux-doc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH 3/7] mm: remove redundant smp_wmb()
Date: Tue, 27 Jul 2021 21:39:17 +0800 [thread overview]
Message-ID: <CAMZfGtWjunhRYQNW4u4Rea8N+csKPvzUmKfgUBnWBdJdagjs-g@mail.gmail.com> (raw)
In-Reply-To: <20210718043034.76431-4-zhengqi.arch@bytedance.com>
On Sun, Jul 18, 2021 at 12:31 PM Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>
> The smp_wmb() which is in the __pte_alloc() is used to
> ensure all ptes setup is visible before the pte is made
> visible to other CPUs by being put into page tables. We
> only need this when the pte is actually populated, so
> move it to pte_install(). __pte_alloc_kernel(),
> __p4d_alloc(), __pud_alloc() and __pmd_alloc() are similar
> to this case.
>
> We can also defer smp_wmb() to the place where the pmd entry
> is really populated by preallocated pte. There are two kinds
> of user of preallocated pte, one is filemap & finish_fault(),
> another is THP. The former does not need another smp_wmb()
> because the smp_wmb() has been done by pte_install().
> Fortunately, the latter also does not need another smp_wmb()
> because there is already a smp_wmb() before populating the
> new pte when the THP use preallocated pte to split huge pmd.
s/use/uses a/g
s/split huge/split a huge/g
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
next prev parent reply other threads:[~2021-07-27 13:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-18 4:30 [PATCH 0/7] Free user PTE page table pages Qi Zheng
2021-07-18 4:30 ` [PATCH 1/7] mm: fix the deadlock in finish_fault() Qi Zheng
2021-07-18 21:28 ` Kirill A. Shutemov
2021-07-19 9:53 ` Qi Zheng
2021-07-20 23:14 ` Andrew Morton
2021-07-21 2:21 ` Qi Zheng
2021-07-18 4:30 ` [PATCH 2/7] mm: introduce pte_install() helper Qi Zheng
2021-07-18 21:31 ` Kirill A. Shutemov
2021-07-19 10:20 ` Qi Zheng
2021-07-18 4:30 ` [PATCH 3/7] mm: remove redundant smp_wmb() Qi Zheng
2021-07-27 13:39 ` Muchun Song [this message]
2021-07-18 4:30 ` [PATCH 4/7] mm: rework the parameter of lock_page_or_retry() Qi Zheng
2021-07-18 4:30 ` [PATCH 5/7] mm: free user PTE page table pages Qi Zheng
2021-07-18 6:19 ` Mika Penttilä
2021-07-19 12:56 ` Qi Zheng
2021-07-19 13:55 ` Mika Penttilä
2021-07-19 14:12 ` Qi Zheng
2021-07-19 14:17 ` Mika Penttilä
2021-07-18 22:01 ` Kirill A. Shutemov
2021-07-19 13:55 ` Qi Zheng
2021-07-18 4:30 ` [PATCH 6/7] mm: defer freeing PTE page table for a grace period Qi Zheng
2021-07-18 4:30 ` [PATCH 7/7] mm: use mmu_gather to free PTE page table Qi Zheng
2021-07-19 7:34 ` [PATCH 0/7] Free user PTE page table pages David Hildenbrand
2021-07-19 11:28 ` David Hildenbrand
2021-07-19 12:42 ` Muchun Song
2021-07-19 13:30 ` Muchun Song
2021-07-20 4:00 ` Qi Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMZfGtWjunhRYQNW4u4Rea8N+csKPvzUmKfgUBnWBdJdagjs-g@mail.gmail.com \
--to=songmuchun@bytedance.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=tglx@linutronix.de \
--cc=vdavydov.dev@gmail.com \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).