• Huang Ying's avatar
    mm, pcp: decrease PCP high if free pages < high watermark · 57c0419c
    Huang Ying authored
    One target of PCP is to minimize pages in PCP if the system free pages is
    too few.  To reach that target, when page reclaiming is active for the
    zone (ZONE_RECLAIM_ACTIVE), we will stop increasing PCP high in allocating
    path, decrease PCP high and free some pages in freeing path.  But this may
    be too late because the background page reclaiming may introduce latency
    for some workloads.  So, in this patch, during page allocation we will
    detect whether the number of free pages of the zone is below high
    watermark.  If so, we will stop increasing PCP high in allocating path,
    decrease PCP high and free some pages in freeing path.  With this, we can
    reduce the possibility of the premature background page reclaiming caused
    by too large PCP.
    
    The high watermark checking is done in allocating path to reduce the
    overhead in hotter freeing path.
    
    Link: https://lkml.kernel.org/r/20231016053002.756205-9-ying.huang@intel.comSigned-off-by: default avatar"Huang, Ying" <ying.huang@intel.com>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Johannes Weiner <jweiner@redhat.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Arjan van de Ven <arjan@linux.intel.com>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    57c0419c
page_alloc.c 191 KB