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 96303EB64D7 for ; Fri, 16 Jun 2023 06:40:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E6D08E0002; Fri, 16 Jun 2023 02:40:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 297C98E0001; Fri, 16 Jun 2023 02:40:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15FB68E0002; Fri, 16 Jun 2023 02:40:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0261D8E0001 for ; Fri, 16 Jun 2023 02:40:31 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C1B6D1609AC for ; Fri, 16 Jun 2023 06:40:31 +0000 (UTC) X-FDA: 80907662262.21.CEACF88 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf10.hostedemail.com (Postfix) with ESMTP id E9461C0022 for ; Fri, 16 Jun 2023 06:40:28 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Lwaq0oM9; spf=pass (imf10.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686897629; a=rsa-sha256; cv=none; b=45eDWRci4FTYGKbI+Sk3xrP8AIW7QotmPrGNmKuiraRN4BA6tykGcgMN4R0OO5uXb3Hk61 Zicj/w6BZJ3lOXdxmNUENzRLk91KKxxLa9U0z4n0y8ccI1xR06AzJqnKW2wxIcMJVniCAy 6TdYGNHgSb6N4uI39DCxjIkkXoaxbWU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Lwaq0oM9; spf=pass (imf10.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686897629; 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=GlSD6RWNsFHyZEr4GHh8TKFlv5WJ0i1ZYa1pBLlMowc=; b=Hguq7HO2orA2wuy+rgY4oSOkCr8LH4VANEZvSI7OIPJt6o+WV7evLa/cURTS4isk/Y8RKE //iBUJlgvtGIzvsHLVv6J9k74H55YuRm1V32nTEWZSaBCpo1/rbEbbRb1D/AktqRhOSPJs 0L516e0oYIvwt3HxntkbNE73xdvzfUw= 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-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E9461C0022 X-Stat-Signature: eiepthkj89yjpopknjim8khgu394s7nw X-Rspam-User: X-HE-Tag: 1686897628-94097 X-HE-Meta: U2FsdGVkX1/35fhZ7odUVBc3iwwA6FDWoippEY+wRf3rIUAOavTiBwloqFgzl3XHxaxmVzo4WrcGw2vZX8DrzhGzNqr7vCzQ1fWuTrafD4cJx+pMABULMtcCDMRT3TRce1kcDVKcjrhBJ5sXNxmKeQOC1D94jRxhlbqsj/oOl+u09AUQoAfHGGk4rJ/HGMXzIyrKQ3N8RmPU4Qrpm5Wz8tiBLMKZT5UCB1gQKEVfPnuI8Vsox7w85XXXH0up3TVt2ai3YZrvJnrDGAFAzXkFtcYj5SHijMfRzNptWuzQFqElg/O1W5GYWj3iP7H7BgpmeCB9UmyiTCPedemlx+i59dSqSr7oClvuYKo+ubz2DIyxvnhAZyfbKq6bLRCwDPR2BLMpfRzS5RUr0CIa1a6QAO4rlhmgWowblOwx2sawItEmfYNDb9C+q2wTSQSB9z2qr/K6Mty809Md0L+z5NidgXt3TXhR9uXu1G73dAzIiNnCGw1KyCiqysfWmQ5+z7yO0fixOclLpiXzr4UkanlY0lhIaDL0fT4imz6/6Sh62QcVVyE63+9Q976xkCzd9It19FNLTPGXGTC5D7se5C3S1l/ffs/WMHdzpN3QWVybsGcZkMW8JWoSHUWVvukSIE7TzD7DGiuCsqYNazjSfx4bKeaVh2d6MoTVjrnsHxj2IFKCNaAEWwWs42BT+YxsYDkGhV+nrag/xw72CgKcXH6DHZ2KFuoDFhx9Ht8F390uagBjpv+Oiu+NrBpd5EcZXVadxyVDhkvq1G6AIU8pc0psmFEgpIrLYNHP8WpgR1NOzM38VYttJkgkclU+DEbIhmXvcvPI9TAfrFMjOIglRiya8P1qgGYQBfSUML9KE8TSdT3BF+2Ip96d103TdSvIZdwLwXENVRDM8mipEmXFWPk1uABY8tZCDragM5px8Z3fpIsWXuazXq6LSBiQqywzLyJYs/q1QKiuLcvO7g+4dpF pSNS3HyL m8a6GBcx+LrMCZx3qt4MwOdzCH1FmjyI5usZwQe2n49AYrc/+OO1DGnbLS/WHVPkBAOlcnHM87D1V0OAjqUUVtEzFCVFK3h9z2K7OGy/6AlMsLjOySuiQVTWmO/CzfnB2UADwIK2N/VIJOfcoyMspZzQyFiEHCGefPHA3ATbHxa6lhZLlCqeNSDs02WgxDks5cRWuvnwqREDZDY4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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