Message ID | 20240219031911.10372-1-fangzheng.zhang@unisoc.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-70674-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1060548dyc; Sun, 18 Feb 2024 19:28:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUwxKYQkyq+SYT4HwTpZvEZS8ZuzWEI+Rc54Pz+3QWMqRh7aVmzMdRdt6DqOjMt+dNpZCZxXAxItZiVPEh+ZlpRhJVolg== X-Google-Smtp-Source: AGHT+IFqbBCXDK7fT9+cKIn6WIMX5yi/2Yym+tYxd1m0P+2hzwHBF776Vm1cFGY7coUWOrjxswPV X-Received: by 2002:a0d:db4b:0:b0:607:8306:6b0f with SMTP id d72-20020a0ddb4b000000b0060783066b0fmr9909162ywe.18.1708313291812; Sun, 18 Feb 2024 19:28:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708313291; cv=pass; d=google.com; s=arc-20160816; b=Fu5OdXsvpLeJ+slq8ag+jyNOVvePt8r7E0BsbxpeEgcFeXvAbHIvaHcWQInuTxOY3Y NaLvTfztMzzdUsDb2B9dqK2DyLcT+YYrXjC2AR4rmIH2JxekEG0DJR2eXlbeeuY48H18 tVgWfJa6v0dgZaU7sXOt+4/suyLG4Ni80sXoG8Q7abw784WBZx6zIddYr6HVFf/Fx95y HRug6G+OdFkuKFw/GTI2ONNTCIOf9jIuE1WBlMwiu/uMzN+SXZVT/2uMRKbh7szdk9/x 6qZc2bC/vCpSYNWyHf5eBARrKVuMXnkV2DyFIoFxJ9HxbZADA+gWgNeCKc9AeMvxbASn tJag== 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=vsHhc0PSIDJmUN2H1AsxMMlWt7SgQIUDPpKa/8abvhg=; fh=zPkfwF/RKpjXAd+6FOo7GH5tFJ5Aa5Jc4zvtPw/XAZc=; b=ioJk3S4SbfkPPi3BtWFpAfO6M8nKWro6drdce52XNMYGeTId5VA7SLJ6phYjYo1Pm9 VUbaCL91lvwAGsAwKsNygGtiYJ7DrqRWK2ox62hFOIIfnRPodLLKqGflZ6UWVF1/q9BH g+pj74dwXCL/zom5IdRXqCs90m0UFd2IStibbhYcWRyrdAGgvUcQIGkA6KTCb5wZCvYR D4L5WYCyPqPyspdYL8X4hiLMY6GZtIQ73ip125kgsyW5YZrpYmbUxAIb9GZusNO00HmT L/Y5adTlL84YLyyd5DOw+m+1+omXgv6pqw9F+SQGzbK+5xOvAaDd7Mc9YxRqc0meAnlM 1gdg==; 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-70674-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70674-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t11-20020a05622a148b00b0042c2f279597si863934qtx.290.2024.02.18.19.28.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 19:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70674-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-70674-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70674-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 95B7A1C211D2 for <ouuuleilei@gmail.com>; Mon, 19 Feb 2024 03:28:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C1074A3B; Mon, 19 Feb 2024 03:27:58 +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 CB1082103 for <linux-kernel@vger.kernel.org>; Mon, 19 Feb 2024 03:27:54 +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=1708313277; cv=none; b=Za5E1gJZs2yzM9Yp7lVA/EHOac+OfccqFFCmoPITh9eHzxtwoKVVXl9za9aoyHGoc7PH0REzBhFFigIxM03qvElEza4X1IwOCDsosAsrf0dDUPNHuKQJsUJZYiG4jh+uTLGrxpP/U1ZwU0uhX0FW1rmchliKeNKxJ/3UrS80F+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708313277; c=relaxed/simple; bh=r5WhQUGMY/9VKH1rt1wukmTW9vZu0Ig+mXDVnVjFgHU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=A93o2BVZRvx5CN1Q7nWJut+eIqgIOA6lwoR37a09x1YXb9WBfqO3s+xmbteS0RZl5bhw+1Hq6mJiLktgrdRoYw60fgFMf14cFfChYDi6HPoeagA/WV7hGKlwqL+PmfEKD+EkYFazRz7tEK4AaVSchUKM9pi5w3Ii/iyOnS1DDoY= 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 SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.spreadtrum.com with ESMTP id 41J3K6GF006465 for <linux-kernel@vger.kernel.org>; Mon, 19 Feb 2024 11:20:06 +0800 (+08) (envelope-from fangzheng.zhang@unisoc.com) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 41J3JlGn005483; Mon, 19 Feb 2024 11:19:47 +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 4TdSSN4KKWz2KCV0Q; Mon, 19 Feb 2024 11:19:16 +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:19:44 +0800 From: Fangzheng Zhang <fangzheng.zhang@unisoc.com> To: Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Andrew Morton <akpm@linux-foundation.org>, Vlastimil Babka <vbabka@suse.cz>, Roman Gushchin <roman.gushchin@linux.dev>, Hyeonggon Yoo <42.hyeyoo@gmail.com>, Greg KH <gregkh@linuxfoundation.org> CC: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <tkjos@google.com>, Fangzheng Zhang <fangzheng.zhang@unisoc.com>, Fangzheng Zhang <fangzheng.zhang1003@gmail.com>, Yuming Han <yuming.han@unisoc.com>, Chunyan Zhang <zhang.lyra@gmail.com> Subject: [PATCH V2 0/2] Introduce slabinfo version 2.2 Date: Mon, 19 Feb 2024 11:19:09 +0800 Message-ID: <20240219031911.10372-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 41J3JlGn005483 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791296318585907920 X-GMAIL-MSGID: 1791296318585907920 |
Series |
Introduce slabinfo version 2.2
|
|
Message
Fangzheng Zhang
Feb. 19, 2024, 3:19 a.m. UTC
Hi all, This series introduces slabinfo version 2.2 to users. In slabinfo V2.2, we added a slabreclaim column to record whether each slab pool is of reclaim type. This will be more conducive for users to obtain the type of each slabdata more intuitively than through the interface /sys/kernel/slab/$cache/reclaim_account. And we have added an example of the output result executing '> cat proc/slabinfo' in the file Documentation/filesystems/proc.rst. Changes in v2: - Modify the slabinfo version number to 2.2. - Add an example of slabinfo output and future works. Changes in v1: - Add a slabreclaim column to record type of each slab in file proc/slabinfo. [1] https://lore.kernel.org/linux-mm/20240131094442.28834-1-fangzheng.zhang@unisoc.com/ Fangzheng Zhang (2): mm/slab: Add slabreclaim flag to slabinfo Documentation: filesystems: introduce proc/slabinfo to users Documentation/filesystems/proc.rst | 33 ++++++++++++++++++++++++++++++ mm/slab_common.c | 9 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-)
Comments
On 2024/2/19 11:19, Fangzheng Zhang wrote: > Hi all, > > This series introduces slabinfo version 2.2 to users. > In slabinfo V2.2, we added a slabreclaim column to > record whether each slab pool is of reclaim type. > This will be more conducive for users to obtain > the type of each slabdata more intuitively than through > the interface /sys/kernel/slab/$cache/reclaim_account. I want to recommend a better tool: drgn[1] for these tasks, instead of changing the output format of /proc/slabinfo, which may break existing userspace tools. [1] https://drgn.readthedocs.io/en/latest/index.html# > And we have added an example of the output result > executing '> cat proc/slabinfo' in the file > Documentation/filesystems/proc.rst. > > Changes in v2: > - Modify the slabinfo version number to 2.2. > - Add an example of slabinfo output and future works. > > Changes in v1: > - Add a slabreclaim column to record type of each slab > in file proc/slabinfo. > > [1] https://lore.kernel.org/linux-mm/20240131094442.28834-1-fangzheng.zhang@unisoc.com/ > > Fangzheng Zhang (2): > mm/slab: Add slabreclaim flag to slabinfo > Documentation: filesystems: introduce proc/slabinfo to users > > Documentation/filesystems/proc.rst | 33 ++++++++++++++++++++++++++++++ > mm/slab_common.c | 9 ++++---- > 2 files changed, 38 insertions(+), 4 deletions(-) >
On Mon, Feb 19, 2024 at 7:29 PM Chengming Zhou <zhouchengming@bytedance.com> wrote: > > On 2024/2/19 11:19, Fangzheng Zhang wrote: > > Hi all, > > > > This series introduces slabinfo version 2.2 to users. > > In slabinfo V2.2, we added a slabreclaim column to > > record whether each slab pool is of reclaim type. > > This will be more conducive for users to obtain > > the type of each slabdata more intuitively than through > > the interface /sys/kernel/slab/$cache/reclaim_account. > > I want to recommend a better tool: drgn[1] for these tasks, instead of changing > the output format of /proc/slabinfo, which may break existing userspace tools. > > [1] https://drgn.readthedocs.io/en/latest/index.html# > Thank you very much for providing a new way. I have the following three questions about the new tool you provided: ---- 1. From the introduction, the tool is described as an alternative to the crash utility. Will the permission requirements have different effects when used, user or userdebug? ---- 2. The 'Helpers' chapter introduces the simple use of common.memory, but there is no output example. It involves the use of slab objects, but it also needs to provide a specific slab_cache_name, which cannot give an intuitive overall information like proc/slabinfo. I guess it is difficult to achieve direct output of slab type (reclaim or unreclaim). I don’t know, right? ---- 3. Regarding the supported versions, is it supported for both arm/arm64? I don't seem to have seen any similar instructions. Finally, I would like to express my gratitude again. This tool will be very helpful for me in other future work. > > And we have added an example of the output result > > executing '> cat proc/slabinfo' in the file > > Documentation/filesystems/proc.rst. > > > > Changes in v2: > > - Modify the slabinfo version number to 2.2. > > - Add an example of slabinfo output and future works. > > > > Changes in v1: > > - Add a slabreclaim column to record type of each slab > > in file proc/slabinfo. > > > > [1] https://lore.kernel.org/linux-mm/20240131094442.28834-1-fangzheng.zhang@unisoc.com/ > > > > Fangzheng Zhang (2): > > mm/slab: Add slabreclaim flag to slabinfo > > Documentation: filesystems: introduce proc/slabinfo to users > > > > Documentation/filesystems/proc.rst | 33 ++++++++++++++++++++++++++++++ > > mm/slab_common.c | 9 ++++---- > > 2 files changed, 38 insertions(+), 4 deletions(-) > >
On 2024/2/20 14:25, zhang fangzheng wrote: > On Mon, Feb 19, 2024 at 7:29 PM Chengming Zhou > <zhouchengming@bytedance.com> wrote: >> >> On 2024/2/19 11:19, Fangzheng Zhang wrote: >>> Hi all, >>> >>> This series introduces slabinfo version 2.2 to users. >>> In slabinfo V2.2, we added a slabreclaim column to >>> record whether each slab pool is of reclaim type. >>> This will be more conducive for users to obtain >>> the type of each slabdata more intuitively than through >>> the interface /sys/kernel/slab/$cache/reclaim_account. >> >> I want to recommend a better tool: drgn[1] for these tasks, instead of changing >> the output format of /proc/slabinfo, which may break existing userspace tools. >> >> [1] https://drgn.readthedocs.io/en/latest/index.html# >> > > Thank you very much for providing a new way. > I have the following three questions about the new tool you provided: > ---- 1. From the introduction, the tool is described as an alternative > to the crash utility. > Will the permission requirements have different effects when > used, user or userdebug? > ---- 2. The 'Helpers' chapter introduces the simple use of > common.memory, but there is no output example. > It involves the use of slab objects, but it also needs to > provide a specific slab_cache_name, > which cannot give an intuitive overall information like > proc/slabinfo. You can of course use drgn to iterate over all slabs by using the global "slab_caches" list. (All kernel space is at your hand.) > I guess it is difficult to achieve direct output of slab > type (reclaim or unreclaim). I don’t know, right? It's easy for drgn to inspect each slab's information. > ---- 3. Regarding the supported versions, is it supported for both > arm/arm64? I don't seem to have seen any similar instructions. > Finally, I would like to express my gratitude again. This tool will be > very helpful for me in other future work. Please check https://github.com/osandov/drgn for details. Thanks.