Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1477419rwb; Thu, 10 Nov 2022 17:13:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4aQpAsVHydHEj7dJr1V40elSKECfdPy+Tn7vcFGyS/l/5CHUkO7xG4jdjFJQ6kWTLA2/NS X-Received: by 2002:a17:906:269a:b0:7ad:84cc:fb33 with SMTP id t26-20020a170906269a00b007ad84ccfb33mr153525ejc.380.1668129197268; Thu, 10 Nov 2022 17:13:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129197; cv=none; d=google.com; s=arc-20160816; b=Vx3oWCuCK2z18CKoU/T65SdLCxVNs/VXHzgxtXgkfE1g4qvuQXSTUKaZHy4Czty/xR oiB+ldBdrxXjXGqDu1FXdRa1UgcvGnecTsIJ8o/GryVjq51Q/BuxjOjbf/7xcok+XsgM sPbf/SxJ1TlCW0/3qyBd08mkcAla4Ek9oCOTZtcEcInsGZ9Dq9C5sC0JYSZACgU0W1oW p9TlgzdoU7WDMevb0dQUUr1UV99al+NEa0SH6tngzpXowyM1vLvJeal/mWT439whrJvF IIwOlSa9pS0f+pdWMgzck0GpXcacpfkj9Z+M6r77IVYyEHCCNZ+tc2vJpnAm5z8VA5hV WWwQ== 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=c8AB4APy2pddbTNqiGQoT5yqMTz/uyFuVDSxlzN+Oi0=; b=Z1feKA+f1takGvnWIXT+Rq+GwmCGBNZqodbGaR/qeCs/fM6/I5uegLKHbPxFWhYPZc lRLRrJgrgELXRF/7umEnl0lrXwSfUtMoBO2pGTKSOZju7XNysxF0MMlgCDCx8cSAhrmr UF10Y468Jgfs4Q5DCij91/ZP5GG5i8glObVHntlkIBw8y4ZMKs4vUbdkc3QIruRde7me t5SCIxBkHigbvdSE9qMJXhjDIjrUFdnJ6r3dPT3oWCf8Y3cBYcRitXFBWtJ6E0P5D1VI ITAUYqC3FiszZ94s2wImgRYIwNRsQK4W5OGkt8+Xvq5TNlLHpSRAwXuArU63N0pgvmUk d8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aZS3vpOg; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj10-20020a170906db0a00b00791910ecd0fsi798875ejb.540.2022.11.10.17.12.54; Thu, 10 Nov 2022 17:13:17 -0800 (PST) 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=@chromium.org header.s=google header.b=aZS3vpOg; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbiKKA4o (ORCPT + 93 others); Thu, 10 Nov 2022 19:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiKKA4m (ORCPT ); Thu, 10 Nov 2022 19:56:42 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA16C606BC for ; Thu, 10 Nov 2022 16:56:41 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id v17so3020309plo.1 for ; Thu, 10 Nov 2022 16:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=c8AB4APy2pddbTNqiGQoT5yqMTz/uyFuVDSxlzN+Oi0=; b=aZS3vpOgOGqwuol0MaD23BOqPU3B6GloRsuvGNSE4Mq1CehxYKrRRfBCz1gLXnSrAx 4yk5hShqx2fuWMSjjgvk1TG7RtC9xtkfNAGrqLCNn6CH2ke3k75FVppth/FtKWp++AXh jZV+LOklGig3Of0zt09LAZA9ZEAfmtrQldi9w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=c8AB4APy2pddbTNqiGQoT5yqMTz/uyFuVDSxlzN+Oi0=; b=dut1F/GiNeagdwMACGvVQbFgq3PfMYj+IxcQj5jvYZEC6xKI7t6VBD4sOTTir45KyH Bt4VsJf/t8rWZgXoUqqXt1x3bzyKsiRuEiewVnJPT2apF3c4T6ZlmYAJrmV+s8mUWmKn ODGBRyiMIPUQgRMCgzZXknza7Z1sNPhqjNTMMWyA7IKI2Nb0ojRpaQh1Sh2203A0JeeN NDQpJ18nOPCdBVJUFWnY+A6H3k43wvicgtiQQuDeUll6Fz3dlXA7HJ9cEa0h/M0GrJ1c gkqXCaiogL26103ZgdsKNVPoCJpSWsnFfG5swZWMAu2DjeWtXtKQhx+YKMjSsaOgmZgq h1sQ== X-Gm-Message-State: ACrzQf0ZrsfJ2hymF36Iln7+QJHO2pzAM6NuClj1togbCIEKPqHHctex bbiOJkWf0+iINe33rSBsH4VzLQ== X-Received: by 2002:a17:90b:906:b0:212:e996:704a with SMTP id bo6-20020a17090b090600b00212e996704amr2772722pjb.13.1668128201364; Thu, 10 Nov 2022 16:56:41 -0800 (PST) Received: from google.com ([240f:75:7537:3187:8d55:c60d:579d:741c]) by smtp.gmail.com with ESMTPSA id r19-20020a634413000000b0046f59bef0c5sm218722pga.89.2022.11.10.16.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 16:56:40 -0800 (PST) Date: Fri, 11 Nov 2022 09:56:36 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , Nitin Gupta , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv4 0/9] zsmalloc/zram: configurable zspage size Message-ID: References: <20221031054108.541190-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hi, On (22/11/10 14:44), Minchan Kim wrote: > On Mon, Oct 31, 2022 at 02:40:59PM +0900, Sergey Senozhatsky wrote: > > Hello, > > > > Some use-cases and/or data patterns may benefit from > > larger zspages. Currently the limit on the number of physical > > pages that are linked into a zspage is hardcoded to 4. Higher > > limit changes key characteristics of a number of the size > > classes, improving compactness of the pool and redusing the > > amount of memory zsmalloc pool uses. More on this in 0002 > > commit message. > > Hi Sergey, > > I think the idea that break of fixed subpages in zspage is > really good start to optimize further. However, I am worry > about introducing per-pool config this stage. How about > to introduce just one golden value for the zspage size? > order-3 or 4 in Kconfig with keeping default 2? Sorry, not sure I'm following. So you want a .config value for zspage limit? I really like the sysfs knob, because then one may set values on per-device basis (if they have multiple zram devices in a system with different data patterns): zram0 which is used as a swap device uses, say, 4 zram1 which is vfat block device uses, say, 6 zram2 which is ext4 block device uses, say, 8 The whole point of the series is that one single value does not fit all purposes. There is no silver bullet. > And then we make more efforts to have auto tune based on > the wasted memory and the number of size classes on the > fly. A good thing to be able to achieve is we have indirect > table(handle <-> zpage) so we could move the object anytime > so I think we could do better way in the end. It still needs to be per zram device (per zspool). sysfs knob doesn't stop us from having auto-tuned values in the future.