linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Sooyong Suk <s.suk@samsung.com>,
	viro@zeniv.linux.org.uk,  linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	 jaewon31.kim@gmail.com, spssyr@gmail.com
Subject: Re: [RFC PATCH] block, fs: use FOLL_LONGTERM as gup_flags for direct IO
Date: Fri, 7 Mar 2025 13:37:12 -0800	[thread overview]
Message-ID: <CAJuCfpFKuQfQ74f4pLtEO3K1GGeMazb6z52d+oO005ciR8b9+g@mail.gmail.com> (raw)
In-Reply-To: <Z8tVrOezU2q_0ded@casper.infradead.org>

On Fri, Mar 7, 2025 at 12:23 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Mar 06, 2025 at 07:26:52AM -0800, Christoph Hellwig wrote:
> > On Thu, Mar 06, 2025 at 04:40:56PM +0900, Sooyong Suk wrote:
> > > There are GUP references to pages that are serving as direct IO buffers.
> > > Those pages can be allocated from CMA pageblocks despite they can be
> > > pinned until the DIO is completed.
> >
> > direct I/O is eactly the case that is not FOLL_LONGTERM and one of
> > the reasons to even have the flag.  So big fat no to this.
> >
> > You also completely failed to address the relevant mailinglist and
> > maintainers.
>
> You're right; this patch is so bad that it's insulting.
>
> Howver, the problem is real.  And the alternative "solution" being
> proposed is worse -- reintroducing cleancache and frontswap.

Matthew, if you are referring to the GCMA proposal I'm working on,
that's not to address this problem. My goal with GCMA is to reuse
memory carveouts (when they are not used) for extending pagecache.

The way I understand this particular problem is that we know direct
I/O will allocate pages and make them unmovable and we do nothing to
prevent these allocations from using CMA.

>
> What I've been asking for and don't have the answer to yet is:

I'll send my findings related to GCMA usecases separately since I
don't want to mix that with the problem discussed here.

>
>  - What latency is acceptable to reclaim the pages allocated from CMA
>    pageblocks?
>     - Can we afford a TLB shootdown?  An rmap walk?
>  - Is the problem with anonymous or pagecache memory?
>
> I have vaguely been wondering about creating a separate (fake) NUMA node
> for the CMA memory so that userspace can control "none of this memory is
> in the CMA blocks".  But that's not a great solution either.
>


  reply	other threads:[~2025-03-07 21:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250306074101epcas1p4b24ac546f93df2c7fe3176607b20e47f@epcas1p4.samsung.com>
2025-03-06  7:40 ` Sooyong Suk
2025-03-06 15:26   ` Christoph Hellwig
2025-03-06 23:28     ` Jaewon Kim
2025-03-07  2:07       ` Sooyong Suk
2025-03-07  2:28         ` Suren Baghdasaryan
2025-03-07  6:38           ` Sooyong Suk
2025-03-12 15:17           ` Christoph Hellwig
2025-03-12 15:20             ` Suren Baghdasaryan
2025-03-12 15:25               ` Christoph Hellwig
2025-03-12 15:38                 ` Suren Baghdasaryan
2025-03-12 15:52                   ` Christoph Hellwig
2025-03-12 16:03                     ` Bart Van Assche
2025-03-12 16:06                     ` Suren Baghdasaryan
2025-03-12 16:21                       ` Christoph Hellwig
2025-03-07 20:23     ` Matthew Wilcox
2025-03-07 21:37       ` Suren Baghdasaryan [this message]
2025-03-12 15:21       ` Christoph Hellwig
2025-03-13 22:49         ` David Hildenbrand
2025-03-15  1:04           ` John Hubbard
2025-03-15 23:00             ` David Hildenbrand
2025-03-15 23:09               ` Zi Yan

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=CAJuCfpFKuQfQ74f4pLtEO3K1GGeMazb6z52d+oO005ciR8b9+g@mail.gmail.com \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jaewon31.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=s.suk@samsung.com \
    --cc=spssyr@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --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