From patchwork Wed Sep 25 13:25:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13812009 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 A34C3CF58C7 for ; Wed, 25 Sep 2024 13:27:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2198D6B00AA; Wed, 25 Sep 2024 09:27:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A3D26B00AB; Wed, 25 Sep 2024 09:27:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 042D56B00AD; Wed, 25 Sep 2024 09:27:04 -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 DC7A96B00AA for ; Wed, 25 Sep 2024 09:27:04 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6ED04140BBC for ; Wed, 25 Sep 2024 13:27:04 +0000 (UTC) X-FDA: 82603336368.21.425CCBB Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf14.hostedemail.com (Postfix) with ESMTP id 302C510000E for ; Wed, 25 Sep 2024 13:27:00 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727270662; 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:in-reply-to: references; bh=NK5lNKOLLZ97WW0Nx2w/VJEHYJfKqp1bP2IjQ0yasoA=; b=vT9jap5ptjLrprIPOgXiu9lrzYuwg+hFYbca91Sebnf7P7DqFQM8Efosjs3y2+Jt+dynKq 6CrkB6JbsWT0+L7kUQvxAYFK1nh6lY1acnvSIvbJufxpyTQmjW2TUA5WupG0udhSSb8/sA oMRZtSmwy5oNQvoEAaYvHque7i4siUE= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727270662; a=rsa-sha256; cv=none; b=HCLnl7crWlShfccWI5DXhVkpLdKkf2MXfcO5Si+LpfQa/LLIXXdVso7CFIRWkwOlj/cLhT KBrvm/9jgGa8152CkFNJjf4Q4G9m57AXQ85HeuzM0lhvfCxaObSvsBquWSoE10QL5SgAfM aMQ+6ob2FnwcVnCFtVxU9LkMnXGfujQ= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 48PDPBUb031950; Wed, 25 Sep 2024 21:25:11 +0800 (+08) (envelope-from fangzheng.zhang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XDHMV6Ykrz2K5B73; Wed, 25 Sep 2024 21:17:26 +0800 (CST) Received: from bj10906pcu1.spreadtrum.com (10.0.73.72) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 25 Sep 2024 21:25:09 +0800 From: Fangzheng Zhang To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Greg KH CC: , , , Fangzheng Zhang , Fangzheng Zhang , Yuming Han Subject: [PATCH V2 0/2] Introduce panic function when slub leaks Date: Wed, 25 Sep 2024 21:25:03 +0800 Message-ID: <20240925132505.21278-1-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.0.73.72] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 48PDPBUb031950 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 302C510000E X-Stat-Signature: wc17wjigz93w7d87y7qd9eqogpd1wuox X-Rspam-User: X-HE-Tag: 1727270820-917940 X-HE-Meta: U2FsdGVkX1+LT+E5lNuusy/4SlYtonY5bI+ciZ0NM1Y85AWW5CeYGgNiLhrI1Ee6z46xIZq66Fw3e8E666DT+0mWZfZflwuh8tiAOzowtYdWz3xTC1VYn3DFUVqGl31m0+VK3D00pY68EO1bzhcY6dcvq9s4prf4LNl03FvN1HlxxkKW+FpkQb/DriKt+tq68op9Rrly/quQ0kjndKIyl2W1WAZVpdCh7DK/Lx7eSLAKmTOxR0zzk3ANjC+yjG9eO4/VW5YE/oBDmFZjT/4viF5Ysd6Z0y8tA6PszCY2ALlkLy4W1JAD8MPGYr4AN/5CCk3KjlFqVqUAJ1HTMibHel8IYOuS4fm8UB1O/5P2Uoi5Q3tfYOrYoKK5bF42sgn7POaUmE9cXsqETYiuXbxAk8fFRGwZxOfkFFpK4HDGuyJZ2Hb4gGdgFvhLyQU+ppLp3l7XIxkeLty3XR5G3NgKmvCw/rA9RkMeVjkNeJ3G3OZ6vxE0kO0moC1+r/XGyUxWCSqbONO+7OcIUK6YxtI7ttME4bYauESTDOZAQYmjC7322/2spUSW/47UOOUrtdPahjlrgZ7AZb+ZYlcddGFkaMCAerfT9oY8ef6ld6mtHyBIU5bwsqhDlIVejwwKoD8yYX6XJw40FMiRHGAqUVe+0dQNGBcM3RZW6gabWe7VTBmT7ouoGqFZSZgDUIgLugI+Hzjvy04pwYSGGrv/BwGgdmpeQo9Zl1F0qVjmSl3y3cggv3wXbCr1UgqE3ouUcjjCCYgvKSb/xhx04eaZ3TUgmh9lPgZBVkcmyqE7nU9BQO3pt5cFteKHmmoXgvXfzB5k9XQ6aZbyG6FZIlxh251WlnTjchML9HZR57rj/ygbztIXgh9bBO5/ul2B+HqjvNaigfhnNb0pIm/CpC65QODsldyjO4eqh/7wgqvUZSfI5Rxe1qywHDeYg45EQEC0sHWS1RlV6kvTyftPYt+JmXa 5Zs4RiTn bUToP9XCNG/JTG0rSYwoGwlqhawK/cm3BxAAo8KYUYpipqk1vLs/YmDu28eirektULn1PTOvEv7Z7FK3XL1OG1YsPbMtPEHVdGOdonvhqjNM2IghDewiy+v/wTGHItWH3jOUxRbLOzcpeH0GU0XtcLldGDP2B2VSSJ2uLOUfSWrF2SuLZy4EARhUqTFhX3stYtkTn4tvPTHOwAQFlupOhP16eSBb2/E6FN+17egDM8rgupuv3VE83SPQLw/QcanzPlVjskNQMOIr6sn1vGssJfZtdgmpignMblea2oZFXAiPyV1wnoE6AQ7B3WQ== 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: List-Subscribe: List-Unsubscribe: Hi all, A method to detect slub leaks by monitoring its usage in real time on the page allocation path of the slub. When the slub occupancy exceeds the user-set value, it is considered that the slub is leaking at this time, and a panic operation will be triggered immediately. Changes in v2: - Fix error that unterminated conditional directive - Avoid using #ifdef when referencing .h in .c files Changes in v1: - Add panic function when slub leaks - Add parameter description for slub_leak_panic function [1] https://lore.kernel.org/linux-mm/20240925032256.1782-1-fangzheng.zhang@unisoc.com Fangzheng Zhang (2): mm/slub: Add panic function when slub leaks Documentation: admin-guide: kernel-parameters: Add parameter description for slub_leak_panic function .../admin-guide/kernel-parameters.txt | 15 ++++ mm/Kconfig | 11 +++ mm/slub.c | 75 +++++++++++++++++++ 3 files changed, 101 insertions(+)