Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1602547rdb; Tue, 20 Feb 2024 00:55:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKXAWsXgsfNbPl9oBAPma+0gBPawx2t49ya0K2I/bP9IsJhreePRW8EIRmRKrN4jowbDKwMBE5Eewy1hht3sxh0R8DVK1e+RDmnvhVfw== X-Google-Smtp-Source: AGHT+IHSpYEdVSTi/iw8w1LTYqd36PAiKC3bujy+Rg1QH2cHj+b+d67PsoJ/9XDEDQNs//4Kw0Fl X-Received: by 2002:a05:6358:490e:b0:178:f482:6e56 with SMTP id w14-20020a056358490e00b00178f4826e56mr19989299rwn.12.1708419338888; Tue, 20 Feb 2024 00:55:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708419338; cv=pass; d=google.com; s=arc-20160816; b=SgrFlPHDZJ0QUWrI+DjP7ec9+1D9YtZoXisC6Brz0Paz7BLttAL8kDlfCEafmzs7/+ AsyTwHMurRcyqzn9rPhG7Fe0wEh8XtMu57CmGDQmPbLnU2y2S+dUS//3z4Hy4d8/wflT bxjynpjrUeb1aPvKE35OnsdIb55ut0fvDjgUJbct6ZmOX4x7gwCVW7G+Jcet44TH3E4a aaq5cbyFL2sVCyQ3zGBo6jIdavpar6GLBxl799Pgw20Kov2H8/IOsI2sIjXMakO8T2el 0V3UWVsxhuCytwWxUaR7Y8wuG+7h/BQazhSYKnHAwCQwBNqIF1Sl/j2qWfeymVihtYoO JWbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=t15t0QA8PUUprA9RZMeoEMSHHE4KRxpyRH362kM2s2k=; fh=to27WgUDnUaacLGTO/atKSzPJxIPGaMTdBT3/VZLk40=; b=imAcpojBu4/HkygYGn71moV3taqpZZmAftIlTk+IEXmkPJMYLLsI0H50SeG+7BND7Z /xUbVTdnNGJiP2KLEWYziZi7nJM2cmu3sr69k5AgiTEF7OlKpm6g7vp0LX9omnLs9cCE 8PYsxyvmoEv3YuCD9gLXuan6+LWZUOWIggffVJhmZXDArFm8HJG5txrtmgwnoESt3Uoc VXFlho+CYM00QlNMrdTO3OiEsVprQvNpbilnKKnlhLNPSX5m25z+E7aac0XpmnARuMl5 K6MySSIfDqG4h0JY2pCY8KGSmPg9VoYMxRR3XaBrGR3PUOsnG40y+qCniYpVbJg4TaHd gFIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KHH24exD; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-72600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e16-20020a637450000000b005e428bea40esi479945pgn.0.2024.02.20.00.55.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:55:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KHH24exD; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-72600-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 9FD01B21AB6 for ; Tue, 20 Feb 2024 08:50:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E56105F48B; Tue, 20 Feb 2024 08:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KHH24exD" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4166F5D75D for ; Tue, 20 Feb 2024 08:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419015; cv=none; b=iLlN6sxfE+g0OJFhkcs47gk5RDMknt6d7K3a6uSOSbcYd8T3FysSDbqfspjH4De9HCKEcAB0pBoJ+AlMFBz2W5VCp9x/3dZ7LLl/XjPZAVqOF+zbg75IKQOXVHaZtguepBJs8+KLLD9UVHieuytsZsu4yX7vFFgNFXFuga46xoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419015; c=relaxed/simple; bh=8wTnZeiZa5BwRGEKVPQRxlrFT+qy83N5pV5Kf9bmFtM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tW4MRBD1ATUkgVKqsPjeW80WHSRH7Com44CyD3h9AwzpafGFzY89ygiUfUR+cxN9klaOgfoUD245mP7V5ZQv4llmdyz/X3fKufL5jR/k6Wq7Kh7ch80E6awXE/Sb7EKgI5spovvd8JfnG8BN2y/14vOLIyrIWDkF2iJoa26Q0eg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KHH24exD; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5112bd13a4fso6705110e87.0 for ; Tue, 20 Feb 2024 00:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708419011; x=1709023811; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t15t0QA8PUUprA9RZMeoEMSHHE4KRxpyRH362kM2s2k=; b=KHH24exDGScJw4t0k9Dx/YF8PAOXfF1GSwVh/JqzJie5ZLS5bHHeIBvVyYCRl50FR7 265CQEu8+01TeUR59pHDzkYP3C+R//g0xTUEFZWEgWQ20uzvpPB5h+4+JuRyNZI2tYBc Z0aHfGYjWK6BvCVtbO+5cQFAKjifAKtKa5MUSc2JRD2AoBzWMS+nI3+s0xMzfcdCtBnd GIO+PAhsk8/9wqDTycgCw1G6ElOVkkbVqDEPfDe11anV89I+VYuhXySZT/WgqhryjsYh 0WUznxZqYfKb4Bwkp3fY74H9MvbqfqNKg5hsdCf5FE0UYo9LbiZ2RwicoUrzxPIONqfP rLcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419011; x=1709023811; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t15t0QA8PUUprA9RZMeoEMSHHE4KRxpyRH362kM2s2k=; b=kXv/WrvFQBAn0zqJ9RzSfjYfsFk2Il3C6DEAGm3mf/F34lR0vjEpXEcqYxpdr9k1ee 3XW3RdQBTFPFvQfT1Udahc1wyieXx2hZm9DKo/LQao5L6Bg7UvOSqdVLkdQp+MI150Nx 5L4keM+8XxMuTvGQzy3njLrDiHhsBbfo0nJG6Y84bPx0Fo21aoXqK0JpOUewO48rz2HJ qONBRuZP/mJ1+R9xkHf+k1UCV5JHKmjvUct9RQnTwVQ0suJ9obbffB9nhwO3Dw91PBda 7fk9qGXPTxC40IOtUVUS7m/EYjH6FDn39MvrL91PXQhhDBXggtEQEss7ZZOjIFCee0t1 GUEg== X-Forwarded-Encrypted: i=1; AJvYcCVivMx2olgbMPwkF/zyVp5bssTU6csUnjEPM5Men1JwCXMwl5QhG3hyRDHF0lKXbdOyEjhVh7eXfpPlohYqeMWl8DjRdsx1cHey8g+7 X-Gm-Message-State: AOJu0Yy16xEAY/wc4hyOIhzEuefMqlEjfNwa/NIFNYHOKvx1TkfHBvei R0gqaFfm1pZwVM0VRgB4/umAXfYVH2WIe5wRfQoajlS/hBDpzlJrUtTyk2c+EV8rmviiFJyYb+T HFzJUAN9cL8SKAufPnd/h+VdGRw== X-Received: by 2002:ac2:4a81:0:b0:512:bead:d1a0 with SMTP id l1-20020ac24a81000000b00512beadd1a0mr759189lfp.14.1708419011168; Tue, 20 Feb 2024 00:50:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240219031911.10372-1-fangzheng.zhang@unisoc.com> <20240219031911.10372-3-fangzheng.zhang@unisoc.com> <4591b2b3-398f-402e-b21d-55b244f05a2e@suse.cz> In-Reply-To: <4591b2b3-398f-402e-b21d-55b244f05a2e@suse.cz> From: zhang fangzheng Date: Tue, 20 Feb 2024 16:49:59 +0800 Message-ID: Subject: Re: [PATCH V2 2/2] Documentation: filesystems: introduce proc/slabinfo to users To: Vlastimil Babka Cc: Matthew Wilcox , Fangzheng Zhang , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Greg KH , linux-mm@kvack.org, linux-kernel@vger.kernel.org, tkjos@google.com, Yuming Han , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 19, 2024 at 4:09=E2=80=AFPM Vlastimil Babka wr= ote: > > On 2/19/24 07:23, zhang fangzheng wrote: > > On Mon, Feb 19, 2024 at 12:24=E2=80=AFPM Matthew Wilcox wrote: > >> > >> On Mon, Feb 19, 2024 at 11:19:11AM +0800, Fangzheng Zhang wrote: > >> > +Note, comes from the collected results in the file > >> > +/sys/kernel/slab/$cache/reclaim_account. Next, we will mark /proc/s= labinfo > >> > +as deprecated and recommend the use of either sysfs directly or > >> > +use of the "slabinfo" tool that we have been providing in linux/too= ls/mm. > >> > >> Wait, so you're going to all of the trouble of changing the format of > >> slabinfo (with the associated costs of updating every tool that curren= tly > >> parses it), only to recommend that we stop using it and start using > >> tools/mm/slabinfo instead? > >> > > Hi, > > > The initial purpose was to obtain the type of each slab through > > a simple command 'cat proc/slabinfo'. So here, my intention is not to > > update all slabinfo-related tools for the time being, but to modify > > the version number of proc/slabinfo and further display the results > > of using the command. > > I'm not sure you understand the concern. There are existing consumers of > /proc/slabinfo, that might become broken by patch 1/2. We don't even know > them all, they might not be all opensource etc. So we can't even make sur= e > all of them are updated. What can happen after patch 1/2: > - they keep working and ignore the new column (good) > - they include a version check and notice a new unsupported version and > refuse to work > - confused by the new column they start throwing error, or report wrong > stats (that's worse) > I generally understand your concerns about modifying patch 1/2. But judging from my modifications, this worry does not seem to be valid. Because the =E2=80=9C/proc/slabinfo=E2=80=9D is not used in related slabinf= o debugging tools (such as tools/mm/slabinfo), but "/sys/kernel/slab//" (in Documentation/mm/slub.rst) or "/ sys/kernel/debug/slab" (in tools/mm/slabinfo.c). Furthermore, the current modification only involves optimizing the output of proc/slabinfo, and does not modify the struct slabinfo or struct kmem_c= ache. So there is no need to adapt other modifications. > >> How about we simply do nothing? > > Agreed wrt modifying /proc/slabinfo > > > The note here means what changes will occur after > > we modify the version number of proc/slabinfo to 2.2. > > As for the replacement of tools/mm/slabinfo (that inspired > > by Christoph=E2=80=99s suggestions), it will be implemented in the next= version > > or even the later version. > > So what is your motivation for all this in the first place? You have some > monitoring tool that relies on /proc/slabinfo and want to distinguish > reclaimable caches? So you can change it to parse the /sys directories. I= s > it more work? Yes, but you only have to do that once per boot, because > unlike the object/memory stats in /proc/slabinfo, the reclaimable flag wi= ll > not change for a cache. > The situation as you mentioned is very suitable for my current needs. My original intention is just to get an intuitive slab screen through a simple =E2=80=98cat proc/slabinfo=E2=80=99 command. As for the description = " comes from the collected results in the file /sys/kernel/slab/$cache/reclaim_account" may not be appropriate. Here I want to express that the column has the same effect as traversing "/sys/kernel/slab/$ cache/reclaim_account". > Would tools/mm/slabinfo almost work for you, but you're missing something= ? > Then send patches for that in the first place. Changing /proc/slabinfo (a= nd > breaking other consumers) for a quick and easy fix with a different solut= ion > planned for the future is simply not feasible. > Using the slabinfo tool to parse /sys/kernel/slab/$cache/reclaim_account is what I think about optimizing future tools during the discussion. It will not affect the current patch 1/2, and patch 2/2 is mainly to supplement the output examples of proc/slabinfo. If the community is willing to accept it, I will only modify patch 1/2 to implement it. Thanks very much! > HTH, > Vlastimil > > > Thanks! >