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 F3B10C4332F for ; Fri, 11 Nov 2022 00:56:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A7A66B0071; Thu, 10 Nov 2022 19:56:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 756B46B0074; Thu, 10 Nov 2022 19:56:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61E268E0002; Thu, 10 Nov 2022 19:56:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 534406B0071 for ; Thu, 10 Nov 2022 19:56:43 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2032F808A6 for ; Fri, 11 Nov 2022 00:56:43 +0000 (UTC) X-FDA: 80119346286.11.84D52DF Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf13.hostedemail.com (Postfix) with ESMTP id 8A85C20003 for ; Fri, 11 Nov 2022 00:56:42 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id d20so2985748plr.10 for ; Thu, 10 Nov 2022 16:56:42 -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=UmhgmK83l7ruse01mWNjXMckSgzClc7fjYoqrj57uPTW4iaSys4fiqJLUWYtAJgtbj ox8DF2/xLavZBqZFxjjG7EllNdM7+bbfrvtKjz5T0x8IPwGSvT12vMNjKcEatLP7YXw/ RZ+TaTIrbPPgXDOQ/YMXQY/lYEmucuK/jHKa5m9LoGsD6kooEYbq10UnELIJVPknejYT M1ESHNsuQVzXMYlHDV361uxF5Nsg6/QfTGzqgrLAgWU3GBc8/n/rlF3JNRXVYj+1fJ91 jnpUM2Nyi6vTM/Qew0VInjQ3Yo0smaSZdkvwMEDE9V8N5qNx+39mV486yiMrH9OggTJp re9g== X-Gm-Message-State: ACrzQf0todpvGXrVlXgmqbnKkfPauhN32B3EkKux/QgBOiMttdxYpLR0 CeySXrImMikIu2iqQZjNDH0rtQ== X-Google-Smtp-Source: AMsMyM5mW+0hkuFQJ6UywbnVVXvPVuRqZe3ekCt3uLAhkI9kyRQRsO3Q/YuQgGdBAHAIuNUlzwlLHw== 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: ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=aZS3vpOg; spf=pass (imf13.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.171 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668128202; a=rsa-sha256; cv=none; b=NoN6Pv3jk8lkAi7gRXvliQgNjYWAamFG5bT9SQnOZ4MNuzLWRnJ2MwXxhn3FZMKYLbT7rf IwkOHoC7zm/B52/QLCr2sYLsiy/OgGbqG3POn3fFRS7AhsVe/jM2TdEqkrTdM4Av004UCQ bCngupCZUxTA4a73qgwZUskUL0YMYr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668128202; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=c8AB4APy2pddbTNqiGQoT5yqMTz/uyFuVDSxlzN+Oi0=; b=dDuYWbCoPCwm6W4hjWlgp+VQbpWQACs6uH95m7xieI8BCUo6qtd90gF6rOPeL36W/56EQu spclXpUp74KaL7Jv571GT3yRiVAfYd0KduLCxP5q3fNKN3kQEsPSrg0WAKlKOuqpftYHdy dJ6x3R023rLsgzq70SzRJjoxKe+ftd4= X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=aZS3vpOg; spf=pass (imf13.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.171 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Stat-Signature: a5nu373thftrrk8npay6rnh3gej5r7wt X-Rspamd-Queue-Id: 8A85C20003 X-Rspamd-Server: rspam09 X-HE-Tag: 1668128202-348635 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000069, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.