Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2911250rdb; Tue, 6 Feb 2024 01:09:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYVydu3YdDtMuklrOvRBsWDIe9AAW/b0PsnHAxVf09qxDGWd+L5iWSrxW25SssuFmIy+kv X-Received: by 2002:ac8:7fcd:0:b0:42c:385c:3d70 with SMTP id b13-20020ac87fcd000000b0042c385c3d70mr565125qtk.66.1707210554349; Tue, 06 Feb 2024 01:09:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707210554; cv=pass; d=google.com; s=arc-20160816; b=GvHui0dlMdqe1kZ5UGIZv6IsIcMeTuerRNwbmmGLprP8Pmbu5a/CWmxlhqh+GsoqFI NUCfPU+Seq4tpXewITCwWQuHFFlU/sGMDNg2ZZ1pGutNfdOAPgQoPRvdOL/Hpe3+M5jO gXQMZNQ+MKz4u3gqoJyvg3kae3hPQphEANZfiR8WqnNCWYuSgNruiiR5jyR/rT3xk/oQ i+vRd73pk7A0sfRdi7l+fETsi8YHAKln77M5gto++g63FxznggBC30Ral0k2/t0koKNZ SzMDhGhdyYl+bRiaccchOqZUogRLurPTpAMl56PK7nrz50YsW0VF+7SKPgCRkhaqdO7P K1FQ== 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=n3bYfjQv3EOlzlAH6SnTprc6MRzkybq6MP8ULvKh3QU=; fh=7kZYZXmQC2zS9KF/3NYQzZSJCmQ+F0KwseJPysdA1H4=; b=Dv7UXzmCty7b6ykOeYjuXfxzzEegePmCTnRD74+MnwlhByNMa/d3y0NlFd08Q3s1lE r7eXKa6qMMxnpSGnBDl4Bm9V+OhdTRY0UktlX0PKXLcos9D1S9SVGidii5+b+pYcTqIr WLLIVYIXt6m8DnAvAeUTrboQvaBBhV1raSup6XW9zGWL0xCP8kExfhNAFEqUB0g012iu oJWUfKUGeWl1LvAcTJI8ttK0qpEhOpnxci9en6WjKRMni6ntljt3xMof+gP04n5/nrUT VlzeOzY+t0H0+KGwrScvYXZIrtnpH9Hd93ZsLkNxAHzpWfoRZ0bYrnP4eu6P37Mr2GLF QwZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BrJhd4B6; 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-54565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54565-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCW1E0/065MPAvOpRkSUdtSgrSWNwju2xkKbzGihCrpqOriuCz2isRAIRKnuBevAy4kwJhclIq1Rq/ZQvplfdlbM0lysBSwKHFaDS2O4jg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p6-20020a05622a00c600b0042beb9dfae1si1963973qtw.35.2024.02.06.01.09.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:09:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BrJhd4B6; 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-54565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54565-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 218981C235BB for ; Tue, 6 Feb 2024 09:09:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96E0F12C81F; Tue, 6 Feb 2024 09:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BrJhd4B6" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 E241F12CD85 for ; Tue, 6 Feb 2024 09:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707210548; cv=none; b=WVYDXmfUOVSMpN9J73PsI6tyrE3ZMZG3+UyQFtSRdKFGsQcN5/rpMc69CiM7kuKzc3A1Ga20o1RRd29hcgl9awpG4k0qq55eHlfeDLtDRORSMBWMDO8ByD8/O3932RfI2S6qaDGyFNYYb6vTK1CPojLbELZh+ayS2ws2+gV097g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707210548; c=relaxed/simple; bh=JfmFBJ8uFPBab88o46myXeib2a4j3O4syxAhuZFSsrk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JE262XZoWmtRNAXEbCJhSZ6N4KuALPMMrGBXOe0PzkDr1xUMuDwjQZaQHw8zRbeYg2nrLA4XeMvYrIcAJwyd1VaqIZm9/69Rhjv035LDEnEZ7yKVsOowAFTgrZDVzaM8NENvnzoa0B1I1/lGwm1AaeFfDSZ61Ja3droNxdOj9TE= 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=BrJhd4B6; arc=none smtp.client-ip=209.85.208.181 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-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d090c83d45so39847651fa.3 for ; Tue, 06 Feb 2024 01:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707210545; x=1707815345; 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=n3bYfjQv3EOlzlAH6SnTprc6MRzkybq6MP8ULvKh3QU=; b=BrJhd4B6Fkz8rjzkl8S5hR2NDsMMz3NPOeRwIFdmqKZxn6AHg7DM9XBGXpspIgJO1h DkDfIuPTeZqkuVl5Jha3nE/U7CU4ZU/txyAWhrkpBi92x22FRN3B6LsEMWzLWrB2WM5k zR1JNaWdFQu9/31w3DSD5ebtxeOevPmJq5PGa/ei+XEpO1B4hadqIcw2hYp+Ry7ers2Z 4Se5FJw9QnWcBf2QyTi/dZgGx0kHqjFlwP9Plooa/DmumtiZNMJHOmbWlp9OZUIF10CF FWUd3dCJXzNP+btqIVP7V1Xm/cjWtWNSI3uQu4p3+JhXnSfqFAQv7xttDigHI01Y95rQ p3cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707210545; x=1707815345; 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=n3bYfjQv3EOlzlAH6SnTprc6MRzkybq6MP8ULvKh3QU=; b=rP4btxhh7KGxI2wghn8fXvP94HFO84zyaSOFx/gv38H9mM7YTyUxTG7UrbC6pH1pF9 k5iJfVvvBkZs051Edf/WuynbICrlIZuFrUQhJjQEkcgtrGTW71ZVbQcAay3VeiL4rMfc M2USsCcH4/ZjLoBnA8d7YRLFj/vyXm5Ghlk6i2ND+hc6dcPW7c0bsmNK6nfprWEO0EKt woE74q/xXT7LZejWahqIB7dmyFmxGVTlapYOIS5HdFhHJ6OGSflCNiIBiFOPTrrPEabV n9YX9IOKpG0d935IRkMFdQWZeXhAxuXYrZZ+o1a+qBHDtoP4raKcq5p8ioJULItoVT4+ MMaw== X-Gm-Message-State: AOJu0YyfWHtX5d0QC3KFsW8+7YpOd5jY+eJUKIZa/xHQshSrhEtuOouF Gabdx3dCYrdlaqejep5w0gQcz3CpQWoGLb90+3fYQQvU6fablifT2wsAS0oGHr0R2KEloxliwGa 8pmYSuzSxbNDh1mdLWzlLQPKunQ== X-Received: by 2002:a2e:9d05:0:b0:2d0:9cbf:f389 with SMTP id t5-20020a2e9d05000000b002d09cbff389mr1491170lji.26.1707210544507; Tue, 06 Feb 2024 01:09:04 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240131094442.28834-1-fangzheng.zhang@unisoc.com> <2024020441-version-chihuahua-1067@gregkh> <2f43774a-16cf-412e-b4b7-840889bb796b@suse.cz> In-Reply-To: <2f43774a-16cf-412e-b4b7-840889bb796b@suse.cz> From: zhang fangzheng Date: Tue, 6 Feb 2024 17:08:53 +0800 Message-ID: Subject: Re: [PATCH] mm/slab: Add slabreclaim flag to slabinfo To: Vlastimil Babka Cc: Greg KH , Fangzheng Zhang , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yuming Han , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 5, 2024 at 4:50=E2=80=AFPM Vlastimil Babka wro= te: > > On 2/4/24 14:09, Greg KH wrote: > > On Wed, Jan 31, 2024 at 05:44:42PM +0800, Fangzheng Zhang wrote: > >> 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_fil= e *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 = "); > > > > Doesn't this change the slabinfo version number above? Where is this > > change documented so that userspace knows about it? > Ok, I will modify the slabinfo version number to 2.2 and I find that there is no corresponding slabinfo output example in the proc.rst document. Can we add an output example so that user space knows about it? > Yeah I was vary about this. Do the other longer-time-than-me slab > maintainers recall how we handled this in the past? > Also the information is already available, even if harder to gather, in t= he > file /sys/kernel/slab/$cache/reclaim_account > First of all, thank you very much for your comments. I would like to say, when performing slab memory information maintenance, people often hope to see more detailed information through a simple slabinfo command. As you mentioned the method, but it is very unintuitive to the status of the entire slab, so we add the slabreclaim column to slabinfo and directly output it using cmdline ' > cat proc/slabinfo'. And I think this approach will also be helpful for future work on memory statistics. > > thanks, > > > > greg k-h > Thanks.