• SeongJae Park's avatar
    mm/damon/schemes: prioritize regions within the quotas · 38683e00
    SeongJae Park authored
    This makes DAMON apply schemes to regions having higher priority first,
    if it cannot apply schemes to all regions due to the quotas.
    
    The prioritization function should be implemented in the monitoring
    primitives.  Those would commonly calculate the priority of the region
    using attributes of regions, namely 'size', 'nr_accesses', and 'age'.
    For example, some primitive would calculate the priority of each region
    using a weighted sum of 'nr_accesses' and 'age' of the region.
    
    The optimal weights would depend on give environments, so this makes
    those customizable.  Nevertheless, the score calculation functions are
    only encouraged to respect the weights, not mandated.
    
    Link: https://lkml.kernel.org/r/20211019150731.16699-8-sj@kernel.org
    
    Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
    Cc: Amit Shah <amit@kernel.org>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: David Woodhouse <dwmw@amazon.com>
    Cc: Greg Thelen <gthelen@google.com>
    Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Leonard Foerster <foersleo@amazon.de>
    Cc: Marco Elver <elver@google.com>
    Cc: Markus Boehme <markubo@amazon.de>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    38683e00
core.c 24.1 KB