Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp594070rwd; Wed, 14 Jun 2023 22:20:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vuqhB2ay1DjVFFu/nQmE/oOtqviUJWn6qZtfY0vmDuWbOWi1GaKtwY0Ls9HH5M3vlJKgy X-Received: by 2002:a17:90a:7386:b0:25e:7ead:3c9 with SMTP id j6-20020a17090a738600b0025e7ead03c9mr2532282pjg.19.1686806405478; Wed, 14 Jun 2023 22:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686806405; cv=none; d=google.com; s=arc-20160816; b=jrplQGVYjT0OsdozI7XqiRgsXoqrr+OSu25lelYqZl0Hznmzmhumh1K27VmiFr2shC C60s4HM3UIVYGZ4TH7tToFmr7Q38m0sBDlHmd5Z7GhRF54b5beRzBYub2gMzB3O4VjuJ U31J3kVfDxHDieSmNMYmxcoQj2ob/i3VFCe0Uys1SCY7nN089guGlAbt3fFFqPwCbK7p tj1F0FpKqVe+RUdCLadFf3xUd9Nk/7qfdGEOk842iSQ0AVlMcyoaKvuyNipHXthkd2lr AXl9ynr2q0Fgeh3ZAN+cXmZiQMwQckZEhndpAR04NDqfgaa5lty2yDP2mvfsiW1l3xJA sQUw== 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=KnSTeR3wugqfczOIo0WVbaWFbXtLzRyoPYMenUB46Z0=; b=Y8X2PWXrQuNFKVZpd/XmW6CBO03LEiNpX/FFujuWbzAQ6wyc29EpTZCIQAUOAIWr2b vPPeBZYAUS9kCfm7GjIBHUnQh5xeYgRJ4bmWdQr4+nSvWML3HTTFZ3yHp7yDaQQgqSUG BGfUFYDyJWGeCqYdt/t2cY0CJ8JzcVw99nPynaGhFR54Ce+WuX+riLlvAwiCb2ChaF06 a0Yp+M73EO5EZLDMA4TMMTpyIVlGBtv3tkqzv2ztxjTjsA+Ca0gfInR20bfY5HemPEsK uNBu1PTADBQa3sBNkM1xHanYJfjmJTrfYWe1qu8AkmXWb2V72M5rmeSbr4ANjO2xllSY bqNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=5OjI0opU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np15-20020a17090b4c4f00b0025bf2858c1dsi6981956pjb.106.2023.06.14.22.19.52; Wed, 14 Jun 2023 22:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=5OjI0opU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236887AbjFOE76 (ORCPT + 99 others); Thu, 15 Jun 2023 00:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243103AbjFOE7x (ORCPT ); Thu, 15 Jun 2023 00:59:53 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB0BF2103 for ; Wed, 14 Jun 2023 21:59:52 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-3f9b7de94e7so144621cf.0 for ; Wed, 14 Jun 2023 21:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686805192; x=1689397192; 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=KnSTeR3wugqfczOIo0WVbaWFbXtLzRyoPYMenUB46Z0=; b=5OjI0opU3eK26QBayVjzyad7e3zQbSFETTyJ8gesBTqvWCouRMUcqWOb9hmlwB+hG0 jPD7ZGihijI+AMvu2gP/fe4g8lh9DmonCbi3qwKm5UcLUr3Dqfcql5moAMOE1wOnwoUp 1ZfcdmgLaTxjmfJLtWw5tTnxnoaucjOpBn7IYXpAFZJCcvzeSMqml0lU24fuEw8vQpo4 onBXPGIhtGvDWiO8MOG4bS/THLU+e95uzJzS6/vSVhO1kC2VW/C3XPYI8hSog6QBs92G ySMbz8dV7JjQ6FA9WfPtZD8tukhSP7pWK9TtFy8wf/9xwsegh9hbvrnh/cAIe6h+TlOV 8wcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686805192; x=1689397192; 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=KnSTeR3wugqfczOIo0WVbaWFbXtLzRyoPYMenUB46Z0=; b=B1amoG/XBH0tT7dFV+Jjr5/UEROJzTUaq2V/HI5Ad4M8SeL8ddMKO19MEvKb0ltdvp th6D/5F1FEr66PwZRVG/mz2DZ3zE/acg1/1HLUUapjqo0K+73kasOaTHM0uzDP9POE0v ysmH/jTy7HvlP3GKtyMNEVjwBsVfDdru/99hjAjWANXRfZRC8KPSUMArfTAcsdcBbCI5 atyBvC0dZz3bMTI/ZC/P4PvElzsEjmS6tRrzUJiAor28cHHJ2wQi5w2I6BOMy4higmV2 Fe3MisNP7W+YOh8lZbuyB+yCkFSiej+jafgRlYMWec2WOSfvw7rLHTvimiK8uzMaWQmW yv2g== X-Gm-Message-State: AC+VfDzrvwZZRshA9O5Cxn5aCKJx0kJpt5P1Tv6FzNQTCM0zSexeEFWg +c1NcLUXT8w9eQKFmRsOH3eEgtMhz2rfP8gL3EK0Bg== X-Received: by 2002:ac8:7f8c:0:b0:3f8:6685:c944 with SMTP id z12-20020ac87f8c000000b003f86685c944mr80467qtj.14.1686805191933; Wed, 14 Jun 2023 21:59:51 -0700 (PDT) MIME-Version: 1.0 References: <20230615034830.1361853-1-hezhongkun.hzk@bytedance.com> In-Reply-To: <20230615034830.1361853-1-hezhongkun.hzk@bytedance.com> From: Yu Zhao Date: Wed, 14 Jun 2023 22:59:15 -0600 Message-ID: Subject: Re: [RFC PATCH 1/3] zram: charge the compressed RAM to the page's memcgroup To: Zhongkun He Cc: minchan@kernel.org, senozhatsky@chromium.org, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Fabian Deutsch 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, T_SCC_BODY_TEXT_LINE,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 On Wed, Jun 14, 2023 at 9:48=E2=80=AFPM Zhongkun He wrote: > > The compressed RAM is currently charged to kernel, not to > any memory cgroup, which is not satisfy our usage scenario. > if the memory of a task is limited by memcgroup, it will > swap out the memory to zram swap device when the memory > is insufficient. In that case, the memory limit will have > no effect. > > So, it should makes sense to charge the compressed RAM to > the page's memory cgroup. We used to do this a long time ago, but we had per-memcg swapfiles [1[ to prevent compressed pages from different memcgs from sharing the same zspage. Does this patchset alone suffer from the same problem, i.e., memcgs sharing zspages? [1] https://lwn.net/Articles/592923/