From patchwork Wed Oct 18 10:29:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13426727 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 169A1CDB47E for ; Wed, 18 Oct 2023 09:30:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 952C08D014B; Wed, 18 Oct 2023 05:30:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8DA3F8D014A; Wed, 18 Oct 2023 05:30:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 754788D014B; Wed, 18 Oct 2023 05:30:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5F6778D0016 for ; Wed, 18 Oct 2023 05:30:27 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 284C540947 for ; Wed, 18 Oct 2023 09:30:27 +0000 (UTC) X-FDA: 81358061694.29.84CC8DF Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf14.hostedemail.com (Postfix) with ESMTP id 62483100023 for ; Wed, 18 Oct 2023 09:30:23 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697621425; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=5cU91BnsJcIli+GULF/q1AOWiVPUWIo630mNSuvYwsQ=; b=QbMhSX/5Hab02wyU46VWY8eZ86JPd6Wh8sdhWFKDEa2OrdDHK6TnrM3MdPPybRv/gWWv91 fY99U5MET70Q4bHVz7WVB1/ynwW40j8TTpNLxmuYFwBUjmb3UGZHFo5s0qM6oeDJ7WePyd XeGQKwG/gl6FSOE2V3Nnj0qRtpYYYb8= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697621425; a=rsa-sha256; cv=none; b=V3jCWLeEzlaI6yWHfAoAHWK479aURlYlwhu+8ElnKPl6p68pg46Fccan8KmgnXd85QQ8UZ s5IZseB2WVs39VRMXZm3MVrXAuCoYccObjnke+fEpDkJSZSOrvAlzI8KPlkRWln+Vho32C WHkPcFzCLkyzHEaFeRO9PNv83n4tjIM= Received: from dggpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S9QTT53XPzRt5H; Wed, 18 Oct 2023 17:26:37 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 18 Oct 2023 17:30:17 +0800 From: Liu Shixin To: Catalin Marinas , Patrick Wang , Andrew Morton , Kefeng Wang CC: , , Liu Shixin Subject: [PATCH v3 0/7] Some bugfix about kmemleak Date: Wed, 18 Oct 2023 18:29:45 +0800 Message-ID: <20231018102952.3339837-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 62483100023 X-Rspam-User: X-Stat-Signature: 9cr8dnmmuc5bjxjf4cjobtgxshkawkyq X-Rspamd-Server: rspam01 X-HE-Tag: 1697621423-392031 X-HE-Meta: U2FsdGVkX1+BcICZplEiCRAw8itnDNmUjVyKedq5dW4D2ilueIZKDpLJvGyaQqwNIFUrL5qaRYmx6FWuVlIh9VcQqBoMr3CtNnYJ2q0o+Z7VaJTz0Vj1WY8XFJiJZ0DcBRb3CwQ2O9Vmqfb7aWlAR8ecN9qvL1Svkt02UlWa5Noqknnp6RB2J2OUAKtWLeFs+dXk8YfLBpjtjHTha6arG/lZZ3eUVjbJcEEPGJ74BJct4thnebPM5wU4ktbCDeRyMfUtCG+v69VCTVtgD7DiNzLDopkvIRWvnW58R3SFFbe/eaDQZ3KcJli3JdLZL2HjYG65OuL85p6julDf0zyrmm2AOpdLoEwYdSQaB13g6jqmserHX9XFcsjvRCNe2e8wnap101j/RnzUwcAXgu7w4pF0etkeMqNfK2dP5uCBrZCcbKWy9EN+hNJt/kVZiTE/4ePEmZbaXDW3jPvCjTMMHktcGwLNYivD8FmFk0rtywZVxrBDldNSjlfJA2VCFVU+2e6fiWwQmVnd7/FABi1kED0PY/TMFUHcbrYniHXb5Yj9IwIeqrbQagi8tcD3cjc4Qdrey/4akwakmxQrgb1nn+Ga2EKOneZLTpI3cUPIIAM9Z2R4nEc/6yo3CU48/FjM3NMavmTfS9lvD8DJdq/WNFxLKh3NtJ4vk79ycBaDnUbKx2doiflwPChJOtyBBNbFTH1UyIeZlvozNykkvBNNRD5VhO1HMFdk4nVcjZzZOuBzQwiep2+F/RygOu/UyvdW8dT5S4YWK6y50sbN+Hdm3tvPRGR09ExACg0/K2F0FCUoasFUq7etDe3lfJtywjxOLxSiaywDqjoa5VwurrL4/j2r+B19ysN0cIGgKyvqTMsXWTptZSf31GjvDDrrCKB+ynKwfGjdUM3aUB4g6pGIZTALRvMaTULvVsYuKpn/7fa6yKW2rTsfhTmMv4Is/Zn5RryR7j2NVCZWQuoMYJU N1jIl1Nh XVnVgSeda3JXvugrDfc0zRQY4aHBpTcEhXvkt1f3m0De4rgDOPUDuFrXfyYjVGW5/QTplhpWX1Fzkqubb1l+f++qPq47EyTufoX6TaX/1nOI1AvcGjz/5TBReMug7E5MwZjPe7/eCX/ixHIPxx08uSXee42m8+3jEhrzh8laQRGTXpl1kuEikT8202u12B3nxNA07 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: Some bugfix about kmemleak and the print info of debug mode. v2->v3: Split __create_object into two function[4] and use kmemleak_lock to fix partially freeing unknown object warning[7]. And add a new patch to fix an inccorrect use of kmem_cache_free[5]. v1->v2: Split the first patch suggested by Andrew. And fix the format of the last two patches suggested by Catalin. Use mutex in patch[3] because there are memory allocation with flag GFP_KERNEL. Liu Shixin (7): bootmem: use kmemleak_free_part_phys in put_page_bootmem bootmem: use kmemleak_free_part_phys in free_bootmem_page mm/kmemleak: fix print format of pointer in pr_debug() mm: kmemleak: split __create_object into two functions mm: kmemleak: use mem_pool_free() to free object mm: kmemleak: add __find_and_remove_object() mm/kmemleak: fix partially freeing unknown object warning include/linux/bootmem_info.h | 2 +- mm/bootmem_info.c | 2 +- mm/kmemleak.c | 154 +++++++++++++++++++++++------------ 3 files changed, 106 insertions(+), 52 deletions(-)