Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp354217rdb; Mon, 18 Sep 2023 18:24:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLItTf4pdryIhhfUjgsuZa5fTPz8+Hk6roPIanMA8j4COQRTMOZTcTUSruo4MLp0xqah3y X-Received: by 2002:a05:6a20:244f:b0:134:73f6:5832 with SMTP id t15-20020a056a20244f00b0013473f65832mr1541841pzc.16.1695086640870; Mon, 18 Sep 2023 18:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695086640; cv=none; d=google.com; s=arc-20160816; b=G7wDaiQWPv9ygID0HhvfUJMqjDKi9rZt3iuOPiCXkZaCsClvHV70HxNZ/gbl3CSNH7 DWx+7xDnQ2eLDSjkD9TSlJRR6Sk8BUfr5D5+JcwhjhxnD+d5VxCwYk9ga5qt2f+xt/K8 rPRwfhTCgyolB39vIJ16GJlN6PlU+5IX95DTzghFmfDBuksA8zFP1ARQBm5qn9CCdKcp anObvXSsqkkyJzjsPTMXy/loEPA1YMVnAkCy85ghSC65DiaO9b7nGTH39Pe7+EWE3g6g lbC7A0TyA08h/F9+hJlyHXE63QuHd+kDr475+HXbn36cSdannwyd2zeSIqjRVS3UlWcv d+lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=U/tyJ7h5gd84THXUpDn3bC5d/vZANrGk+ne6Pb/iGd0=; fh=rpLL4g2st7Q3x1xpSkE+lRycPqS41hBewA/zYxd8pHo=; b=pStu5Z0wIix833BMdbtE5sQSv+TSrNXNUN8F5eyO7nYreV7MDwcm2NWQgs7AF3ghQm lD71V87PqZi4TXi6gHu73GgYxmriHaD/odnLCMXrt0QNjUGtc1qMvA0MOdlReRCz6gvR Cf1aw6zUnLA6Ndes2Lel5F7pWRK99Udhzz7fZNUczMFMpU5NorbMxxB7P00kLh6cWo1H OVHiwSEZnA4/MtbdNwSnKLEYcgNNx4N08mbBmvFZAPCVCB1g80Le/yu1Oo2T1Lduh4do DxHKbF1ORKN74o+zwCn0JYpfTkmaGv3vGPnRDqIC0bK1eo4F0xn4Q4KB7nxpIT1rhJv9 TIzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cAuW4GUW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b00547a1922957si8769477pgd.407.2023.09.18.18.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cAuW4GUW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E00CE804C492; Mon, 18 Sep 2023 12:12:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbjIRTMw (ORCPT + 99 others); Mon, 18 Sep 2023 15:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjIRTMv (ORCPT ); Mon, 18 Sep 2023 15:12:51 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4140E10E for ; Mon, 18 Sep 2023 12:12:46 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31fe3426a61so3983770f8f.1 for ; Mon, 18 Sep 2023 12:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695064364; x=1695669164; 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=U/tyJ7h5gd84THXUpDn3bC5d/vZANrGk+ne6Pb/iGd0=; b=cAuW4GUWcHd4x7mW7b7KNA+O20crcWOgQgMHQtrm2jASiX8U9HeU/OFQN3KNMYc405 QBVf6oqwtYtepqnHGAIYuiW70JBc8PyN4qPar1pOYW1xE5QwUmnL1B7J7P+gQg6kNSJu MKy7inTs5K2YKVh/pFgNxH5UjUDgQ93OpZPYkc2CcUPINdvxVIIFlfslp1AeyITbvzmo iEy4oh339UKrUKU+4sOYqo/3sM5AoqxfkG1r3YtJ56Xl5fFsykFAPg6wFwBQ040cXA7W Blm40HN8zXwuNSdWCGXHWYt+PtuKvnApmlHRLBNAzHpWAuFJKz01uV4woRkYdSPojQCB E1Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695064364; x=1695669164; 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=U/tyJ7h5gd84THXUpDn3bC5d/vZANrGk+ne6Pb/iGd0=; b=aI0fHUvPflx37qGsBTt2vcB2Mm90N2sOgO77kR6cmanI55hsUCfVrncFkJgf/E+k2D 84j+Ic9fev4kbo7gp9KgeLHs8KFm07ZIteWEurZGazpohL4YZRXBS6/3ddb/113yqZ1j mExtXwYMN+pvjU+9IZoOHYHMEt7IGEBoD2V14zbHCjnRcaT4QSOmSD3o1lneQWTnKlET Axtmn8v04nUTIlUjNqiUOCga5f6+5oBpEqiYpc2FU+S4sFEWvR8ETMZY6evuX9fNl6cL XLWu8hjWrMp9VL/O6UNi211AxYUL9Tbh7fjjoihwrVpkHBDyCO6IxWKPiK+FO79ICO5q sabw== X-Gm-Message-State: AOJu0YxQOoZoBoqZXAGy/Tysry76qnV1Au2XLY/JrUlTShedIw5HiK4f l6KxKwWh+CGR+m28k4xJo811Ew9wF7EmYZJUsgOx7Q== X-Received: by 2002:a5d:4cc7:0:b0:319:52da:8f0b with SMTP id c7-20020a5d4cc7000000b0031952da8f0bmr8164345wrt.17.1695064364448; Mon, 18 Sep 2023 12:12:44 -0700 (PDT) MIME-Version: 1.0 References: <20230915105845.3199656-1-liushixin2@huawei.com> <20230915105845.3199656-3-liushixin2@huawei.com> In-Reply-To: <20230915105845.3199656-3-liushixin2@huawei.com> From: Yosry Ahmed Date: Mon, 18 Sep 2023 12:12:06 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] memcg: remove unused do_memsw_account in memcg1_stat_format To: Liu Shixin Cc: Andrew Morton , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Michal Hocko , Kefeng Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:12:53 -0700 (PDT) On Fri, Sep 15, 2023 at 3:05=E2=80=AFAM Liu Shixin = wrote: > > Since commit b25806dcd3d5("mm: memcontrol: deprecate swapaccounting=3D0 m= ode") > do_memsw_account() is synonymous with !cgroup_subsys_on_dfl(memory_cgrp_s= ubsys), > It always equals true in memcg1_stat_format(). Remove the unused code. > > Suggested-by: Michal Koutn=C3=BD > Signed-off-by: Liu Shixin Reviewed-by: Yosry Ahmed > --- > mm/memcontrol.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 78ea10c5a636..bb9a617be046 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -4112,8 +4112,6 @@ static void memcg1_stat_format(struct mem_cgroup *m= emcg, struct seq_buf *s) > for (i =3D 0; i < ARRAY_SIZE(memcg1_stats); i++) { > unsigned long nr; > > - if (memcg1_stats[i] =3D=3D MEMCG_SWAP && !do_memsw_accoun= t()) > - continue; > nr =3D memcg_page_state_local(memcg, memcg1_stats[i]); > seq_buf_printf(s, "%s %lu\n", memcg1_stat_names[i], > nr * memcg_page_state_unit(memcg1_stats[i])); > @@ -4136,15 +4134,12 @@ static void memcg1_stat_format(struct mem_cgroup = *memcg, struct seq_buf *s) > } > seq_buf_printf(s, "hierarchical_memory_limit %llu\n", > (u64)memory * PAGE_SIZE); > - if (do_memsw_account()) > - seq_buf_printf(s, "hierarchical_memsw_limit %llu\n", > - (u64)memsw * PAGE_SIZE); > + seq_buf_printf(s, "hierarchical_memsw_limit %llu\n", > + (u64)memsw * PAGE_SIZE); > > for (i =3D 0; i < ARRAY_SIZE(memcg1_stats); i++) { > unsigned long nr; > > - if (memcg1_stats[i] =3D=3D MEMCG_SWAP && !do_memsw_accoun= t()) > - continue; > nr =3D memcg_page_state(memcg, memcg1_stats[i]); > seq_buf_printf(s, "total_%s %llu\n", memcg1_stat_names[i]= , > (u64)nr * memcg_page_state_unit(memcg1_stats[i= ])); > -- > 2.25.1 >