From patchwork Tue Aug 15 12:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjiang Tu X-Patchwork-Id: 13353761 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 DABCCC04A94 for ; Tue, 15 Aug 2023 11:58:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 084408D000D; Tue, 15 Aug 2023 07:58:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 037A28D0008; Tue, 15 Aug 2023 07:58:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C93B38D000D; Tue, 15 Aug 2023 07:58:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B786A8D0008 for ; Tue, 15 Aug 2023 07:58:02 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 743BA1A0C04 for ; Tue, 15 Aug 2023 11:58:02 +0000 (UTC) X-FDA: 81126190404.16.95400D3 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf26.hostedemail.com (Postfix) with ESMTP id 197A414001A for ; Tue, 15 Aug 2023 11:57:59 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of tujinjiang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=tujinjiang@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=1692100680; 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:in-reply-to:references:references; bh=TwVJ+gorvMrP60gLsXPGEKAmOkjMLywUTPVCX7Om7sU=; b=wN68L5GaTU2OKrQfAgDCmIE5SQrk7X1IsgjtzlfD2VyVAB8u/okVDFwlYbEGXiXUmeB+QQ iLxI5b3b7vC6sJ8u86Quifkb70RNTr9Mo6bVwzB+krT2bsww+Hk68UwlZtwtelGezakzuS fdcoAK+r+Ypxf//Gd2umZV15nyZK/Qc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692100680; a=rsa-sha256; cv=none; b=eOQcfEjwygZYhRDjbw3roLJMDL3vDgFm7/idDTnb5LTXp6wQ5TtnZRLE5UL+LvthcweG7p X3rXML/R9D3YBOi6Bu1pSyMAC+rtLIdeCuAfE5qh/QyDeFMI5OJRttbJfCFY8UEanCaU8h d1+Ospg+P/IfXR8H2PeJjBLYz30w4XA= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of tujinjiang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=tujinjiang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpeml500011.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RQ8q96v19zVk1s; Tue, 15 Aug 2023 19:55:49 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 15 Aug 2023 19:57:53 +0800 From: Jinjiang Tu To: , , , , CC: Subject: [PATCH 6/6] Documentation: update document for page_owner Date: Tue, 15 Aug 2023 20:52:51 +0800 Message-ID: <20230815125251.2865852-7-tujinjiang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230815125251.2865852-1-tujinjiang@huawei.com> References: <20230815125251.2865852-1-tujinjiang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500011.china.huawei.com (7.185.36.84) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 197A414001A X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: u7brgc64kr368j5p1xqdwbfsazuyeu6r X-HE-Tag: 1692100679-267926 X-HE-Meta: U2FsdGVkX1/UGO5ZLBuFnTiQhKxdFsPJTUCSU1czGWGEjLvNxb3a/NuefxD43fqVkMKtn7+7bUrLgKpIfPWArmWFrupEVMFucErSvml1Q8sL1srAsfA4xtdofIkYdONq+bdDT+OrSRc9ipHWcOL+FFBc0la5agHi2Eeu+01NS5hcJVpOlKMC1ScpK3kZDYuWCR5/8d8sJHSU+asSppIb+9lUZlpc36sN9c3zslVs5s9GssOEZKZ3nhb5Qo1ssc9uoL81twvT/R2IsEirGmC+A+UK2nopAUyDpl2mX//rK9F4KaZsrFefpxF3IKZC+4QW/L62IOrQBELVMC8S8xs7psl2MqPTwYgiSAuAaAdsSg4F9BIaTeKSNVY75gcKjtoi1RSy5rtN0wuHagCw1hJEpzyWbVX7/RQoag0LpwE9ja4JkmNrl9DjwsuXlru29ktd1glvyLeBKQRHUhBWsds69RynMeTtWDdbqtms6IA2LBkTbG/LVKtdMTY9czXRN6VOdD6gg2MBpo79/T4WY+246scT1Thdcf/iRuwsbuVC7S5gqiBxz4zX8iCzcu+WEvJNs5+d7Msy8VNs1gAiU7OFhKiPqEEVO7+vpKDJk/BK81GnRhDSzB41sOLzRqP+a4g3Ga8DBug243UKk580epRFjU1uvm+KpbcznatloN3U8OeS6rem7Cez/+xKijGDaZP/r8YP1QIXkfaZbEr7W5sRQ2z8a1kIou9yElgTCXIudAEJ85NDCi8qqFRvDxa9WKlCAUCj5IhG2UMfw2ymfGuBFW7fof3kvYJ/Z5lerRkqZdTKVTL6ly49xnsQC4rCgb6MZmwILY45IwLZjo742C3urbN9BPifuX3yPU3LpayH0SbTSMpZnQ/H9LoLwWjr9faSokOsfP6Qdk0++FG+WXCAannofVwKvi0TZgkYZ/m/D+P1Aij5sZJQ9zxF1z1/8bnhOoFplp/mu+PWIMo8cxX u0JrK6GY GT/+3WgeiQduFUUoI3RqCNZiT8OeYl7SAsdYPzMiS6ptjzqKIIAwz+c+xYvjW41m0drOxfknQ6H39zok2GDQjKXIGeq7FDoEmkY6F/W4b4leSIK87UVQRpixY2eBn008dgFESBSdf8MnD4vm0lSSdembQYFeMMxQ9zezvj5jnf2eVgxptox2MfnpkUf3MqZvxsZ1zc4ygf5WMNzmAdEBoXqClqrOsicKXAI6X 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: page_owner currently supports recording and filtering pages allocates/freed by modules. Also, page_owner supports dumping name and the nr of pages allocated for each module when oom occurs. Update the document for the new features. Signed-off-by: Jinjiang Tu --- Documentation/mm/page_owner.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/mm/page_owner.rst b/Documentation/mm/page_owner.rst index 62e3f7ab23cc..2231c16cd993 100644 --- a/Documentation/mm/page_owner.rst +++ b/Documentation/mm/page_owner.rst @@ -54,6 +54,12 @@ are caught and marked, although they are mostly allocated from struct page extension feature. Anyway, after that, no page is left in un-tracking state. +page owner is able to track if the pages are allocated by modules. If a page +is allocated by a module, the information dumped from page_owner interface +will show the module name. Users can use the user-space helper to analyze the +allocation situation of modules. Besides, the modules that allocate pages will +be dumped when oom occurs. + Usage ===== @@ -142,6 +148,7 @@ Usage Filter: -f Filter out the information of blocks whose memory has been released. + -M Filter out the information of blocks whose memory isn't allocated by modules. Select: --pid Select by pid. This selects the blocks whose process ID @@ -150,8 +157,10 @@ Usage group ID numbers appear in . --name Select by task command name. This selects the blocks whose task command name appear in . + --module Select by module. This selects the information of blocks whose + memory is allocated by modules appear in . - , , are single arguments in the form of a comma-separated list, + , , , are single arguments in the form of a comma-separated list, which offers a way to specify individual selecting rules. @@ -175,6 +184,7 @@ STANDARD FORMAT SPECIFIERS ft free_ts timestamp of the page when it was released at alloc_ts timestamp of the page when it was allocated ator allocator memory allocator for pages + mod module the name of the module that the page is allocated by For --cull option: @@ -185,3 +195,4 @@ STANDARD FORMAT SPECIFIERS f free whether the page has been released or not st stacktrace stack trace of the page allocation ator allocator memory allocator for pages + mod module the name of the module that the page is allocated by