• SeongJae Park's avatar
    mm/damon/dbgfs: allow users to set initial monitoring target regions · 90bebce9
    SeongJae Park authored
    Patch series "DAMON: Support Physical Memory Address Space Monitoring:.
    
    DAMON currently supports only virtual address spaces monitoring.  It can
    be easily extended for various use cases and address spaces by
    configuring its monitoring primitives layer to use appropriate
    primitives implementations, though.  This patchset implements monitoring
    primitives for the physical address space monitoring using the
    structure.
    
    The first 3 patches allow the user space users manually set the
    monitoring regions.  The 1st patch implements the feature in the
    'damon-dbgfs'.  Then, patches for adding a unit tests (the 2nd patch)
    and updating the documentation (the 3rd patch) follow.
    
    Following 4 patches implement the physical address space monitoring
    primitives.  The 4th patch makes some primitive functions for the
    virtual address spaces primitives reusable.  The 5th patch implements
    the physical address space monitoring primitives.  The 6th patch links
    the primitives to the 'damon-dbgfs'.  Finally, 7th patch documents this
    new features.
    
    This patch (of 7):
    
    Some 'damon-dbgfs' users would want to monitor only a part of the entire
    virtual memory address space.  The program interface users in the kernel
    space could use '->before_start()' callback or set the regions inside
    the context struct as they want, but 'damon-dbgfs' users cannot.
    
    For that reason, this introduces a new debugfs file called
    'init_region'.  'damon-dbgfs' users can specify which initial monitoring
    target address regions they want by writing special input to the file.
    The input should describe each region in each line in the below form:
    
        <pid> <start address> <end address>
    
    Note that the regions will be updated to cover entire memory mapped
    regions after a 'regions update interval' is passed.  If you want the
    regions to not be updated after the initial setting, you could set the
    interval as a very long time, say, a few decades.
    
    Link: https://lkml.kernel.org/r/20211012205711.29216-1-sj@kernel.org
    Link: https://lkml.kernel.org/r/20211012205711.29216-2-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
    Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: Amit Shah <amit@kernel.org>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Woodhouse <dwmw@amazon.com>
    Cc: Marco Elver <elver@google.com>
    Cc: Leonard Foerster <foersleo@amazon.de>
    Cc: Greg Thelen <gthelen@google.com>
    Cc: Markus Boehme <markubo@amazon.de>
    Cc: David Rienjes <rientjes@google.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    90bebce9
dbgfs.c 19.2 KB