From patchwork Fri Aug 26 03:12:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 12955523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A78ECAAA2 for ; Fri, 26 Aug 2022 03:13:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE7AC940007; Thu, 25 Aug 2022 23:13:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B96106B0075; Thu, 25 Aug 2022 23:13:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A850F940007; Thu, 25 Aug 2022 23:13:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9A6DB6B0074 for ; Thu, 25 Aug 2022 23:13:21 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 744CF120430 for ; Fri, 26 Aug 2022 03:13:21 +0000 (UTC) X-FDA: 79840273002.02.EBCB7F4 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf31.hostedemail.com (Postfix) with ESMTP id 33EE620011 for ; Fri, 26 Aug 2022 03:13:18 +0000 (UTC) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id 27Q3CVPW028931 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 26 Aug 2022 11:12:31 +0800 (CST) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 26 Aug 2022 11:12:30 +0800 From: "zhaoyang.huang" To: Andrew Morton , Catalin Marinas , Zhaoyang Huang , , , Subject: [PATCH] mm: skip reserved page for kmem leak scanning Date: Fri, 26 Aug 2022 11:12:10 +0800 Message-ID: <1661483530-11308-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 27Q3CVPW028931 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661483601; a=rsa-sha256; cv=none; b=HRrVdYWkywJL8rzx6uhAcFjYbBva2Cn6YTUlAXm7hVI0Ua/pE7txpbAUlM7d3OGr+5gav/ HHA2zzzLX1u7ZErfupDIhhVUF+L4kGmSeIqe+56IJ9clarvD04ZJqFpnQlugY8yU77UEp7 FUSUxS5RgmV7QPMo9LClNIxorzG+Y3g= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf31.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661483601; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=gY/P8YhadYNbe3EmimCycEYnYoRC3x6RHoCbwKykMkE=; b=pg/H7k6knDnOsuBjL7/5PQ9DQovqzJxjHwmeJoeyEj+pNHbHYJhpTzgg/NopJDDOnFBDhe kvkRIzUrjmOpdGTyHGt53/IayHoqPnyPyGOBWtNoyl+dMvGg8XjTUwPY1epyVG8VzNwZag tDb4w+81p3yhfANcCPrANNvJd6vBYPA= Authentication-Results: imf31.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf31.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com X-Rspam-User: X-Rspamd-Queue-Id: 33EE620011 X-Rspamd-Server: rspam08 X-Stat-Signature: 37zio7c4swtmafee8ref1rg8mq79ixzr X-HE-Tag: 1661483598-908583 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang It is no need to scan reserved page, skip it. Signed-off-by: Zhaoyang Huang --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index a182f5d..c546250 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1471,7 +1471,7 @@ static void kmemleak_scan(void) if (page_zone(page) != zone) continue; /* only scan if page is in use */ - if (page_count(page) == 0) + if (page_count(page) == 0 && !PageReserved(page)) continue; scan_block(page, page + 1, NULL); if (!(pfn & 63))