OSDN Git Service

mm/damon/vaddr: remove comparison between mm and last_mm when checking region accesses
authorKaixu Xia <kaixuxia@tencent.com>
Sat, 27 Aug 2022 09:02:51 +0000 (17:02 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 Sep 2022 03:26:04 +0000 (20:26 -0700)
commit95cd2522669243a1804ba8e9583ed10b3b4f51ef
treed812f0c6685abd1786b658d389992593a33432b1
parent09876ae73945ca69550ce2cbe0538de11997fd94
mm/damon/vaddr: remove comparison between mm and last_mm when checking region accesses

The damon regions that belong to the same damon target have the same
'struct mm_struct *mm', so it's unnecessary to compare the mm and last_mm
objects among the damon regions in one damon target when checking
accesses.  But the check is necessary when the target changed in
'__damon_va_check_accesses()', so we can simplify the whole operation by
using the bool 'same_target' to indicate whether the target changed.

Link: https://lkml.kernel.org/r/1661590971-20893-3-git-send-email-kaixuxia@tencent.com
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/vaddr.c