1. 06 May, 2022 1 commit
  2. 26 Apr, 2022 2 commits
    • John Ogness's avatar
      printk: remove @console_locked · ab406816
      John Ogness authored
      The static global variable @console_locked is used to help debug
      VT code to make sure that certain code paths are running with
      the console_lock held. However, this information is also available
      with the static global variable @console_kthreads_blocked (for
      locking via console_lock()), and the static global variable
      @console_kthreads_active (for locking via console_trylock()).
      
      Remove @console_locked and update is_console_locked() to use the
      alternative variables.
      Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Link: https://lore.kernel.org/r/20220421212250.565456-16-john.ogness@linutronix.de
      ab406816
    • John Ogness's avatar
      printk: extend console_lock for per-console locking · 8e274732
      John Ogness authored
      Currently threaded console printers synchronize against each
      other using console_lock(). However, different console drivers
      are unrelated and do not require any synchronization between
      each other. Removing the synchronization between the threaded
      console printers will allow each console to print at its own
      speed.
      
      But the threaded consoles printers do still need to synchronize
      against console_lock() callers. Introduce a per-console mutex
      and a new console boolean field @blocked to provide this
      synchronization.
      
      console_lock() is modified so that it must acquire the mutex
      of each console in order to set the @blocked field. Console
      printing threads will acquire their mutex while printing a
      record. If @blocked was set, the thread will go back to sleep
      instead of printing.
      
      The reason for the @blocked boolean field is so that
      console_lock() callers do not need to acquire multiple console
      mutexes simultaneously, which would introduce unnecessary
      complexity due to nested mutex locking. Also, a new field
      was chosen instead of adding a new @flags value so that the
      blocked status could be checked without concern of reading
      inconsistent values due to @flags updates from other contexts.
      
      Threaded console printers also need to synchronize against
      console_trylock() callers. Since console_trylock() may be
      called from any context, the per-console mutex cannot be used
      for this synchronization. (mutex_trylock() cannot be called
      from atomic contexts.) Introduce a global atomic counter to
      identify if any threaded printers are active. The threaded
      printers will also check the atomic counter to identify if the
      console has been locked by another task via console_trylock().
      
      Note that @console_sem is still used to provide synchronization
      between console_lock() and console_trylock() callers.
      
      A locking overview for console_lock(), console_trylock(), and the
      threaded printers is as follows (pseudo code):
      
      console_lock()
      {
              down(&console_sem);
              for_each_console(con) {
                      mutex_lock(&con->lock);
                      con->blocked = true;
                      mutex_unlock(&con->lock);
              }
              /* console_lock acquired */
      }
      
      console_trylock()
      {
              if (down_trylock(&console_sem) == 0) {
                      if (atomic_cmpxchg(&console_kthreads_active, 0, -1) == 0) {
                              /* console_lock acquired */
                      }
              }
      }
      
      threaded_printer()
      {
              mutex_lock(&con->lock);
              if (!con->blocked) {
      		/* console_lock() callers blocked */
      
                      if (atomic_inc_unless_negative(&console_kthreads_active)) {
                              /* console_trylock() callers blocked */
      
                              con->write();
      
                              atomic_dec(&console_lock_count);
                      }
              }
              mutex_unlock(&con->lock);
      }
      
      The console owner and waiter logic now only applies between contexts
      that have taken the console_lock via console_trylock(). Threaded
      printers never take the console_lock, so they do not have a
      console_lock to handover. Tasks that have used console_lock() will
      block the threaded printers using a mutex and if the console_lock
      is handed over to an atomic context, it would be unable to unblock
      the threaded printers. However, the console_trylock() case is
      really the only scenario that is interesting for handovers anyway.
      
      @panic_console_dropped must change to atomic_t since it is no longer
      protected exclusively by the console_lock.
      
      Since threaded printers remain asleep if they see that the console
      is locked, they now must be explicitly woken in __console_unlock().
      This means wake_up_klogd() calls following a console_unlock() are
      no longer necessary and are removed.
      
      Also note that threaded printers no longer need to check
      @console_suspended. The check for the @blocked field implicitly
      covers the suspended console case.
      Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Link: https://lore.kernel.org/r/878rrs6ft7.fsf@jogness.linutronix.de
      8e274732
  3. 22 Apr, 2022 13 commits
  4. 23 Mar, 2022 4 commits
    • Linus Torvalds's avatar
      Merge tag 'printk-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · 3ef4ea3d
      Linus Torvalds authored
      Pull printk updates from Petr Mladek:
      
       - Make %pK behave the same as %p for kptr_restrict == 0 also with
         no_hash_pointers parameter
      
       - Ignore the default console in the device tree also when console=null
         or console="" is used on the command line
      
       - Document console=null and console="" behavior
      
       - Prevent a deadlock and a livelock caused by console_lock in panic()
      
       - Make console_lock available for panicking CPU
      
       - Fast query for the next to-be-used sequence number
      
       - Use the expected return values in printk.devkmsg __setup handler
      
       - Use the correct atomic operations in wake_up_klogd() irq_work handler
      
       - Avoid possible unaligned access when handling %4cc printing format
      
      * tag 'printk-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        printk: fix return value of printk.devkmsg __setup handler
        vsprintf: Fix %pK with kptr_restrict == 0
        printk: make suppress_panic_printk static
        printk: Set console_set_on_cmdline=1 when __add_preferred_console() is called with user_specified == true
        Docs: printk: add 'console=null|""' to admin/kernel-parameters
        printk: use atomic updates for klogd work
        printk: Drop console_sem during panic
        printk: Avoid livelock with heavy printk during panic
        printk: disable optimistic spin during panic
        printk: Add panic_in_progress helper
        vsprintf: Move space out of string literals in fourcc_string()
        vsprintf: Fix potential unaligned access
        printk: ringbuffer: Improve prb_next_seq() performance
      3ef4ea3d
    • Herbert Xu's avatar
      cacheflush.h: Add forward declaration for struct folio · 30d024b5
      Herbert Xu authored
      The struct folio is not declared in cacheflush.h so we need to provide
      a forward declaration as otherwise users of this header file may get
      warnings.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: 522a0032 ("Add linux/cacheflush.h")
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      30d024b5
    • Linus Torvalds's avatar
      Merge tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache · 6b1f86f8
      Linus Torvalds authored
      Pull filesystem folio updates from Matthew Wilcox:
       "Primarily this series converts some of the address_space operations to
        take a folio instead of a page.
      
        Notably:
      
         - a_ops->is_partially_uptodate() takes a folio instead of a page and
           changes the type of the 'from' and 'count' arguments to make it
           obvious they're bytes.
      
         - a_ops->invalidatepage() becomes ->invalidate_folio() and has a
           similar type change.
      
         - a_ops->launder_page() becomes ->launder_folio()
      
         - a_ops->set_page_dirty() becomes ->dirty_folio() and adds the
           address_space as an argument.
      
        There are a couple of other misc changes up front that weren't worth
        separating into their own pull request"
      
      * tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache: (53 commits)
        fs: Remove aops ->set_page_dirty
        fb_defio: Use noop_dirty_folio()
        fs: Convert __set_page_dirty_no_writeback to noop_dirty_folio
        fs: Convert __set_page_dirty_buffers to block_dirty_folio
        nilfs: Convert nilfs_set_page_dirty() to nilfs_dirty_folio()
        mm: Convert swap_set_page_dirty() to swap_dirty_folio()
        ubifs: Convert ubifs_set_page_dirty to ubifs_dirty_folio
        f2fs: Convert f2fs_set_node_page_dirty to f2fs_dirty_node_folio
        f2fs: Convert f2fs_set_data_page_dirty to f2fs_dirty_data_folio
        f2fs: Convert f2fs_set_meta_page_dirty to f2fs_dirty_meta_folio
        afs: Convert afs_dir_set_page_dirty() to afs_dir_dirty_folio()
        btrfs: Convert extent_range_redirty_for_io() to use folios
        fs: Convert trivial uses of __set_page_dirty_nobuffers to filemap_dirty_folio
        btrfs: Convert from set_page_dirty to dirty_folio
        fscache: Convert fscache_set_page_dirty() to fscache_dirty_folio()
        fs: Add aops->dirty_folio
        fs: Remove aops->launder_page
        orangefs: Convert launder_page to launder_folio
        nfs: Convert from launder_page to launder_folio
        fuse: Convert from launder_page to launder_folio
        ...
      6b1f86f8
    • Linus Torvalds's avatar
      Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache · 9030fb0b
      Linus Torvalds authored
      Pull folio updates from Matthew Wilcox:
      
       - Rewrite how munlock works to massively reduce the contention on
         i_mmap_rwsem (Hugh Dickins):
      
           https://lore.kernel.org/linux-mm/8e4356d-9622-a7f0-b2c-f116b5f2efea@google.com/
      
       - Sort out the page refcount mess for ZONE_DEVICE pages (Christoph
         Hellwig):
      
           https://lore.kernel.org/linux-mm/20220210072828.2930359-1-hch@lst.de/
      
       - Convert GUP to use folios and make pincount available for order-1
         pages. (Matthew Wilcox)
      
       - Convert a few more truncation functions to use folios (Matthew
         Wilcox)
      
       - Convert page_vma_mapped_walk to use PFNs instead of pages (Matthew
         Wilcox)
      
       - Convert rmap_walk to use folios (Matthew Wilcox)
      
       - Convert most of shrink_page_list() to use a folio (Matthew Wilcox)
      
       - Add support for creating large folios in readahead (Matthew Wilcox)
      
      * tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache: (114 commits)
        mm/damon: minor cleanup for damon_pa_young
        selftests/vm/transhuge-stress: Support file-backed PMD folios
        mm/filemap: Support VM_HUGEPAGE for file mappings
        mm/readahead: Switch to page_cache_ra_order
        mm/readahead: Align file mappings for non-DAX
        mm/readahead: Add large folio readahead
        mm: Support arbitrary THP sizes
        mm: Make large folios depend on THP
        mm: Fix READ_ONLY_THP warning
        mm/filemap: Allow large folios to be added to the page cache
        mm: Turn can_split_huge_page() into can_split_folio()
        mm/vmscan: Convert pageout() to take a folio
        mm/vmscan: Turn page_check_references() into folio_check_references()
        mm/vmscan: Account large folios correctly
        mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios
        mm/vmscan: Free non-shmem folios without splitting them
        mm/rmap: Constify the rmap_walk_control argument
        mm/rmap: Convert rmap_walk() to take a folio
        mm: Turn page_anon_vma() into folio_anon_vma()
        mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read()
        ...
      9030fb0b
  5. 22 Mar, 2022 20 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 3bf03b9a
      Linus Torvalds authored
      Merge updates from Andrew Morton:
      
       - A few misc subsystems: kthread, scripts, ntfs, ocfs2, block, and vfs
      
       - Most the MM patches which precede the patches in Willy's tree: kasan,
         pagecache, gup, swap, shmem, memcg, selftests, pagemap, mremap,
         sparsemem, vmalloc, pagealloc, memory-failure, mlock, hugetlb,
         userfaultfd, vmscan, compaction, mempolicy, oom-kill, migration, thp,
         cma, autonuma, psi, ksm, page-poison, madvise, memory-hotplug, rmap,
         zswap, uaccess, ioremap, highmem, cleanups, kfence, hmm, and damon.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (227 commits)
        mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release()
        Docs/ABI/testing: add DAMON sysfs interface ABI document
        Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface
        selftests/damon: add a test for DAMON sysfs interface
        mm/damon/sysfs: support DAMOS stats
        mm/damon/sysfs: support DAMOS watermarks
        mm/damon/sysfs: support schemes prioritization
        mm/damon/sysfs: support DAMOS quotas
        mm/damon/sysfs: support DAMON-based Operation Schemes
        mm/damon/sysfs: support the physical address space monitoring
        mm/damon/sysfs: link DAMON for virtual address spaces monitoring
        mm/damon: implement a minimal stub for sysfs-based DAMON interface
        mm/damon/core: add number of each enum type values
        mm/damon/core: allow non-exclusive DAMON start/stop
        Docs/damon: update outdated term 'regions update interval'
        Docs/vm/damon/design: update DAMON-Idle Page Tracking interference handling
        Docs/vm/damon: call low level monitoring primitives the operations
        mm/damon: remove unnecessary CONFIG_DAMON option
        mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}()
        mm/damon/dbgfs-test: fix is_target_id() change
        ...
      3bf03b9a
    • Xin Hao's avatar
      mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() · 15423a52
      Xin Hao authored
      In damon_sysfs_kdamond_release(), we have use container_of() to get
      "kdamond" pointer, so there no need to get it once again.
      
      Link: https://lkml.kernel.org/r/20220303075314.22502-1-xhao@linux.alibaba.comSigned-off-by: default avatarXin Hao <xhao@linux.alibaba.com>
      Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      15423a52
    • SeongJae Park's avatar
      Docs/ABI/testing: add DAMON sysfs interface ABI document · f968c6a4
      SeongJae Park authored
      This commit adds DAMON sysfs interface ABI document under
      Documentation/ABI/testing.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-14-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f968c6a4
    • SeongJae Park's avatar
      Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface · b1840272
      SeongJae Park authored
      This commit adds detailed usage of DAMON sysfs interface in the
      admin-guide document for DAMON.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-13-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1840272
    • SeongJae Park's avatar
      selftests/damon: add a test for DAMON sysfs interface · 40184e48
      SeongJae Park authored
      This commit adds a selftest for DAMON sysfs interface.  It tests the
      functionality of 'nr' files and existence of files in each directory of
      the hierarchy.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-12-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      40184e48
    • SeongJae Park's avatar
      mm/damon/sysfs: support DAMOS stats · 0ac32b8a
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the DAMOS stats feature.
      Specifically, this commit adds 'stats' directory under each scheme
      directory, and update the contents of the files under the directory
      according to the latest monitoring results, when the user writes special
      keyword, 'update_schemes_stats' to the 'state' file of the kdamond.
      
      As a result, the files hierarchy becomes as below:
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr_schemes
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ │ quotas/ms,sz,reset_interval_ms
          │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
          │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low
          │ │ │ │ │ │ │ stats/    <- NEW DIRECTORY
          │ │ │ │ │ │ │ │ nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-11-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ac32b8a
    • SeongJae Park's avatar
      mm/damon/sysfs: support DAMOS watermarks · 1b32234a
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the DAMOS watermarks
      feature.  Specifically, this commit adds 'watermarks' directory under each
      scheme directory and makes kdamond 'state' file writing respects the
      contents in the directory.
      
      As a result, the files hierarchy becomes as below:
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr_schemes
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ │ quotas/ms,sz,reset_interval_ms
          │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
          │ │ │ │ │ │ │ watermarks/    <- NEW DIRECTORY
          │ │ │ │ │ │ │ │ metric,interval_us,high,mid,lo
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      [sj@kernel.org: fix out-of-bound array access for wmark_metric_strs[]]
        Link: https://lkml.kernel.org/r/20220301185619.2904-1-sj@kernel.org
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-10-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Cc: Colin Ian King <colin.i.king@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1b32234a
    • SeongJae Park's avatar
      mm/damon/sysfs: support schemes prioritization · 1c78b2bc
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the DAMOS' regions
      prioritization weights feature under quotas limitation.  Specifically,
      this commit adds 'weights' directory under each scheme directory and makes
      kdamond 'state' file writing respects the contents in the directory.
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr
          │ │ 0/state,pid
          │ │ │ contexts/nr
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr
          │ │ │ │ │ │ 0/pid
          │ │ │ │ │ │ │ regions/nr
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms
          │ │ │ │ │ │ │ │ weights/    <- NEW DIRECTORY
          │ │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-9-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c78b2bc
    • SeongJae Park's avatar
      mm/damon/sysfs: support DAMOS quotas · 9bbb820a
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the DAMOS quotas feature.
      Specifically, this commit adds 'quotas' directory under each scheme
      directory and makes kdamond 'state' file writing respects the contents in
      the directory.
      
      As a result, the files hierarchy becomes as below:
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr_schemes
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms    <- NEW DIRECTORY
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-8-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9bbb820a
    • SeongJae Park's avatar
      mm/damon/sysfs: support DAMON-based Operation Schemes · 7e84b1f8
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the DAMON-based operation
      schemes (DAMOS) feature.  Specifically, this commit adds 'schemes'
      directory under each context direcotry, and makes kdamond 'state' file
      writing respects the contents in the directory.
      
      Note that this commit doesn't support all features of DAMOS but only the
      target access pattern and action feature.  Supports for quotas,
      prioritization, watermarks will follow.
      
      As a result, the files hierarchy becomes as below:
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr_schemes    <- NEW DIRECTORY
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-7-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e84b1f8
    • SeongJae Park's avatar
      mm/damon/sysfs: support the physical address space monitoring · 2031b14e
      SeongJae Park authored
      This commit makes DAMON sysfs interface supports the physical address
      space monitoring.  Specifically, this commit adds support of the initial
      monitoring regions set feature by adding 'regions' directory under each
      target directory and makes context operations file to receive 'paddr' in
      addition to 'vaddr'.
      
      As a result, the files hierarchy becomes as below:
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/
          │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions    <- NEW DIRECTORY
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-6-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2031b14e
    • SeongJae Park's avatar
      mm/damon/sysfs: link DAMON for virtual address spaces monitoring · a61ea561
      SeongJae Park authored
      This commit links the DAMON sysfs interface to DAMON so that users can
      control DAMON via the interface.  In detail, this commit makes writing
      'on' to 'state' file constructs DAMON contexts based on values that users
      have written to relevant sysfs files and start the context.  It supports
      only virtual address spaces monitoring at the moment, though.
      
      The files hierarchy of DAMON sysfs interface after this commit is shown
      below.  In the below figure, parents-children relations are represented
      with indentations, each directory is having ``/`` suffix, and files in
      each directory are separated by comma (",").
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/
          │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      The usage is straightforward.  Writing a number ('N') to each 'nr_*' file
      makes directories named '0' to 'N-1'.  Users can construct DAMON contexts
      by writing proper values to the files in the straightforward manner and
      start each kdamond by writing 'on' to 'kdamonds/<N>/state'.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-5-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a61ea561
    • SeongJae Park's avatar
      mm/damon: implement a minimal stub for sysfs-based DAMON interface · c951cd3b
      SeongJae Park authored
      DAMON's debugfs-based user interface served very well, so far.  However,
      it unnecessarily depends on debugfs, while DAMON is not aimed to be used
      for only debugging.  Also, the interface receives multiple values via one
      file.  For example, schemes file receives 18 values separated by white
      spaces.  As a result, it is ineffient, hard to be used, and difficult to
      be extended.  Especially, keeping backward compatibility of user space
      tools is getting only challenging.  It would be better to implement
      another reliable and flexible interface and deprecate the debugfs
      interface in long term.
      
      To this end, this commit implements a stub of a part of the new user
      interface of DAMON using sysfs.  Specifically, this commit implements the
      sysfs control parts for virtual address space monitoring.
      
      More specifically, the idea of the new interface is, using directory
      hierarchies and making one file for one value.  The hierarchy that this
      commit is introducing is as below.  In the below figure, parents-children
      relations are represented with indentations, each directory is having
      ``/`` suffix, and files in each directory are separated by comma (",").
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/
          │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Writing a number <N> to each 'nr' file makes directories of name <0> to
      <N-1> in the directory of the 'nr' file.  That's all this commit does.
      Writing proper values to relevant files will construct the DAMON contexts,
      and writing a special keyword, 'on', to 'state' files for each kdamond
      will ask DAMON to start the constructed contexts.
      
      For a short example, using below commands for monitoring virtual address
      spaces of a given workload is imaginable:
      
          # cd /sys/kernel/mm/damon/admin/
          # echo 1 > kdamonds/nr_kdamonds
          # echo 1 > kdamonds/0/contexts/nr_contexts
          # echo vaddr > kdamonds/0/contexts/0/operations
          # echo 1 > kdamonds/0/contexts/0/targets/nr_targets
          # echo $(pidof <workload>) > kdamonds/0/contexts/0/targets/0/pid_target
          # echo on > kdamonds/0/state
      
      Please note that this commit is implementing only the sysfs part stub as
      abovely mentioned.  This commit doesn't implement the special keywords for
      'state' files.  Following commits will do that.
      
      [jiapeng.chong@linux.alibaba.com: fix missing error code in damon_sysfs_attrs_add_dirs()]
        Link: https://lkml.kernel.org/r/20220302111120.24984-1-jiapeng.chong@linux.alibaba.com
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-4-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c951cd3b
    • SeongJae Park's avatar
      mm/damon/core: add number of each enum type values · 5257f36e
      SeongJae Park authored
      This commit declares the number of legal values for each DAMON enum types
      to make traversals of such DAMON enum types easy and safe.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-3-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5257f36e
    • SeongJae Park's avatar
      mm/damon/core: allow non-exclusive DAMON start/stop · 8b9b0d33
      SeongJae Park authored
      Patch series "Introduce DAMON sysfs interface", v3.
      
      Introduction
      ============
      
      DAMON's debugfs-based user interface (DAMON_DBGFS) served very well, so
      far.  However, it unnecessarily depends on debugfs, while DAMON is not
      aimed to be used for only debugging.  Also, the interface receives
      multiple values via one file.  For example, schemes file receives 18
      values.  As a result, it is inefficient, hard to be used, and difficult to
      be extended.  Especially, keeping backward compatibility of user space
      tools is getting only challenging.  It would be better to implement
      another reliable and flexible interface and deprecate DAMON_DBGFS in long
      term.
      
      For the reason, this patchset introduces a sysfs-based new user interface
      of DAMON.  The idea of the new interface is, using directory hierarchies
      and having one dedicated file for each value.  For a short example, users
      can do the virtual address monitoring via the interface as below:
      
          # cd /sys/kernel/mm/damon/admin/
          # echo 1 > kdamonds/nr_kdamonds
          # echo 1 > kdamonds/0/contexts/nr_contexts
          # echo vaddr > kdamonds/0/contexts/0/operations
          # echo 1 > kdamonds/0/contexts/0/targets/nr_targets
          # echo $(pidof <workload>) > kdamonds/0/contexts/0/targets/0/pid_target
          # echo on > kdamonds/0/state
      
      A brief representation of the files hierarchy of DAMON sysfs interface is
      as below.  Childs are represented with indentation, directories are having
      '/' suffix, and files in each directory are separated by comma.
      
          /sys/kernel/mm/damon/admin
          │ kdamonds/nr_kdamonds
          │ │ 0/state,pid
          │ │ │ contexts/nr_contexts
          │ │ │ │ 0/operations
          │ │ │ │ │ monitoring_attrs/
          │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
          │ │ │ │ │ │ nr_regions/min,max
          │ │ │ │ │ targets/nr_targets
          │ │ │ │ │ │ 0/pid_target
          │ │ │ │ │ │ │ regions/nr_regions
          │ │ │ │ │ │ │ │ 0/start,end
          │ │ │ │ │ │ │ │ ...
          │ │ │ │ │ │ ...
          │ │ │ │ │ schemes/nr_schemes
          │ │ │ │ │ │ 0/action
          │ │ │ │ │ │ │ access_pattern/
          │ │ │ │ │ │ │ │ sz/min,max
          │ │ │ │ │ │ │ │ nr_accesses/min,max
          │ │ │ │ │ │ │ │ age/min,max
          │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms
          │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
          │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low
          │ │ │ │ │ │ │ stats/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds
          │ │ │ │ │ │ ...
          │ │ │ │ ...
          │ │ ...
      
      Detailed usage of the files will be described in the final Documentation
      patch of this patchset.
      
      Main Difference Between DAMON_DBGFS and DAMON_SYSFS
      ---------------------------------------------------
      
      At the moment, DAMON_DBGFS and DAMON_SYSFS provides same features.  One
      important difference between them is their exclusiveness.  DAMON_DBGFS
      works in an exclusive manner, so that no DAMON worker thread (kdamond) in
      the system can run concurrently and interfere somehow.  For the reason,
      DAMON_DBGFS asks users to construct all monitoring contexts and start them
      at once.  It's not a big problem but makes the operation a little bit
      complex and unflexible.
      
      For more flexible usage, DAMON_SYSFS moves the responsibility of
      preventing any possible interference to the admins and work in a
      non-exclusive manner.  That is, users can configure and start contexts one
      by one.  Note that DAMON respects both exclusive groups and non-exclusive
      groups of contexts, in a manner similar to that of reader-writer locks.
      That is, if any exclusive monitoring contexts (e.g., contexts that started
      via DAMON_DBGFS) are running, DAMON_SYSFS does not start new contexts, and
      vice versa.
      
      Future Plan of DAMON_DBGFS Deprecation
      ======================================
      
      Once this patchset is merged, DAMON_DBGFS development will be frozen.
      That is, we will maintain it to work as is now so that no users will be
      break.  But, it will not be extended to provide any new feature of DAMON.
      The support will be continued only until next LTS release.  After that, we
      will drop DAMON_DBGFS.
      
      User-space Tooling Compatibility
      --------------------------------
      
      As DAMON_SYSFS provides all features of DAMON_DBGFS, all user space
      tooling can move to DAMON_SYSFS.  As we will continue supporting
      DAMON_DBGFS until next LTS kernel release, user space tools would have
      enough time to move to DAMON_SYSFS.
      
      The official user space tool, damo[1], is already supporting both
      DAMON_SYSFS and DAMON_DBGFS.  Both correctness tests[2] and performance
      tests[3] of DAMON using DAMON_SYSFS also passed.
      
      [1] https://github.com/awslabs/damo
      [2] https://github.com/awslabs/damon-tests/tree/master/corr
      [3] https://github.com/awslabs/damon-tests/tree/master/perf
      
      Sequence of Patches
      ===================
      
      First two patches (patches 1-2) make core changes for DAMON_SYSFS.  The
      first one (patch 1) allows non-exclusive DAMON contexts so that
      DAMON_SYSFS can work in non-exclusive mode, while the second one (patch 2)
      adds size of DAMON enum types so that DAMON API users can safely iterate
      the enums.
      
      Third patch (patch 3) implements basic sysfs stub for virtual address
      spaces monitoring.  Note that this implements only sysfs files and DAMON
      is not linked.  Fourth patch (patch 4) links the DAMON_SYSFS to DAMON so
      that users can control DAMON using the sysfs files.
      
      Following six patches (patches 5-10) implements other DAMON features that
      DAMON_DBGFS supports one by one (physical address space monitoring,
      DAMON-based operation schemes, schemes quotas, schemes prioritization
      weights, schemes watermarks, and schemes stats).
      
      Following patch (patch 11) adds a simple selftest for DAMON_SYSFS, and the
      final one (patch 12) documents DAMON_SYSFS.
      
      This patch (of 13):
      
      To avoid interference between DAMON contexts monitoring overlapping memory
      regions, damon_start() works in an exclusive manner.  That is,
      damon_start() does nothing bug fails if any context that started by
      another instance of the function is still running.  This makes its usage a
      little bit restrictive.  However, admins could aware each DAMON usage and
      address such interferences on their own in some cases.
      
      This commit hence implements non-exclusive mode of the function and allows
      the callers to select the mode.  Note that the exclusive groups and
      non-exclusive groups of contexts will respect each other in a manner
      similar to that of reader-writer locks.  Therefore, this commit will not
      cause any behavioral change to the exclusive groups.
      
      Link: https://lkml.kernel.org/r/20220228081314.5770-1-sj@kernel.org
      Link: https://lkml.kernel.org/r/20220228081314.5770-2-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Shuah Khan <skhan@linuxfoundation.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8b9b0d33
    • SeongJae Park's avatar
      Docs/damon: update outdated term 'regions update interval' · 4c1f287f
      SeongJae Park authored
      Before DAMON is merged in the mainline, the concept of 'regions update
      interval' has generalized to be used as the time interval for update of
      any monitoring operations related data structure, but the document has not
      updated properly.  This commit updates the document for better
      consistency.
      
      Link: https://lkml.kernel.org/r/20220222170100.17068-4-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4c1f287f
    • SeongJae Park's avatar
      Docs/vm/damon/design: update DAMON-Idle Page Tracking interference handling · 742cc2bf
      SeongJae Park authored
      In DAMON's early development stage before it be merged in the mainline, it
      was first designed to work exclusively with Idle page tracking to avoid
      any interference between each other.  Later, but still before be merged in
      the mainline, because Idle page tracking is fully under the control of
      sysadmins, we made the resolving of conflict as the responsibility of
      sysadmins.  The document is not updated for the change, though.  This
      commit updates the document for that.
      
      Link: https://lkml.kernel.org/r/20220222170100.17068-3-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      742cc2bf
    • SeongJae Park's avatar
      Docs/vm/damon: call low level monitoring primitives the operations · 561f4fc4
      SeongJae Park authored
      Patch series "Docs/damon: Update documents for better consistency".
      
      Some of DAMON document are not properly updated for latest version.  This
      patchset updates such parts.
      
      This patch (of 3):
      
      DAMON code calls the low level monitoring primitives implementations the
      monitoring operations.  The documentation would have no problem at still
      calling those primitives implementation because there is no real
      difference in the concepts, but making it more consistent with the code
      would make it better.  This commit therefore convert sentences in the doc
      specifically pointing the implementations of the primitives to call it
      monitoring operations.
      
      Link: https://lkml.kernel.org/r/20220222170100.17068-1-sj@kernel.org
      Link: https://lkml.kernel.org/r/20220222170100.17068-2-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      561f4fc4
    • tangmeng's avatar
      mm/damon: remove unnecessary CONFIG_DAMON option · 3213a3c1
      tangmeng authored
      In mm/Makefile has:
      
        obj-$(CONFIG_DAMON) += damon/
      
      So that we don't need 'obj-$(CONFIG_DAMON) :=' in mm/damon/Makefile,
      delete it from mm/damon/Makefile.
      
      Link: https://lkml.kernel.org/r/20220221065255.19991-1-tangmeng@uniontech.comSigned-off-by: default avatartangmeng <tangmeng@uniontech.com>
      Cc: SeongJae Park <sj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3213a3c1
    • SeongJae Park's avatar
      mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}() · 85104056
      SeongJae Park authored
      Because DAMON debugfs interface and DAMON-based proactive reclaim are now
      using monitoring operations via registration mechanism,
      damon_{p,v}a_{target_valid,set_operations}() functions have no user.  This
      commit clean them up.
      
      Link: https://lkml.kernel.org/r/20220215184603.1479-9-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Xin Hao <xhao@linux.alibaba.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      85104056