]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/damon: validate if the pmd entry is present before accessing
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Wed, 17 Aug 2022 06:21:12 +0000 (14:21 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 17 Aug 2022 20:58:40 +0000 (13:58 -0700)
commit4b847d3e4f87c800ec0b0a58520b966ee2317bda
tree96221dcbbb60d89de643127dc63dd4a317373068
parent05a6ddf49a6ba32e0925cb9422e2a17db968b798
mm/damon: validate if the pmd entry is present before accessing

The pmd_huge() is used to validate if the pmd entry is mapped by a huge
page, also including the case of non-present (migration or hwpoisoned) pmd
entry on arm64 or x86 architectures.  Thus we should validate if it is
present before making the pmd entry old or getting young state, otherwise
we can not get the correct corresponding page.

Link: https://lkml.kernel.org/r/2838b6737bc259cf575ff11fd1c4b7fdb340fa73.1660717122.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/vaddr.c