lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mm: vmscan: do not skip CMA while LRU is full of CMA folios
Date
On 2024/4/8 16:38, Oscar Salvador wrote:
> On Mon, Apr 08, 2024 at 04:05:39PM +0800, liuhailong@oppo.com wrote:
>> From: liuhailong <liuhailong@oppo.com>
>> @@ -6202,6 +6213,16 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
>> */
>> if (sc->priority < DEF_PRIORITY - 2)
>> sc->may_writepage = 1;
>> +
>> + /*
>> + * If we're getting trouble reclaiming non-cma pages and
>> + * currently a substantial number of CMA pages on LRU,
> "sit on LRU" ?
Got it, Thanks
>
>> + * start reclaiming cma pages to alleviate other threads
>> + * and decrease lru size.
>> + */
>> + if (sc->priority < DEF_PRIORITY - 2 &&
>> + sc->nr_scanned < (sc->nr_skipped_cma >> 3))
>
> Why "sc->nr_skipped_cma >> 3"? It feels a bit hardcoded.
> Maybe the comment or the changelog should contain a reference about why
> this "/8" was a good choice.

When the number of skipped CMA ages exceeds eight times the number of
scanned pages, it indicates that CMA pages constitute the majority
of the LRU pages. Setting the value too low may result in premature
reclamation of CMA pages, which are unnecessary for non-movable
allocations. Conversely, setting it too high may delay problem detection
until much later, wasting CPU time in idle loops.

Brs,
Hailong.
\
 
 \ /
  Last update: 2024-05-27 16:30    [W:0.031 / U:2.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site