lkml.org 
[lkml]   [2020]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] mm: Introduce mm_struct.has_pinned
On Fri, Sep 25, 2020 at 12:56:05PM -0700, Linus Torvalds wrote:
> So I think we can simply add a
>
> if (page_mapcount(page) != 1)
> return false;
>
> to page_maybe_dma_pinned(), and that very naturally protects against
> the "is the page count perhaps elevated due to a lot of forking?"

How about the MAP_SHARED case where the page is pinned by some process but also
shared (so mapcount can be >1)?

> And honestly, since this is all getting fairly late in the rc, and it
> took longer than I thought, I think we should do the GFP_ATOMIC
> approach for now - not great, but since it only triggers for this case
> that really should never happen anyway, I think it's probably the best
> thing for 5.9, and we can improve on things later.

Sorry for that. Maybe I should have moved even faster.

Would the ATOMIC version always work? I mean, I thought it could fail anytime,
so any fork() can start to fail for the tests too.

PS. I do plan to post a GFP_KERNEL version soon today, no matter for this
release or the next one.

--
Peter Xu

\
 
 \ /
  Last update: 2020-09-25 23:14    [W:0.172 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site