• Huang Ying's avatar
    memory tiering: adjust hot threshold automatically · c959924b
    Huang Ying authored
    The promotion hot threshold is workload and system configuration
    dependent.  So in this patch, a method to adjust the hot threshold
    automatically is implemented.  The basic idea is to control the number of
    the candidate promotion pages to match the promotion rate limit.  If the
    hint page fault latency of a page is less than the hot threshold, we will
    try to promote the page, and the page is called the candidate promotion
    page.
    
    If the number of the candidate promotion pages in the statistics interval
    is much more than the promotion rate limit, the hot threshold will be
    decreased to reduce the number of the candidate promotion pages. 
    Otherwise, the hot threshold will be increased to increase the number of
    the candidate promotion pages.
    
    To make the above method works, in each statistics interval, the total
    number of the pages to check (on which the hint page faults occur) and the
    hot/cold distribution need to be stable.  Because the page tables are
    scanned linearly in NUMA balancing, but the hot/cold distribution isn't
    uniform along the address usually, the statistics interval should be
    larger than the NUMA balancing scan period.  So in the patch, the max scan
    period is used as statistics interval and it works well in our tests.
    
    Link: https://lkml.kernel.org/r/20220713083954.34196-4-ying.huang@intel.comSigned-off-by: default avatar"Huang, Ying" <ying.huang@intel.com>
    Reviewed-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
    Tested-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: osalvador <osalvador@suse.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Wei Xu <weixugc@google.com>
    Cc: Yang Shi <shy828301@gmail.com>
    Cc: Zhong Jiang <zhongjiang-ali@linux.alibaba.com>
    Cc: Zi Yan <ziy@nvidia.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    c959924b
core.c 285 KB