linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Peter Xu <peterx@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	"Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Jerome Marchand <jmarchan@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Hugh Dickins <hughd@google.com>, Jason Gunthorpe <jgg@nvidia.com>,
	John Hubbard <jhubbard@nvidia.com>
Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast
Date: Thu, 1 Sep 2022 11:35:40 -0700	[thread overview]
Message-ID: <CAHbLzkrA-jKzTBq_Mn3NZYc91exovv1gH2LNzetCNiVu8+W6Kg@mail.gmail.com> (raw)
In-Reply-To: <YxD00K1lv151X/eq@xz-m1.local>

On Thu, Sep 1, 2022 at 11:07 AM Peter Xu <peterx@redhat.com> wrote:
>
> On Thu, Sep 01, 2022 at 10:50:48AM -0700, Yang Shi wrote:
> > Yeah, because THP collapse does copy the data before clearing pte. If
> > we want to remove pmdp_collapse_flush() by just clearing pmd, we
> > should clear *AND* flush pte before copying the data IIRC.
>
> Yes tlb flush is still needed.  IIUC the generic pmdp_collapse_flush() will
> still be working (with the pte level flushing there) but it should just
> start to work for all archs, so potentially we could drop the arch-specific
> pmdp_collapse_flush()s, mostly the ppc impl.

I'm don't know why powperpc needs to have its specific
pmdp_collapse_flush() in the first place, not only the mandatory IPI
broadcast, but also the specific implementation of pmd tlb flush. But
anyway the IPI broadcast could be removed at least IMO.

>
> This also reminded me that the s390 version of pmdp_collapse_flush() is a
> bit weird, since it doesn't even have the tlb flush there.  I feel like
> it's broken but I can't really tell whether something I've overlooked.
> Worth an eye on.

I don't know why. But if s390 doesn't flush tlb in
pmdp_collapse_flush(), then there may be data integrity problem since
the page is still writable when copying the data because pte is
cleared after data copying. Or s390 hardware does flush tlb
automatically?

>
> --
> Peter Xu
>

  reply	other threads:[~2022-09-01 18:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01  7:21 [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast David Hildenbrand
2022-09-01 14:37 ` Kirill A . Shutemov
2022-09-01 16:12 ` Jason Gunthorpe
2022-09-01 16:30   ` David Hildenbrand
2022-09-01 16:28 ` Peter Xu
2022-09-01 16:34   ` David Hildenbrand
2022-09-01 16:40     ` Peter Xu
2022-09-01 16:46       ` David Hildenbrand
2022-09-01 17:41         ` Peter Xu
2022-09-01 17:44           ` David Hildenbrand
2022-09-01 17:50         ` Yang Shi
2022-09-01 18:07           ` Peter Xu
2022-09-01 18:35             ` Yang Shi [this message]
2022-09-02  6:32               ` David Hildenbrand
2022-09-02 13:53                 ` Peter Xu
2022-09-02 15:37                 ` Yang Shi
2022-09-04 16:52                 ` Aneesh Kumar K V
2022-09-05  8:38                   ` David Hildenbrand
2022-09-05  8:41                     ` Aneesh Kumar K V
2022-09-04 16:49     ` Aneesh Kumar K V
2022-09-05  8:02       ` David Hildenbrand

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=CAHbLzkrA-jKzTBq_Mn3NZYc91exovv1gH2LNzetCNiVu8+W6Kg@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=david@redhat.com \
    --cc=hughd@google.com \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=jmarchan@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=vbabka@suse.cz \
    /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).