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: 202889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1058559dyc; Sun, 18 Feb 2024 19:20:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSQTOudRqEqeGrXkpN9MSbig4Xpf0eOddYUBAeVYxAbFX0jm5rTP5pgItc3xBmbwsAkRpMG3q1o5Ca+OrqY/88Zr6gNQ== X-Google-Smtp-Source: AGHT+IFQg9tdc++ytp9ND3jokUZr1rbv4iGMkVkSz7rSo7dBd07E03r78/xdiMT9q4caPniUhE+s X-Received: by 2002:a2e:9792:0:b0:2d0:f872:6f16 with SMTP id y18-20020a2e9792000000b002d0f8726f16mr7133765lji.16.1708312839459; Sun, 18 Feb 2024 19:20:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708312839; cv=pass; d=google.com; s=arc-20160816; b=e+LnGgBivA34xj+IfulvG5vXaPjG2eeNidsunzLcbsy6MbQETdMi5OLE4ZBh5CnJHY uBcG2MX/Ahs4h7qLWb6NEyesED3Nl3SJDy6OqwFUWIHmqWK5AxuBjDAa25aJf5VRWixn micUXXdpK0PJO9H4BCDZPJGz19MXQo1MrCzyf0DdKDqeR4wzbY7HWXlHeoV65IfP5doA cdk7LMVYkOL3DF0mVsXXBFil5UJs2+tALzBQZTjCRpiNj1U2EWGJBD1euYwkBEefa0Yh RvBWuIqS++NXp9ejFeNPHiutKt7FXiw193X9OAb9TscTPP2NmoNU45iQiM+gGuB5+CFC rUSg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TAXN3PtXYOjoe+UPy2mZJg/CF9SrRoL5j3Fm4QxnG7k=; fh=zPkfwF/RKpjXAd+6FOo7GH5tFJ5Aa5Jc4zvtPw/XAZc=; b=lez1P+UoCdEYj0RwpiPROcR84QG5eiQ53VDcE8DyjGudungQkuhkMp5CLnqcila69Y OaaPkxKPHZ8e+Y97O7w73oe2F3THYz7wtriKRzFU2JhtgOE95PtQb3HySigV7FtLhMVu 6ZunbkSRnu83Amv8B5ZCqEtNTzKmfjLkyTzSGGb5WDXUDhgoaewZZd3i/X/EKmygL2Md IE8Ch8o++iORoeg6v3j9kwtrTu0lc5EqGZ1b/DzH9OAim+nXCa6Qu8OMbGqEtLuhfP5o b9f2E/gGi8PnOYpVQpvF1g7wGwkyTC+XVkATO2rkdG/b08sUJ5xDnZgN9n+X5T6DInHo ne0A==; 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-70672-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70672-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dh6-20020a0564021d2600b00563eb937926si1974668edb.499.2024.02.18.19.20.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 19:20:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70672-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-70672-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70672-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 123AA1F2152B for ; Mon, 19 Feb 2024 03:20:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1303E4A3B; Mon, 19 Feb 2024 03:20:26 +0000 (UTC) Received: from SHSQR01.spreadtrum.com (unknown [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 362012103 for ; Mon, 19 Feb 2024 03:20:19 +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=1708312824; cv=none; b=J8ASHQ6cjD9vn+QLwLd2IEg9QJ+yIuWpw394jxHnL8WgbFum1T4ye2Oot9mSl6D7UAn8/WldIL2xcfaYii2FO4NHqk7n1IbupChbAddPm6RWsxMgPQmLdkG4O5wKRzHjIx2+a4HobwSYPTZPjoGyKRvGDEgJRJtZ81+3jgueea8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708312824; c=relaxed/simple; bh=Z+7vse2oVEMZGzwQc87EL46uYY5WpATXZyWpKmqnc5w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VqwH1mfl60iqfx4GQioBWL+PZjwSLJrRr/JLgyDt2XttlS/u4ZBrfRBzTz2h3lvLW8oMpNbLgONc4owUcZykh4COBCKB0frTltD2I3zKTzFImVDyvSystRo6Xv9QnuD+WAKwMh229hYCcrj2L9nyS18SUIXPqnbzFU+c5DwZxPA= 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 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 41J3K3ud006324 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791295844100851550 X-GMAIL-MSGID: 1791295844100851550 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'); }