linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jann Horn <jannh@google.com>, Jan Kara <jack@suse.cz>,
	 Kirill Shutemov <kirill@shutemov.name>,
	Oleg Nesterov <oleg@redhat.com>, Christoph Hellwig <hch@lst.de>,
	 Linux-MM <linux-mm@kvack.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mike Kravetz <mike.kravetz@oracle.com>
Subject: Re: [5.4 PATCH] mm/gup: Do not force a COW break on file-backed memory
Date: Thu, 2 Dec 2021 14:33:37 -0800	[thread overview]
Message-ID: <CAHk-=wgzk5dTKaciK2pkto=+fz0kAkXxz9g8ekkWfeOKzMR1EQ@mail.gmail.com> (raw)
In-Reply-To: <YaklihoYztAoKfxX@casper.infradead.org>

On Thu, Dec 2, 2021 at 11:59 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> Oh absolutely, it's semantically nonsense.  The only reason it fixes the
> problem is that VM_DENYWRITE VMAs are the only ones considered for the
> RO_THP merging, so they're the only ones which we've seen causing a
> problem.

That would be a semantically meaningful argument, but I think the
reverse isn't true: regular pages in VM_DENYWRITE vmas - that aren't
using the RO_THP thing - are open to the same old "COW wrong way"
issue.

So it's not like VM_DENYWRITE is really meaningful for the
conditional, even if it's perhaps a prerequisite for it being a
problem.

> > I suspect a real fix would be bigger and more invasive.
>
> Darn.  I was hoping you were going to say something like "The real
> problem is follow_trans_huge_pmd() is complete garbage and it should
> just do X, Y and Z".  Or "When we force on FOLL_WRITE, we should also
> force on FOLL_SPLIT_PMD".

Well, maybe that "FOLL_SPLIT_PMD" thing would indeed be a valid thing?

But I _think_ that it shouldn't be too painful to do the
should_force_cow_break() call later, when you actually have the exact
page details, so while not exactly a one-liner, I hope that approach
would end up working out.

I only gave it a quick look, though, I might be missing something.

              Linus


      reply	other threads:[~2021-12-02 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 23:17 Matthew Wilcox (Oracle)
2021-12-02  3:51 ` Jann Horn
2021-12-02  4:11   ` Matthew Wilcox
2021-12-02  4:33     ` Jann Horn
2021-12-02 18:54     ` Linus Torvalds
2021-12-02 19:59       ` Matthew Wilcox
2021-12-02 22:33         ` Linus Torvalds [this message]

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='CAHk-=wgzk5dTKaciK2pkto=+fz0kAkXxz9g8ekkWfeOKzMR1EQ@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=oleg@redhat.com \
    --cc=willy@infradead.org \
    /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