Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2187204rwd; Thu, 15 Jun 2023 23:53:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74BTl2SXw8m13YLtByfC2+iXxtwzvVzRYcJKR7sF15edkxs+5wI44aq3XFG5BQFA8ZU8bH X-Received: by 2002:aca:1101:0:b0:39c:7240:b4e4 with SMTP id 1-20020aca1101000000b0039c7240b4e4mr1334907oir.26.1686898418540; Thu, 15 Jun 2023 23:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686898418; cv=none; d=google.com; s=arc-20160816; b=QZFiQTH4i8Ec2ZZ728FqG8JZGBbiquSB3xm6EYFo3IUtaig9qtAkLcjz3QJQD34N61 axdVdHCtmK53620RqDw+aMJ5at4ufKp5xObhdo98zo/LMarVGjNzh0/+iYZ9QG6GlK4C DSI2nXOZOsrBvU8cI45BLtaWQO9bK2frWPva7z9K7Q9pTW74/Wetv5kpRUHM2I3GEpcM gcY7ghuliSnvgAe3bW8Db+7Ye2u2+5DclvMcT9rJxrnXXGvaHIBxpi9krTu1+WOGvqK+ Y18u8c9TV6seg/C/yIRMIgFqRqpcplkKT8nsYKxtkJGbiKlqUPddCM4Pzy3uFilVb4I7 W7ow== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GlSD6RWNsFHyZEr4GHh8TKFlv5WJ0i1ZYa1pBLlMowc=; b=VEVe2wd6+CQzHM1icVuvLT91G4Vy57DEfMNw3iYPwF+r3ysN/RHAEKD0ShIF+d+9Xi Im0QozObT+tL9yiF1SgIot4KuQ2VsyJuydckx7TEq4VkmORRZsVMqtjfmxhBjQjmrNzD 5LWDgXgh4GfE6AaYBtdsMloGxiuvnvqgkKpcrDuVWMmdJz11O6bJYMMIJuBzxQ9C3h0A 9f16pQKIwlf1M5+IlaINm2H6tkRZSxyEydmHlNH7hj8g+nTM0WraSpuTB8YSpAEjqwb4 3y6wOg3NF918fw138E4BuObN/IcjJs+jEkDrPyQj2l1Kd6Et2TZD59D1Zcz4r6UcZnWY uDNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Lwaq0oM9; 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 v9-20020a17090ae98900b0024e5ed38294si965938pjy.66.2023.06.15.23.53.26; Thu, 15 Jun 2023 23:53:38 -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=Lwaq0oM9; 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 S241736AbjFPGkb (ORCPT + 99 others); Fri, 16 Jun 2023 02:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241627AbjFPGka (ORCPT ); Fri, 16 Jun 2023 02:40:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A1C7273E for ; Thu, 15 Jun 2023 23:40:28 -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-out1.suse.de (Postfix) with ESMTPS id 4143921EA4; Fri, 16 Jun 2023 06:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686897627; h=from:from:reply-to: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; bh=GlSD6RWNsFHyZEr4GHh8TKFlv5WJ0i1ZYa1pBLlMowc=; b=Lwaq0oM9xcU4PNbk4U2Q1L4ultP5oN78NdmmwGPF5vI82UUCor/lBmAb2uuxDQbR6Joo13 PGBl3wCAotw2hOrEqvgbKwQOFmNUBQ5Cz6Qze9QVD4WHJM5yB7c7OsK+4b1Ti//A+LaDeK Z8DdJ63vhDa82ZL+fYelXkZmQICtxzU= 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 1EE2E138E8; Fri, 16 Jun 2023 06:40:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lokcBdsDjGRFdAAAMHmgww (envelope-from ); Fri, 16 Jun 2023 06:40:27 +0000 Date: Fri, 16 Jun 2023 08:40:26 +0200 From: Michal Hocko To: =?utf-8?B?6LS65Lit5Z2k?= Cc: minchan@kernel.org, senozhatsky@chromium.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [External] Re: [RFC PATCH 1/3] zram: charge the compressed RAM to the page's memcgroup Message-ID: References: <20230615034830.1361853-1-hezhongkun.hzk@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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_PASS,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 16-06-23 11:31:18, 贺中坤 wrote: > On Thu, Jun 15, 2023 at 10:21 PM Michal Hocko wrote: > > > > On Thu 15-06-23 22:13:09, 贺中坤 wrote: > > > > This is not really answering my question though. memcg under hard limit > > > > is not really my concern. This is a simpler case. I am not saying it > > > > doesn't need to get addresses but it is the memcg hard limited case that > > > > is much more interested. Because your charges are going to fail very > > > > likely and that would mean that swapout would fail AFAIU. If my > > > > understanding is wrong then it would really help to describe that case > > > > much more in the changelog. > > > > > > > > > > OK, Got it. In many cases I have tested, it will not fail because we did > > > not charge the page directly,but the objects(like slab,compressed page), > > > for the zspage may be shared by any memcg. > > > > That sounds like a broken design to me. > > -- > > Michal Hocko > > SUSE Labs > > I will try more cases in different compression ratios and make sure > that swapout will not fail. I do not think different compression methods will cut it. You essentially need some form of memory reserves - in memcg world pre-charged pool of memory readily available for the swapout. Another way would be to allow the charge to bypass the limit with a guarantee that this will be a temporal breach. -- Michal Hocko SUSE Labs