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 414A3EB64DA for ; Fri, 7 Jul 2023 14:26:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAF418D0005; Fri, 7 Jul 2023 10:26:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C5FA98D0003; Fri, 7 Jul 2023 10:26:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B273D8D0005; Fri, 7 Jul 2023 10:26:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9FFC88D0003 for ; Fri, 7 Jul 2023 10:26:04 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7434D1207DF for ; Fri, 7 Jul 2023 14:26:04 +0000 (UTC) X-FDA: 80985040248.02.464F77E Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by imf07.hostedemail.com (Postfix) with ESMTP id 24D3740007 for ; Fri, 7 Jul 2023 14:26:00 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=H0Yq65cv; spf=pass (imf07.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.166.179 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688739962; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=j8zOo4D7CrF3Fq7dS/X/Z4THsObN775yaluRka+o+qQ=; b=FJaM+VKzwaCo245+SnUTdUL3Cmd5PNAWENwSKfjJXs4FrSMciPTcoPgxltL76HSS/2wc1t d6nKalB00BVClVFM+BH1fe579hcm+trhVpHdMwOA3HB+S7p6m96u/GYmOZVxGZ4zJDijYu LfBqRE13z6Zp2zZgflRsFBVa1+33sik= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688739962; a=rsa-sha256; cv=none; b=B7zlnsIJEdaCVQpNBE6atwfFNRAhFcvL+weWoZjokfau008i93L+vyLS5Oq/G22JO/Vxtj LWN5KepqbjhfrGhElXlAnGgAP6JjbmYfolbyqD2PHQVFuKd4jTqFbNfCUHO2mbKgvYyFVC wPfJXmB16d2bt88am+s6jDlhrB3ckSA= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=H0Yq65cv; spf=pass (imf07.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.166.179 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-345fcf8951fso7272585ab.1 for ; Fri, 07 Jul 2023 07:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1688739960; x=1691331960; 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=j8zOo4D7CrF3Fq7dS/X/Z4THsObN775yaluRka+o+qQ=; b=H0Yq65cvVrCyR5pi6ERAN7hGmCVrvgii0bpZjVUOYChrJmU5EKpYGFHiLDvTJ8bzdC koQnzvJyChtDS5cOEhSyIQaV8dOVJVsgRIAEbBAyAcJtkvfnjP+mzSG1q/8XPVg63SV4 HXRR2UZCvwBen+Zo7V2P0Vxuxh00xT/eSTPQ66xlCWlDyJrml+CBRDDgwtx5dP6QAWi+ A2618sG3Qw1folZyfJEYBo+dYLsFcWieCtdATDE/MF53WrmIIWUpxRlaeFbOktglr/AF NPKpSTVx7aEkl6hXDN3udp5DIkS/AVT+rvhadE0g20ci9gauyelpXf+HUlZx6XgvDraW niMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688739960; x=1691331960; 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=j8zOo4D7CrF3Fq7dS/X/Z4THsObN775yaluRka+o+qQ=; b=Xtq25AWf23D+9hpIQApqcVElqNfM7h23Iqnu/cUQoIhiC9TF0yTX9x2FxFyt5EPHRj StlvEZQbFDAoSiFUIqfuLkKc8S10Fk5n/tsj8GC9KLgikgurLhgE0upceSEqeXl7/0RM g1R+tZPRKbRWSQOHfdYVld9jK87/n2tPx3t3Cc7B3ShGvGJYYiRC9k+SQbVtXLAdSKML KgQ9h0GbmBrS6Fp6VQbvVPao72sEInjcmAwQiZxfU38n0WdxvytVeaIU6Klc4X68Nm3n YGZNxGhtsPHfhjewSIqTcObeWG025U7aJJWCLVGOTIWkl7ep69Ls5iRkKGj/wf4iGu3i m/OQ== X-Gm-Message-State: ABy/qLYgblrIFlVc/AGr50Vj7cOvvzs7KMn8pcRdU2SGoezpiTS9HQkg R7qMUkEgS+wJepKCfooW03JOKJe9G0Vs6Hs/0Kux2A== X-Google-Smtp-Source: APBJJlHaE7IHJaxHSJSf0ShE7mF4jdMOzymySDMkkwwWI5PrdZsWK3w+PzkJNpoJ4kvvPL+ob+sqgbPrQYTRHeJh8ok= X-Received: by 2002:a92:c647:0:b0:346:49bd:7b72 with SMTP id 7-20020a92c647000000b0034649bd7b72mr1046282ill.14.1688739960033; Fri, 07 Jul 2023 07:26:00 -0700 (PDT) MIME-Version: 1.0 References: <20230707044613.1169103-1-hezhongkun.hzk@bytedance.com> In-Reply-To: From: =?UTF-8?B?6LS65Lit5Z2k?= Date: Fri, 7 Jul 2023 22:25:48 +0800 Message-ID: Subject: Re: [External] Re: [RFC PATCH 0/2] zram: objects charge to mem_cgroup To: Michal Hocko Cc: minchan@kernel.org, senozhatsky@chromium.org, david@redhat.com, yosryahmed@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 24D3740007 X-Rspam-User: X-Stat-Signature: i4uqiry3q71q37yykku9xye77m3kr9is X-Rspamd-Server: rspam03 X-HE-Tag: 1688739960-352822 X-HE-Meta: U2FsdGVkX18/cMvgHY4+jR97VeFLBndpoMIfw2wYFW36MAG++Dh9OFUc3UOwiA3K4mOYUvHibF8i3DRuxUGFtyRxsBxuFandaZMdf9WVApBH+kmL+vdvhuCyyQZSFqq84VgGvCc+o/EcP+V20FhwSUK5eXmViXp80gaXpgGY7I36sgeerDJt4XKyNdPRkn5TouL/8LvLi6BREOTdgDLH9FryP/bicyFGkrRuEqf6OrOq8Ff5VfI96/OyaCiyZsEIzIBx7XJHTso8NU0JvL/+ODtV/WdGPQOX5dlOXvphvjWQU6rbD3Zx4g5wxxf5mxYPG8q+ZYQ9aVJjfeLO0WxGSpH/05kdcRGMF3e0tK9rIIHxJzUiqRGiYl7Je0mvO36KZ8gnQAun9VsLnsk0Z121fsN0jykt0aRM5bSNnLFxSzBxKIR2s6q6fnrLsAgr5JxJ6UdMOdFCa/7pIeDw3tm3wvudMwfJLTaC5bxoC7JsFuhDlFRYRA5fZ2DAmXZmiZiakZxUCkiJk6cM5DOaCtQMt+A97WfhxN0Axm6++G7g9JWjpRpqbOA+Kh0Wb5TtZybiBsIEcUvYVWBy0Q1W3EEX2+jG8mSu0U3QaZxxQNAeZH481BtKMHukZBMXnZZytKGeUL53sXBrjmAFupzygv+n7mQ6x1RjrxGJ+AOd/4kqeCvwl1VwZnAhxqsSJAUZItFlHaa7Dt7UBO4h8uVRhc+2LMs4Btb4GMJrUvnpMxuUSrAhduCSOWYYnCctkN5iRU/2pUOsjzM4M0v2SBv5tB50rKvccBKDfFDjL/ntFtF6c2+/oSGR8K0Nx4kXZdmT1uodzMe935eyZx8z9ClquMj3Ae16ZUZ2lkGFbor6b99xdoQSO7VIsoSr9CilUcDd7XywdXRr+htCuI9ItzoGeQZY/Kp1/GnN1wMbb8GEYUq1QT3frgW1D/a0bwWEAvqa5ishCCWiNeEXsX0wWshhyLQ VOn7HiJ0 WiZtnyVtVSneP6ZdtCaH4nr3mt1aouQLUCSvE8SAO8Rnc3D9KDfE9+2kBs1POiaeGeImyiDsqeAMYcKZritVFTQXvoq4cFvxsSIYpCVue9WBxFTmMHjWJPMEUQjzhIzxFDHEYoDnKLsP4wsHPCmln5hu3T6iXMSXDFGjDFQIl+nFmWDGMhAaS20TzTe4rLoi3+5T9qehodWuyN6BPGlwSJ34f3x4XmWSyJOtyrNZFMajCwMUrSKgNNfXtkwVUqjAFED0zdWcgae1G4GOSrSqa2mqVdADoZWm4UuvuArT6TIQMqmGopkn/W5zuog== 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: > Please state the objective you are trying to achieve by this patchset. > It is always good to summarize the previous discussion and mention what > is done differently or how previous review feedback has been addressed > but the overall idea/purpose should be always explicit. > > Please elaborate more about both. > Thanks for your reply. objective=EF=BC=9A the compressed memory of zram charge to the cgroup of the user. summarize the previous discussion: [1] As I can see, Michal's concern is that the charges are going to fail and swapout would fail. The indirect use of zram is in the context of PF_MEMALLOC, so the charge must be successful. [2] David's concern is that if there is a page in the BIO that is not charg= ed, we can not charge the compressed page for the fs->zram and whether the recompress case is charged. In the new solution, the recompress case can be charged. But if there is a BIO not charged, I'm not so sure, to be honest.it would be great if someone with more FS->BIO experience could comment. I have to review the relevant code to check it. [3] Yosry's concern is that the previous patchsets are very complicated, and do not have wirteback support in zram. For the new patchset, charging becomes very simple, and zram supports writing back to disk.At the same time, I am hoping the use of zswap without a backing swapfile can be enabled. To summarize the new patchset: We charge compressed memory directly in the zram module instead of in the zsmalloc module because zsmallc may be used by zswap, zswap objects has been charged once in the zswap module, so zsmallc will double charge.