[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpEpWQV8y1RKb3hH+-kxczTUvpvCBNNzGJufsAxpkhB4_A@mail.gmail.com>
Date: Wed, 12 Mar 2025 08:38:07 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Sooyong Suk <s.suk@...sung.com>, Jaewon Kim <jaewon31.kim@...il.com>, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org, linux-mm@...ck.org,
spssyr@...il.com, axboe@...nel.dk, linux-block@...r.kernel.org,
dhavale@...gle.com
Subject: Re: [RFC PATCH] block, fs: use FOLL_LONGTERM as gup_flags for direct IO
On Wed, Mar 12, 2025 at 8:25 AM Christoph Hellwig <hch@...radead.org> wrote:
>
> On Wed, Mar 12, 2025 at 08:20:36AM -0700, Suren Baghdasaryan wrote:
> > > Direct I/O pages are not unmovable. They are temporarily pinned for
> > > the duration of the direct I/O.
> >
> > Yes but even temporarily pinned pages can cause CMA allocation
> > failure. My point is that if we know beforehand that the pages will be
> > pinned we could avoid using CMA and these failures would go away.
>
> Direct I/O (and other users of pin_user_pages) are designed to work
> on all anonymous and file backed pages, which is kinda the point.
> If you CMA user can't wait for the time of an I/O something is wrong
> with that caller and it really should not use CMA.
I might be wrong but my understanding is that we should try to
allocate from CMA when the allocation is movable (not pinned), so that
CMA can move those pages if necessary. I understand that in some cases
a movable allocation can be pinned and we don't know beforehand
whether it will be pinned or not. But in this case we know it will
happen and could avoid this situation.
Yeah, low latency usecases for CMA are problematic and I think the
only current alternative (apart from solutions involving HW change) is
to use a memory carveouts. Device vendors hate that since carved-out
memory ends up poorly utilized. I'm working on a GCMA proposal which
hopefully can address that.
>
Powered by blists - more mailing lists