All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <songmuchun@bytedance.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com,
	peterx@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: hugetlb: Add missing cache flushing in hugetlb_unshare_all_pmds()
Date: Sun, 24 Apr 2022 15:45:02 +0800	[thread overview]
Message-ID: <YmT//huUbFX+KHcy@FVFYT0MHHV2J.usts.net> (raw)
In-Reply-To: <419b0e777c9e6d1454dcd906e0f5b752a736d335.1650781755.git.baolin.wang@linux.alibaba.com>

On Sun, Apr 24, 2022 at 02:33:19PM +0800, Baolin Wang wrote:
> Missed calling flush_cache_range() before removing the sharing PMD entrires,
> otherwise data consistence issue may be occurred on some architectures whose
> caches are strict and require a virtual–>physical translation to exist for
> a virtual address. Thus add it.
> 
> Fixes: 6dfeaff93be1 ("hugetlb/userfaultfd: unshare all pmds for hugetlbfs when register wp")
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

CONFIG_ARCH_WANT_HUGE_PMD_SHARE is only definded on riscv, arm64 and
x86.  All of them do not have a VIVT cache.  In others words,
flush_cache_range() is null on those architectures. So I suspect
in practice this does not cause any issue.  It is better to
clarify this in commit log.

Anyway:

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

  reply	other threads:[~2022-04-24  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  6:33 [PATCH] mm: hugetlb: Add missing cache flushing in hugetlb_unshare_all_pmds() Baolin Wang
2022-04-24  7:45 ` Muchun Song [this message]
2022-04-24 10:03   ` Baolin Wang
2022-04-26 17:34   ` Peter Xu

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=YmT//huUbFX+KHcy@FVFYT0MHHV2J.usts.net \
    --to=songmuchun@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=peterx@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.