[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGWnq/dAYELyKpTy@infradead.org>
Date: Wed, 17 May 2023 21:20:59 -0700
From: Christoph Hellwig <hch@...radead.org>
To: David Hildenbrand <david@...hat.com>
Cc: Sumit Garg <sumit.garg@...aro.org>,
Christoph Hellwig <hch@...radead.org>,
Xiaoming Ding <xiaoming.ding@...iatek.com>,
Jens Wiklander <jens.wiklander@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, fei.xu@...iatek.com,
srv_heupstream@...iatek.com, linux-mm@...ck.org
Subject: FOLL_LONGTERM vs FOLL_EPHEMERAL Re: [PATCH] tee: add FOLL_LONGTERM
for CMA case when alloc shm
On Wed, May 17, 2023 at 08:23:33PM +0200, David Hildenbrand wrote:
> In general: if user space controls it -> possibly forever -> long-term. Even
> if in most cases it's a short delay: there is no trusting on user space.
>
> For example, iouring fixed buffers keep pages pinned until user space
> decides to unregistered the buffers -> long-term.
>
> Short-term is, for example, something like O_DIRECT where we pin -> DMA ->
> unpin in essentially one operation.
Btw, one thing that's been on my mind is that I think we got the
polarity on FOLL_LONGTERM wrong. Instead of opting into the long term
behavior it really should be the default, with a FOLL_EPHEMERAL flag
to opt out of it. And every users of this flag is required to have
a comment explaining the life time rules for the pin..
Powered by blists - more mailing lists