From patchwork Wed Jan 31 09:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangzheng Zhang X-Patchwork-Id: 13539016 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 30C15C47DDF for ; Wed, 31 Jan 2024 09:45:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A714D6B0082; Wed, 31 Jan 2024 04:45:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A20F86B0083; Wed, 31 Jan 2024 04:45:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EAC36B0085; Wed, 31 Jan 2024 04:45:50 -0500 (EST) 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 7C4026B0082 for ; Wed, 31 Jan 2024 04:45:50 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4AFCB1C0F8E for ; Wed, 31 Jan 2024 09:45:50 +0000 (UTC) X-FDA: 81739124460.16.9BE4941 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf08.hostedemail.com (Postfix) with ESMTP id 6B24E16001C for ; Wed, 31 Jan 2024 09:45:47 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706694348; 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=IMPYYwZxHB76e/j5S0swYN8F5bYTjsttYU8tHg1xcrU=; b=uOHeC485vYszu9kcI/3r7I9b2wX2x2lcTx7cENiIZnW845rY+ielB+Ktk9bgk1YOq1uq6P aQ1CKvRJBoDm8SVBgKTr5mab7Kkh8LFHcAI96du4xHIABJsbwdf2lBlAkZx3cXOeqmnQh+ KrAgX2JdaerHQ5pK4H1Qgofx3w3i42Y= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of fangzheng.zhang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=fangzheng.zhang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706694348; a=rsa-sha256; cv=none; b=wS7eV9MzAPjkl+3gTEzD1Rz+lKg8Nl+lXEcAtBuAcPsKXEC4OmxKxB9pTcq3jAtPebiruz tIlOWE0anrOT2VzmKcw5pK58nwqbyYvXIDqx3X2HfLVXrOlfmEVQE5deAiSgQKHWqtW/QC dp8DriH2W6DrcpTJCCpmOqyzgrppmK0= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 40V9jBE2056964; Wed, 31 Jan 2024 17:45: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 4TPxlf3hQNz2SBJpV; Wed, 31 Jan 2024 17:37:34 +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, 31 Jan 2024 17:45: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> CC: , , Fangzheng Zhang , Fangzheng Zhang , Yuming Han , Chunyan Zhang Subject: [PATCH] mm/slab: Add slabreclaim flag to slabinfo Date: Wed, 31 Jan 2024 17:44:42 +0800 Message-ID: <20240131094442.28834-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 40V9jBE2056964 X-Rspamd-Queue-Id: 6B24E16001C X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: pyezgeemdfy5npbmz9gq53w8cimc1jbc X-HE-Tag: 1706694347-278523 X-HE-Meta: U2FsdGVkX1/wP/WxQsm7cmBmce2RV2TNa8ohGrfBEQxoCURhZ/bbyYdmxvWc/LTAN38Tli5m3eXCDXSK7mUw8R2sgJjBaKhJXwtJwdx7ccC6UnUCqFc05bQwwVGM076kg+jgtoAjas0u9tzJ8Ggnratwqzld87fZwVvOtNO8PACAflODZ5i4nnCho1WqLS0KOnUAx+uX6QhzR8td6gbnp2xnpDjOPhUjtWQoCbGYQaXLIjD/+wqF51/1jKjnULo0arDg7mDYZuVAXSF/3KdZ3+9F+x4GRjWRj8Vd7Y1KnF3gYJI9hdKEv0PxNTxgg0RIqO/7ZoypfcxvLlNLCYPR9SdGfdu+T0wCaFLhmYod9Ah1ByPND4nmOM5AMFQMMZE3eFw//7HXsr5Z/Mfyto3OkTyPzhHN4yf0Gznes5ylsEaKYbcZs44dg/VSA7lL0ClEnWdrb2jMzaN/IrIj2//kfbIm1V8ZKDDlFk+fpqWMxPHaofEXu61iwu6iSDFp029E52hO1flCLnJgNtInFP/pRlrWOnhXotrplssTjHSdAcnS5z2JafoZdqjHe63934ChUGHLIsCVge6d1qmk/aid++W+lwMguL4tw6iOJZt7TWifsmBo2WTD4ViZMctrTGugJCe79WNkOFJtfdba4Uz+F6+OfRM/KbmL8mc3CH/BeHXP2nvgCxWA3a9hz6A4DViUGEJO913GnZNzJYUwE1HEVJu4xdzloOyTXu+ceXbBHgTGjqFEHYA3vN4/a+MC7ICHnJvhFqx/wqu2InyHimM6P3LChiWmTho69SqzypdeT2mq46QIwYf0MJciy9Scd5CWsfb9dnu4nRAHq2cZXv70IzRxfSN6+NoT6tUTBYh+llow1luRPwiSSDcptS90WL6W7Swuc6hoD6XiplhX6fgqUG6PGEKD83pC2YpCL5H/IMa86ADLRRL2FfW5dWlhkWiqpVGYR3ID601w5jjgFOc vFZE/+SP 0QKGUeS4byYea/oaJbaZkhtGrCvZEVEvWrcYQlpClsEiFN4D33+dCLoDrF/tX145PDWF9A1Xr3iMlijWsKpdbH5IQRe/Fg7ioLF6aPKRc9EJxNAHVJsfOuPc/7OEtaTtwmHaTGjuga+KBP8bSPoD0KEbkDwmYlQB6mn2kvmLuaM3G9E+napaVlwobdXl0Nd1KRwjgDIj4y3PsXOOhw5V9BTO21J5IEvmr4m6+gs8oKcXJ9tdR8wsJLv+CHeFgGfC3E4ddvhI1fVeQLac= 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 238293b1dbe1..aeeb2bfe6dda 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1038,7 +1038,7 @@ static void print_slabinfo_header(struct seq_file *m) seq_puts(m, "slabinfo - version: 2.1\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'); }