linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mauricio Faria de Oliveira <mfo@canonical.com>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Yu Zhao <yuzhao@google.com>, Minchan Kim <minchan@kernel.org>,
	 "Huang, Ying" <ying.huang@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Yang Shi <shy828301@gmail.com>,
	Miaohe Lin <linmiaohe@huawei.com>,  Linux-MM <linux-mm@kvack.org>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH v3] mm: fix race between MADV_FREE reclaim and blkdev direct IO read
Date: Fri, 4 Feb 2022 15:59:53 -0300	[thread overview]
Message-ID: <CAO9xwp2mTH7vBy9m-_63hAEwe3UgDShL1e2hCovf0RkrR+y90g@mail.gmail.com> (raw)
In-Reply-To: <aed15ae0-24f9-d733-a3a2-3f803a82b6c7@nvidia.com>

On Fri, Feb 4, 2022 at 4:03 AM John Hubbard <jhubbard@nvidia.com> wrote:
>
> On 2/3/22 21:56, Yu Zhao wrote:
> ...
> >>> Got it. IIRC, get_user_pages() doesn't imply a write barrier. If so,
> >>> there should be a smp_wmb() on the other side:
> >>
> >> If I understand it correctly, it actually implies a full memory
> >> barrier, doesn't it?
> >>
> >> Because... gup_pte_range() (fast path) calls try_grab_compound_head(),
> >> which eventually calls* atomic_add_unless(), an atomic conditional RMW
> >> operation with return value, thus fully ordered on success (atomic_t.rst);
> >> (on failure gup_pte_range() falls back to the slow path, below.)
> >>
> >> And follow_page_pte() (slow path) calls try_grab_page(), which also calls
> >> into try_grab_compound_head(), as the above.
>
> Well, doing so was a mistake, actually. I've recently reverted it, via:
> commit c36c04c2e132 ("Revert "mm/gup: small refactoring: simplify
> try_grab_page()""). Details are in the commit log.
>
> Apologies for the confusion that this may have created.

No worries; thanks for the pointers / commit log.

>
> thanks,
> --
> John Hubbard
> NVIDIA
> [...]


-- 
Mauricio Faria de Oliveira


  reply	other threads:[~2022-02-04 19:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 23:02 Mauricio Faria de Oliveira
2022-01-31 23:43 ` Andrew Morton
2022-02-01  2:23   ` Mauricio Faria de Oliveira
2022-02-02 14:03 ` Christoph Hellwig
2022-02-02 16:29   ` Mauricio Faria de Oliveira
2022-02-02 19:56 ` Yu Zhao
2022-02-02 21:27   ` Mauricio Faria de Oliveira
2022-02-02 21:53     ` Yu Zhao
2022-02-03 22:17       ` Mauricio Faria de Oliveira
2022-02-04  5:56         ` Yu Zhao
2022-02-04  7:03           ` John Hubbard
2022-02-04 18:59             ` Mauricio Faria de Oliveira [this message]
2022-02-04 18:58           ` Mauricio Faria de Oliveira
2022-02-16  6:48       ` Huang, Ying
2022-02-16 21:58         ` Yu Zhao
2022-02-16 22:00           ` Yu Zhao
2022-02-17  6:08           ` Huang, Ying

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=CAO9xwp2mTH7vBy9m-_63hAEwe3UgDShL1e2hCovf0RkrR+y90g@mail.gmail.com \
    --to=mfo@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=jhubbard@nvidia.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=shy828301@gmail.com \
    --cc=ying.huang@intel.com \
    --cc=yuzhao@google.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