1. 22 Feb, 2024 37 commits
  2. 20 Feb, 2024 3 commits
    • Benjamin Gray's avatar
      kasan: guard release_free_meta() shadow access with kasan_arch_is_ready() · 2597c994
      Benjamin Gray authored
      release_free_meta() accesses the shadow directly through the path
      
        kasan_slab_free
          __kasan_slab_free
            kasan_release_object_meta
              release_free_meta
                kasan_mem_to_shadow
      
      There are no kasan_arch_is_ready() guards here, allowing an oops when the
      shadow is not initialized.  The oops can be seen on a Power8 KVM guest.
      
      This patch adds the guard to release_free_meta(), as it's the first level
      that specifically requires the shadow.
      
      It is safe to put the guard at the start of this function, before the
      stack put: only kasan_save_free_info() can initialize the saved stack,
      which itself is guarded with kasan_arch_is_ready() by its caller
      poison_slab_object().  If the arch becomes ready before
      release_free_meta() then we will not observe KASAN_SLAB_FREE_META in the
      object's shadow, so we will not put an uninitialized stack either.
      
      Link: https://lkml.kernel.org/r/20240213033958.139383-1-bgray@linux.ibm.com
      Fixes: 63b85ac5 ("kasan: stop leaking stack trace handles")
      Signed-off-by: default avatarBenjamin Gray <bgray@linux.ibm.com>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2597c994
    • SeongJae Park's avatar
      mm/damon/lru_sort: fix quota status loss due to online tunings · 13d0599a
      SeongJae Park authored
      For online parameters change, DAMON_LRU_SORT creates new schemes based on
      latest values of the parameters and replaces the old schemes with the new
      one.  When creating it, the internal status of the quotas of the old
      schemes is not preserved.  As a result, charging of the quota starts from
      zero after the online tuning.  The data that collected to estimate the
      throughput of the scheme's action is also reset, and therefore the
      estimation should start from the scratch again.  Because the throughput
      estimation is being used to convert the time quota to the effective size
      quota, this could result in temporal time quota inaccuracy.  It would be
      recovered over time, though.  In short, the quota accuracy could be
      temporarily degraded after online parameters update.
      
      Fix the problem by checking the case and copying the internal fields for
      the status.
      
      Link: https://lkml.kernel.org/r/20240216194025.9207-3-sj@kernel.org
      Fixes: 40e983cc ("mm/damon: introduce DAMON-based LRU-lists Sorting")
      Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: <stable@vger.kernel.org>	[6.0+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      13d0599a
    • SeongJae Park's avatar
      mm/damon/reclaim: fix quota stauts loss due to online tunings · 1b0ca4e4
      SeongJae Park authored
      Patch series "mm/damon: fix quota status loss due to online tunings".
      
      DAMON_RECLAIM and DAMON_LRU_SORT is not preserving internal quota status
      when applying new user parameters, and hence could cause temporal quota
      accuracy degradation.  Fix it by preserving the status.
      
      
      This patch (of 2):
      
      For online parameters change, DAMON_RECLAIM creates new scheme based on
      latest values of the parameters and replaces the old scheme with the new
      one.  When creating it, the internal status of the quota of the old
      scheme is not preserved.  As a result, charging of the quota starts from
      zero after the online tuning.  The data that collected to estimate the
      throughput of the scheme's action is also reset, and therefore the
      estimation should start from the scratch again.  Because the throughput
      estimation is being used to convert the time quota to the effective size
      quota, this could result in temporal time quota inaccuracy.  It would be
      recovered over time, though.  In short, the quota accuracy could be
      temporarily degraded after online parameters update.
      
      Fix the problem by checking the case and copying the internal fields for
      the status.
      
      Link: https://lkml.kernel.org/r/20240216194025.9207-1-sj@kernel.org
      Link: https://lkml.kernel.org/r/20240216194025.9207-2-sj@kernel.org
      Fixes: e035c280 ("mm/damon/reclaim: support online inputs update")
      Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
      Cc: <stable@vger.kernel.org>	[5.19+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      1b0ca4e4