Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1904842rdh; Tue, 26 Sep 2023 07:04:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+5c1ObOEEizKPnsjm0tfvcG1Uut11Bpoz1v1mhNSbahHlxpgg8Ey94uyL0mBNXTN+rbpn X-Received: by 2002:a05:6a00:3982:b0:690:ce36:8b00 with SMTP id fi2-20020a056a00398200b00690ce368b00mr11869833pfb.2.1695737052878; Tue, 26 Sep 2023 07:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695737052; cv=none; d=google.com; s=arc-20160816; b=G6N73J+c6RoTCjvJKXQOorqRVNmWUGpvtvvNgv0wHcU/rrbh4F2NciFOZQTDPCWfYE s4cwoV8QRsP9e18pj8+NxaeIQT8Kdb8sd5IeufRooFXhUjzv+zZPkc0a9+MbF1lS/qZ3 p9Vt57KQEk7XeX2VDoXNgqyg9LlOeq1FWZCcYDJH9pBDC6u9pCk4k7Zqc+fspUeiHWur jEyoNyqNOfZGjZKY+f3lRWFn2y7o8GUDVbWaVCREnaQusg+gWEZwdYK/CCRkTPiSJ8MJ y1kg/vx4dRajkrahfshbdLUGvRrqoVsWO65VnNI5TnJa/rtV1nMn2ICOuc8o43bzdxlu 67MQ== 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=j9tTw5sUAPOrchYqA3E5owwjKmHdzzHpZh+gEC9Bxy8=; fh=3T46TMNc2lUxf1hcLJHabsYVKX/cE5lsnD4QqOA9mmg=; b=R+vhRG0DLb1M8kz/6u/p3b6mZt0Cm8b3nfKBsp+LH8VgrcELEroxOweS6h474EFbrx x0SE+bTp932x+rwI8sf/zJuibu1prdM4qggF+oxxNZGiZFtL3vPDtgeCA1ZCjtOG+y6v QXfuuB1H2b+y3yGob3UoTi9SfSv3z05A+EpezoPsjTNjYqLraG64o+DzTX5W2GzmLTIs QANMvMWu0yfCIGvZgd1xtlVv/6XV0CqaICxsZ3FqwDUU3CcREXTASgQ9pGSixJClyNBD 3w+UoQeLZdrN5QD9CijnFpeUN8HyD2++8HNkuUpKPavG+TTAg4ZSkwgM5X4K85DuaN+c 3xYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=sIrkm5fn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 82-20020a630155000000b00563f4e46f7esi12212188pgb.287.2023.09.26.07.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 07:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=sIrkm5fn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id D335A8194762; Tue, 26 Sep 2023 01:23:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjIZIXh (ORCPT + 99 others); Tue, 26 Sep 2023 04:23:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233835AbjIZIXe (ORCPT ); Tue, 26 Sep 2023 04:23:34 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB72EB4 for ; Tue, 26 Sep 2023 01:23:27 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9adca291f99so998453266b.2 for ; Tue, 26 Sep 2023 01:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695716606; x=1696321406; 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=j9tTw5sUAPOrchYqA3E5owwjKmHdzzHpZh+gEC9Bxy8=; b=sIrkm5fnHq62gxdiLho0PUJxuyqiaaJhNCpRLVeRdyS3virxw6FMkSakOFNGstwHnS IJPKspbKgEjUgDLxLHFXVYyiFL/JD7ZE2yYvv7Ibl8wXqFn5uhZBsESOhUXc4ABULXRk 1PFIQIPxPFZjjiWMloZICYiMEyArrl5WDO1WMb3G5tNUe3Eogh0p4bDqNqvIaarsa8Sb tKf/UajuXwcYyjlO4N7Tm85kjCfeOJ/WDXs1+LWOD7a+p0IngBsXa0b0JX7jbS0qoHjA OQw9rcWdDar/GyM9lN9X4vssT3B20Psu6yLOKtbZ9eS8g980fenMlTfo40+Ckbb3hC14 msrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695716606; x=1696321406; 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=j9tTw5sUAPOrchYqA3E5owwjKmHdzzHpZh+gEC9Bxy8=; b=LP46Zytsly0gBmZXPMPX4YikqqmQKWpts8x8VyIp2W18bgdHPKtbvpn25U74uM4iIn WVg9Fn9Zb2PhkLreqhQYMaca7hkv1m1etLMCNDJeqPvB+oyEHzLzzWIM2I9ODN7YPn8D ZqJSBgZ2NwwZTF5u3nmOqIXjY7yC2EqmYhANanWM4z54mWVB+vfTXDGOWTu9GEYD66Kx 6sgytXmSMCBimIiWOE5ACd76ONLYS2ttvPdG++mw3bk8x7t+Aoc0jPhu/WdXSHsQt25h kT41HVq0wkLfnaSj7MPg83JO5ujuQ/NotmQDGokq09uHbV1GyDETIq9YMI5DOx81Ly/3 5DfA== X-Gm-Message-State: AOJu0Yzik9DoTw5YWu74gyNoy6lZcJjnDyl20TAIJGx/P+/DUnHy1dSU Ozj0/R/KcIfzbyY1FqXiNc0Zqx046WJbwaLvdA/t7g== X-Received: by 2002:a17:906:9d1:b0:9ad:ad5a:939b with SMTP id r17-20020a17090609d100b009adad5a939bmr7710821eje.7.1695716606170; Tue, 26 Sep 2023 01:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20230902100728.3850149-1-liushixin2@huawei.com> In-Reply-To: From: Yosry Ahmed Date: Tue, 26 Sep 2023 01:22:47 -0700 Message-ID: Subject: Re: [PATCH] mm, memcg: expose swapcache stat for memcg v1 To: Christoph Hellwig Cc: Liu Shixin , Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Kefeng Wang , Andrew Morton , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:23:51 -0700 (PDT) On Tue, Sep 26, 2023 at 12:30=E2=80=AFAM Christoph Hellwig wrote: > > On Sat, Sep 02, 2023 at 06:07:28PM +0800, Liu Shixin wrote: > > Since commit b6038942480e ("mm: memcg: add swapcache stat for memcg v2"= ) > > adds swapcache stat for the cgroup v2, it seems there is no reason to > > hide it in memcg v1. Conversely, with swapcached it is more accurate to > > evaluate the available memory for memcg. > > Why are we adding new features to the long deprecated cgroup v1? > Technically this is not a new feature, we are just exposing a stat that the kernel is already tracking (for both cgroup v1 and v2). The reason I suggested to expose this for cgroup v1 is because a recent series [1] started using this stat in the kernel to make some reclaim decisions, for both cgroup v1 and v2. Exposing the stat in v1 will make sure no one assumes the stat is only useful for v2 and break the tracking for v1 (which might cause some reclaim regressions then). [1]https://lore.kernel.org/lkml/20230915083417.3190512-1-liushixin2@huawei.= com/