lkml.org 
[lkml]   [2023]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] mm, compaction: Skip all non-migratable pages during scan
On Fri, May 26, 2023 at 07:11:05PM -0700, John Hubbard wrote:
> > So any user with 1024 processes can fragment physical memory? :/
> >
> > Sorry, I'd like to minimize the usage of folio_maybe_dma_pinned().
>
> I was actually thinking that we should minimize any more cases of
> fragile mapcount and refcount comparison, which then leads to
> Matthew's approach here!

I was wondering if we shouldn't make folio_maybe_dma_pinned() a little
more accurate. eg:

if (folio_test_large(folio))
return atomic_read(&folio->_pincount) > 0;
return (unsigned)(folio_ref_count(folio) - folio_mapcount(folio)) >=
GUP_PIN_COUNTING_BIAS;

\
 
 \ /
  Last update: 2023-05-27 05:19    [W:0.088 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site