[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200921020007.35803-3-chenjun102@huawei.com>
Date: Mon, 21 Sep 2020 02:00:04 +0000
From: Chen Jun <chenjun102@...wei.com>
To: <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
CC: <catalin.marinas@....com>, <akpm@...ux-foundation.org>,
<rui.xiang@...wei.com>, <weiyongjun1@...wei.com>
Subject: [PATCH -next 2/5] mm/kmemleak: skip update_checksum for OBJECT_NO_SCAN objects
From: Wei Yongjun <weiyongjun1@...wei.com>
Objects marked with OBJECT_NO_SCAN are never scanned.
So there is no need to update checksum for them.
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
Signed-off-by: Chen Jun <chenjun102@...wei.com>
---
mm/kmemleak.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index b3f603fd9fc3..c09c6b59eda6 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1166,6 +1166,10 @@ static bool update_checksum(struct kmemleak_object *object)
{
u32 old_csum = object->checksum;
+ /* always return false for not scan object */
+ if (object->flags & OBJECT_NO_SCAN)
+ return false;
+
kasan_disable_current();
kcsan_disable_current();
object->checksum = crc32(0, (void *)object->pointer, object->size);
--
2.25.0
Powered by blists - more mailing lists