From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63170C433EF for ; Fri, 3 Jun 2022 15:38:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAC4C6B0071; Fri, 3 Jun 2022 11:38:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C58258D0002; Fri, 3 Jun 2022 11:38:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD5668D0001; Fri, 3 Jun 2022 11:38:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 96D8B6B0071 for ; Fri, 3 Jun 2022 11:38:20 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 73020121519 for ; Fri, 3 Jun 2022 15:38:20 +0000 (UTC) X-FDA: 79537331160.17.406482F Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf28.hostedemail.com (Postfix) with ESMTP id D8B46C000F for ; Fri, 3 Jun 2022 15:37:38 +0000 (UTC) Received: by mail-qv1-f47.google.com with SMTP id b11so5830159qvv.4 for ; Fri, 03 Jun 2022 08:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SJXhCrUR8OTVpnLcTOK6eseLDr1ev0Qsg1uNsb9nbv8=; b=Q3903lNQQOni7+M4c5ncDu0HLSUQTxvb297A868WBL3HKMBPQ9Vxh/IhIjiQX1r4Mf oyPtz/NaYgx9vPorrhxthWs8nTd6jQem8/d8QfACSCYmw293IQT2yN0P/EWNdgruyhFq lyiiTi+D0Udva2DO+r+itdpjfySDS4zPtxkSO5vNvipNuYnCsF7uECI0JMrsC4i6qpjG t5X6fC3832TP1X39Rj60D7oR6+/p9kggMlLea+C5PdyeOkXxzW274DDdPpsUZo82YHIa JFFvkH1sXQQxu2WphhiDNw8+u+F7dY6Bqc6KZ4bckG21U9BdPPBK7xWAyUe2m3/sxgjq f53g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SJXhCrUR8OTVpnLcTOK6eseLDr1ev0Qsg1uNsb9nbv8=; b=kPY0qiNQWxVsp8FAcWdCbvcnYZ3xCWwTIVvxxMHdAosu6bMXqNAF06iibbjrCc34vS uGtQtbi9V5RY25WsTRaoBRS9J2Bi5ct8VHNxHIMwtW89ZV+UN7MTPWHSH0/GnApjebDQ oNawXqODwL0pvkYcwG0uRaalUdZ3N00Rz1hn9OuY8t8Neww1mBRdov77ZZUbZQ2KrqBg JL/oS6GFwIzJVNV7mdMlRrENzxFt2ORuXCH56jygOWELkNtywtYUw6Dt+h0BA4tcagHH Q0LKayUzkuZceIrDrT+0I+vZdC1q+SoQUhw5EKPGJTtWP3NmhS9aEp994uUWKmYBLvdU GFvw== X-Gm-Message-State: AOAM5328OCn1ZzGG9M87IwDSHcAEOElGjbFY126MVRgCntVE9vvNXsQs GK1TOVBRjw9JUdsm8O3XDDG2NA== X-Google-Smtp-Source: ABdhPJxdZQ9/SUfZZTAwPP0SSmcim7n4j2UV2gr4nbRDnef4WqhMGWV2G4k+wJYZM/q3KcMDiuC8dg== X-Received: by 2002:a0c:df8c:0:b0:465:d376:1ec0 with SMTP id w12-20020a0cdf8c000000b00465d3761ec0mr7369798qvl.97.1654270698608; Fri, 03 Jun 2022 08:38:18 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:1d66]) by smtp.gmail.com with ESMTPSA id y184-20020a37afc1000000b0069fc13ce225sm5204351qke.86.2022.06.03.08.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 08:38:17 -0700 (PDT) Date: Fri, 3 Jun 2022 11:38:16 -0400 From: Johannes Weiner To: Qi Zheng Cc: mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, songmuchun@bytedance.com, akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH] mm: memcontrol: separate {pgscan,pgsteal}_{kswapd,direct} items in memory.stat of cgroup v2 Message-ID: References: <20220603070423.10025-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220603070423.10025-1-zhengqi.arch@bytedance.com> X-Stat-Signature: e87eo89jo6nanrf9tdw599oo7ptxoupd Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=Q3903lNQ; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf28.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.47 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D8B46C000F X-HE-Tag: 1654270658-830273 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 03, 2022 at 03:04:23PM +0800, Qi Zheng wrote: > There are already statistics of {pgscan,pgsteal}_kswapd and > {pgscan,pgsteal}_direct of memcg event here, but now the sum > of the two is displayed in memory.stat of cgroup v2. > > In order to obtain more accurate information during monitoring > and debugging, and to align with the display in /proc/vmstat, > it better to display {pgscan,pgsteal}_kswapd and > {pgscan,pgsteal}_direct separately. > > Moreover, after this modification, all memcg events can be > printed with a combination of vm_event_name() and memcg_events(). > This allows us to create an array to traverse and print, which > reduces redundant seq_buf_printf() codes. > > Signed-off-by: Qi Zheng Sounds good to me. We inititally didn't do it because /proc/vmstat has the breakdown to understand global reclaim behavior, and cgroup reclaim doesn't have a kswapd. But it's nice to stay consistent, it's helpful to understand if certain cgroups have a higher share of direct global reclaim (GFP_TRANSHUGE* for example), and we very much do want kswapd per cgroup down the line (we've had it in production for ages). Acked-by: Johannes Weiner