Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1559603rdb; Wed, 31 Jan 2024 02:17:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/0e27Nm+SFlAle50iPJhzE6nRUyL/Imjh7YDYEa6Lr2NngXh4zip90/UX7EHhJpCjrnRP X-Received: by 2002:a05:6a20:9c8f:b0:19e:30b5:264d with SMTP id mj15-20020a056a209c8f00b0019e30b5264dmr1354895pzb.0.1706696245870; Wed, 31 Jan 2024 02:17:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706696245; cv=pass; d=google.com; s=arc-20160816; b=iighr/TscDBEbnphC7zHxMYWTW7/9jirrJVnXE9ZiCt+VlEECwnbe/bwnoXs9doosD uDATq5ygDo/UXn6czdz9ML+tNJ62VTj3h5rxInRHg3xmQzf4b/BkjsZlumarR47Tk5/2 7KdULR9MB5cxgV+gq3CFd8PLntk5x7JOerGh6Qx+wmA8Fm/6XaCxC6mZlTzmuSaZ5smo G98wyxb9ihf6FiEvbfY8JH0z29e7I3d/+MvUIdCn8eFz5JyqHpjFlTqoQH4atdULE3V/ 1sRL9rfanjaNTMa7eo+TYXhBmIHRRAN/WxByoR5kusRXSTUt/q5kjtZVOBKPfbE+bcRH vPgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=IMPYYwZxHB76e/j5S0swYN8F5bYTjsttYU8tHg1xcrU=; fh=nwUAy++dE7RiVtz0X8xL/HHYNBdxrWcQ2r8sYfNmgTc=; b=qONsw5EX3G7X5c7pRH6MsODvuoikXTO5DZri+oouLGIeUbfV1qLJp1K3OTN9+jAwn2 L/ooILWxylt8HAPEoJi6qmUizSUcuRBoMoo5snIBEzlCmJM2iTZKstUdIwD8BOJtrRjf kX4JdrHUOWJ/qUoGFb/QNL8EDbQ8orPSEaXpw2LyCHw28iKlTQRrBjofrv2uMO7qkD4J RVYfty6JKYUgdjcGI2ZIci8+MOYHuKAgjcXYrP5vj7ZfCMccbWUKBijiYLhaFzVA9uAG E8nim8VPP3JuO9PZJFtMpR+QCHIF7T7+ExkCfmFdvPv856hgTvWMNoEh4o9d0RLiDGTZ UtHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-46159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46159-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCV5C28cibaWXtEfp6se9vH5Lg3nHt3LkYyoxHytDZFZq5msofo42SqP/nB1GhprSGobkOXPCiVDrnBoNHEoduWK23oBV+a8CpGpSEd/GQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r135-20020a632b8d000000b005d8fdbbd5c4si2948543pgr.19.2024.01.31.02.17.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-46159-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46159-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 50EA5B24FD8 for ; Wed, 31 Jan 2024 09:45:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F0AF6774E; Wed, 31 Jan 2024 09:45:29 +0000 (UTC) Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55CE9651B6 for ; Wed, 31 Jan 2024 09:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706694328; cv=none; b=BLchih8/Jal/4DZIN22mI+sPHGI4rKqQgwQYqUbaiTUK2N3nKnFEv+Eh8BVsauIzGDox//hIl5ItTHeZD8HSz6LljoW/eWHE2u1BQTDFfXwa2wijw2dsQBhk+8dewFIl+LZaNh1rdyrzrvUnENyQ5zUrcHudcO/7oCqgkwybwow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706694328; c=relaxed/simple; bh=D6eznrYTizelXVC+1WiaExzhSVE5xxoSmqRhN0MH9Lk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Uc4+jVq9nFDiUJaEkNf+nVoMafU9dxDoBUOMzF7lYU05R0j9iKfb/pXly3oOqHPpDEdNnqV46zaehtWWCDsHDUH0fg19Z5ZOu0wwbIKTSqwp5XUNQYX2PmrGDQwMudpiqHYiKqtzR5gNBuu5sKxkJWfCekoGQvCw3P5ypIA0ugY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL:SHSQR01.spreadtrum.com 40V9jBE2056964 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'); } -- 2.43.0