Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned

Linus Torvalds
2020-09-28T16:17:32Z

On Mon, Sep 28, 2020 at 5:49 AM Jason Gunthorpe <jgg@ziepe.ca> wrote:
>
> Not seeing an obvious option besides adding a smp_mb() before
> page_maybe_dma_pinned() as Peter once suggested.

That is going to be prohibitively expensive - needing it for each pte
whether it's pinned or not.

I really think the better option is a "don't do that then". This has
_never_ worked before either except by pure luck.

I also doubt anybody does it. forking with threads is a bad idea to
begin with. Doing so while pinning pages even more so.

Linus