Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31603286rwd; Fri, 7 Jul 2023 01:34:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZmBLOBi2xOTv5KwnxSUIc5aslAuvRdy6rDBo2sN0dGE3qYieAkU4Yur7WMQo0XoBTq2yY X-Received: by 2002:a05:6a20:8e1a:b0:12f:bc36:4c67 with SMTP id y26-20020a056a208e1a00b0012fbc364c67mr4956558pzj.61.1688718866477; Fri, 07 Jul 2023 01:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688718866; cv=none; d=google.com; s=arc-20160816; b=UfV5IbL/VI9o1m0Q/W4yqEEbUeSgEvWQWZfCJMqed31ce+KFXSJujc3TbSvBqmhOqe OuKDxQ7RwhbLjMND+Eit7aYIy33C9HDV5CdhNDd3Bp2Y05BwKiSohPrtEIWzZf75Isj3 8DTDh6Zu+Zq7I17sUVMLLEDDdg6NN+j8HlLPccXDM0vNg7keSkn4jz3nv0+qiwSsR4E2 DkYitpO6wX4p5n0IYEPWKWCna6ib5p9FCs7rirzNsgDufdu95K/CJIkn2AscX8BnuOm9 +J13n+cbW3y4d7oGUWbyGEMgUqmtm1H8yynVpOHBUOEP0mt/a4GkgaTAV8BwW3tBaf0U jqtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5oXGl2RHh2utP9BKE007mSj04cSpxSVlQJRSnyPwfww=; fh=E7QL2Rqn/CjzDY3mLvI97hnIbM9p5BI4HpQOjRc5pkk=; b=B0LNWvrIKUPABfvLelxGzjqB1JApbPLLI/p5w/6xOSEl9VpU0GsAFZvXLmnc5Esk2N ySadsO5nW94u6cs4YvE3VLtrUqIi9T7xwpifoj9qfSqVB6Pjn4QFV5OkfNNfZeB7tkGp w0ttOQi6JFHurZFunEnATSYC53WNlO0AmGn5XEMxcKFj5lshhUhVyi/j95zQ30zHu9wn qV4+n8F0/8hFgkOgvPycnQrVBaRfukSFzSOESrkUUAkO/sGun9J+8z4lsEeo8e7bJIf5 Q0DfJ1P8dIpx3ZrGfSFHjxKtcJMQ3G1LujrvE27PoDuKHPBGpdbqDDADIOkxphIgH1QB oCeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WYaR6N2i; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a635a0b000000b00553d7157e8bsi3315316pgb.794.2023.07.07.01.34.14; Fri, 07 Jul 2023 01:34:26 -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=@suse.com header.s=susede1 header.b=WYaR6N2i; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbjGGH5O (ORCPT + 99 others); Fri, 7 Jul 2023 03:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232442AbjGGH5M (ORCPT ); Fri, 7 Jul 2023 03:57:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7471B6 for ; Fri, 7 Jul 2023 00:57:11 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3521F1FE78; Fri, 7 Jul 2023 07:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1688716630; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5oXGl2RHh2utP9BKE007mSj04cSpxSVlQJRSnyPwfww=; b=WYaR6N2ihFi/ZHF15scZpNz3dh5DqmBlK27ioXRU/7+XWRQexLVE0s7yg9okn+VVmSSAAD AgK9o+DJ6yZas752PSgB33VwAAHt8Il01N9tjeHswZzzn97ofZD7QXI2q1eXTwM51KWExu wzQbKSKrAySBjGOcH7avBeHPgpL0iMw= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1905C139E0; Fri, 7 Jul 2023 07:57:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6P/HAlbFp2TYKwAAMHmgww (envelope-from ); Fri, 07 Jul 2023 07:57:10 +0000 Date: Fri, 7 Jul 2023 09:57:09 +0200 From: Michal Hocko To: Zhongkun He Cc: minchan@kernel.org, senozhatsky@chromium.org, david@redhat.com, yosryahmed@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/2] zram: objects charge to mem_cgroup Message-ID: References: <20230707044613.1169103-1-hezhongkun.hzk@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230707044613.1169103-1-hezhongkun.hzk@bytedance.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri 07-07-23 12:46:13, Zhongkun He wrote: > This is a new solution to charge ZRAM objects,more simple than > previous one[1],The compressed RAM is currently charged to > kernel,not to any memory cgroup. > > As we know, zram can be used in two ways, direct and > indirect, this patchset can charge memory in both cases. > Direct zram usage by process within a cgroup will fail > to charge if there is no memory. Indirect zram usage by > process within a cgroup via swap in PF_MEMALLOC context, > will charge successfully. 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. > [1] > https://lore.kernel.org/all/20230615034830.1361853-1-hezhongkun.hzk@bytedance.com/ > > Zhongkun He (2): > memcg: Add support for zram object charge > zram: charge the compressed RAM to the page's memcgroup > > drivers/block/zram/zram_drv.c | 43 +++++++++++++++++++++++++++++++++++ > drivers/block/zram/zram_drv.h | 1 + > include/linux/memcontrol.h | 10 ++++++++ > mm/memcontrol.c | 23 +++++++++++++++++++ > 4 files changed, 77 insertions(+) > > -- > 2.25.1 -- Michal Hocko SUSE Labs