From patchwork Mon Feb 19 03:19:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13562139 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 3DC43C48BC4 for ; Mon, 19 Feb 2024 03:20:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 823008D0003; Sun, 18 Feb 2024 22:20:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D34E8D0001; Sun, 18 Feb 2024 22:20:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69B278D0003; Sun, 18 Feb 2024 22:20:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5B7A68D0001 for ; Sun, 18 Feb 2024 22:20:56 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EA1B340208 for ; Mon, 19 Feb 2024 03:20:55 +0000 (UTC) X-FDA: 81807101670.27.CDC905A Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf06.hostedemail.com (Postfix) with ESMTP id 43F18180012 for ; Mon, 19 Feb 2024 03:20:52 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.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=1708312854; 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:in-reply-to:references:references; bh=TAXN3PtXYOjoe+UPy2mZJg/CF9SrRoL5j3Fm4QxnG7k=; b=5LdFZdhTb7K7/6Lj/EbVS4u4llADB5Xmvng4BXK4NRJnd2AzXjSxh8pyM5MlaPhsvy/XPR W0diNC32CRmc4OmQGAfuXsfRe1nLp0rs6oi4ftBLI3HL7VJj3XXoA4bIHbZKVht2bbHYvx B44wOO2sJbtTzp1Ot85xjcOWzhhpUYU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708312854; a=rsa-sha256; cv=none; b=JuPzcMLnIFfnAxSYxJjHzmoleaqYTyFSYDdwYeXR8U9ENmVH3pmQbQDsgbaVt5Vyp8uIXV 7Y0nczrrJKFYPwFa8xlmcfu6xA6e1qdaEnxo6FJY6pcKMbwNNmsCy4cXpFXBbh+x8S2Tzp Rc7g4l7PFd6EYOxB8MfePfnFHb8ONSw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com; dmarc=none Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 41J3K3ud006324; Mon, 19 Feb 2024 11:20:03 +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 4TdSSh0lVdz2KDdHY; Mon, 19 Feb 2024 11:19:32 +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; Mon, 19 Feb 2024 11:20:00 +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 , Chunyan Zhang Subject: [PATCH V2 1/2] mm/slab: Add slabreclaim flag to slabinfo Date: Mon, 19 Feb 2024 11:19:10 +0800 Message-ID: <20240219031911.10372-2-fangzheng.zhang@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240219031911.10372-1-fangzheng.zhang@unisoc.com> References: <20240219031911.10372-1-fangzheng.zhang@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.0.73.72] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 41J3K3ud006324 X-Rspamd-Queue-Id: 43F18180012 X-Rspam-User: X-Stat-Signature: a91nky1yrsxet84k1azth4r6bxe5eyqg X-Rspamd-Server: rspam03 X-HE-Tag: 1708312852-575607 X-HE-Meta: U2FsdGVkX1+xytnJA/GG/y/9WMkUpr0HCOD9T5wuw1M0PP08J2N0sUqJGQLBoWVxmoHZj46n7uxXMthB2HmHsOevJ+siNhQF8ccmey20SVnR9iOT0UPwi/jWi7pjm37PazzfwhsULobpeetJkDUawG9cQs5zdMUIrh1Dv/Up4jd+uAaFaOZnlBxCHZ/KxvUVBApd2TQYGsGEA3fkP+HeM//b/nouZ9qShrJqPuNtZa4kiW5DsQDZn6dO+/8vHM5dReLE8ZmnWl7Ry0TmEbKsIO+277Wux1pGBLYkEXGXrNXFT4+8P2wmZs41pZ2skyNRHr/8vNu39t6HflJNjXCEvmewQJ1ON8cNts/j1ZJxk+oKQpbSu0+Wg3aZP3Xorxm1JBaPnu/3ATQO87Gjx9w/AOiPz83PhLjBIJj5/0WfMeIgZ6lAL36HHEXJ99PsRC43jmIm4JDIH08VVD1xg7718JFw0OjU3uoQPh/fe1ynnSsnr94cZNDnzwicmdb8ta7d1TP9bWKTUMWJ+F7zIvVC1uUgpDnSxVqrrlGf+SDVRXT4oaEGcH4RmPfuJ8q/7XxFt1u37efnAVES9Dsat48beITbS9htHGjsjVYEc9gQFFTIDvTzQ9SgCMpuH9IWntArr/fJwd/kHQibE0vBMVIUlDH+jRLwsRellaHcxsdPteI20y3Tij4h4gxlYfyKwwzc2avbuoQX10/w5kv5ikwGcrnQ17oFSj5dFK6zRnufWyEEU6Ssh2K28jSmSEdU6j1xIdvfglMKClb8pg7xL/3apScdabSHctGJBGn423J2dlHG69ExQ4tgoqyqqDcmAWPASgbF8dPTXeHoCE9n0IpD8sFMSgaNDdDgrSpVN7jDrjPyO2JGi0YVUo+h5vc+GgR4UAgiWjdVs1E= 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: In order to enhance slab debugging, we add slabreclaim flag to slabinfo. Slab type is also an important analysis point in slabinfo for per slab, when various problems such as memory leaks or memory statistics occur. Signed-off-by: Fangzheng Zhang --- mm/slab_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 238293b1dbe1..fd865ca335ea 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1035,10 +1035,10 @@ static void print_slabinfo_header(struct seq_file *m) * Output format version, so at least we can change it * without _too_ many complaints. */ - seq_puts(m, "slabinfo - version: 2.1\n"); + seq_puts(m, "slabinfo - version: 2.2\n"); seq_puts(m, "# name "); seq_puts(m, " : tunables "); - seq_puts(m, " : slabdata "); + seq_puts(m, " : slabdata "); seq_putc(m, '\n'); } @@ -1071,8 +1071,9 @@ static void cache_show(struct kmem_cache *s, struct seq_file *m) seq_printf(m, " : tunables %4u %4u %4u", sinfo.limit, sinfo.batchcount, sinfo.shared); - seq_printf(m, " : slabdata %6lu %6lu %6lu", - sinfo.active_slabs, sinfo.num_slabs, sinfo.shared_avail); + seq_printf(m, " : slabdata %6lu %6lu %6lu %6u", + sinfo.active_slabs, sinfo.num_slabs, sinfo.shared_avail, + !!(s->flags & SLAB_RECLAIM_ACCOUNT)); slabinfo_show_stats(m, s); seq_putc(m, '\n'); }