Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1610518rwl; Fri, 4 Nov 2022 16:40:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RPjDf/65nsT807Cc7Kb6ZdEVEBacDLpRLYjgwSQQUht8Zadh+0K7Hb0q/iHgPoRHouOyJ X-Received: by 2002:a05:6a00:1304:b0:555:6d3f:1223 with SMTP id j4-20020a056a00130400b005556d3f1223mr38327894pfu.60.1667605226272; Fri, 04 Nov 2022 16:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667605226; cv=none; d=google.com; s=arc-20160816; b=Ayjqsi9Ns2SQYYxNHJYJTKQZDOaGxadKUPwgDANtD0d6+R2IdmRiE7bmsg7i/YIYvS 6QDCJnq98swb28PaTH1qBosnFph/BQRybOSf/6U2naGHEmE5uuOP/4kVAeIG8FgMz+Pe 642bY0u6cCxl5F28jYJka4OqIZa5goVzgbpFlfzFQ7BVkavubgt/HmwrXfBqAb01QOCJ uLoCeYCHIigpsAhZ8pIJxVkrIzHjrq1k5TaKpZk7oGs9XkptZz8Q7V8cwm0OtdReh0Z7 56JWkFRQyS3+q8wUYz5VRZBNx6PXjqw4drq2+GQRdvDy35/okD+EuVgwokfTv5kjTJaR JK4w== 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=EtYEsODmOJKvYgJZvGMTSL9jwi2RIaTO198SEqeZWk8=; b=N5bFXQnIjiA54w0aeuJ8NDq9GatJphpMXa86H4OF7sFlg2B9hEy+jyyKjo9uVQWpBf gZ6jA1RPReSHfum9hfCpUyFDAl5bdm5BuhXF7xvb6uofaMv2+ujkBSE8HhCUwOUCquNB CDpdLG0dkJM/N7eDYne35qjACE1PYDuJTnsSYVzxy4St2SCZ/uFBYJu8LVoOd9K2VDCG 3Nb5rJwpZdwTkSpVt1lD1leBiiOH2tyxwefYnnPLOrg4Fkh21TSGMBrgnC5RVdGtmgvC ZYdIPM184n3sMK8+QxLtL7/xxcDZfOipv8yQh3NrzOhMRarGsr42s7qMMLkF3YD1h5sT 23dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Yx+CBKf4; 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 l4-20020a635b44000000b0046feb2838easi935611pgm.140.2022.11.04.16.40.13; Fri, 04 Nov 2022 16:40: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=@chromium.org header.s=google header.b=Yx+CBKf4; 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 S229551AbiKDXXF (ORCPT + 98 others); Fri, 4 Nov 2022 19:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiKDXXD (ORCPT ); Fri, 4 Nov 2022 19:23:03 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4CCC1A83F for ; Fri, 4 Nov 2022 16:22:59 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id k5so5786522pjo.5 for ; Fri, 04 Nov 2022 16:22:59 -0700 (PDT) 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=EtYEsODmOJKvYgJZvGMTSL9jwi2RIaTO198SEqeZWk8=; b=Yx+CBKf4b3KimfG4I1K3wtyMnr4zWBmG9vP+RGZKvxAKi2aXG9ZT3RSjIEEkARv+y4 2yq+bckIcAk9EMJtiAgzpW39dwVAQODD4yMMEI0ZVIYlrvffXa9VtmUTJ6OugBkAHOww AreU5v+ERdUcXBB7IhPjpSsMbF0Km0Wyaz3eo= 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=EtYEsODmOJKvYgJZvGMTSL9jwi2RIaTO198SEqeZWk8=; b=wn5xX+Vkj44aE2vaxi0jgb9mnt2BfLS9596jNZ3e+sG0ademsoIeAE45Nbt+2um0gW bX5oP2chfSWNSUV4IonLaFatTRyATb9QqtRVCUdD53DmyBR9Zl1kUXoBCWoR+WBCzdBu 5/yTB+GylBwwQGOg/DJXrUWABQoWMX7WiQCG56jAIONS+jvCrsIuuJR1C5V+CVm30Rju tvP4ktM7KI7M0NxfNU/1Ucpw2Z+ynCCjcZfrQxfw4O+bj94Br33+lnhua85fNyOlhtzs PMEw63EVqemG++UyaQSTKhH/rcpSeCrLsoyVE0Hcbf4W6A9d/WHoOqpT76E8Cc1BrTqq WZzg== X-Gm-Message-State: ACrzQf04XKqE+lEpovul7aCzxavjrU23wUo9d1nu04g7yi/aFvrohZHd /UXKupyJA/1Waz4AwxzaIhBdAQ== X-Received: by 2002:a17:902:b581:b0:186:fb90:1151 with SMTP id a1-20020a170902b58100b00186fb901151mr37666494pls.43.1667604179246; Fri, 04 Nov 2022 16:22:59 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f2f6:8f5:87c8:3aeb]) by smtp.gmail.com with ESMTPSA id m20-20020a635814000000b0046ff7db0984sm234228pgb.72.2022.11.04.16.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 16:22:58 -0700 (PDT) Date: Sat, 5 Nov 2022 08:22:54 +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 4/9] zram: Introduce recompress sysfs knob Message-ID: References: <20221018045533.2396670-1-senozhatsky@chromium.org> <20221018045533.2396670-5-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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, 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 On (22/11/04 10:27), Minchan Kim wrote: > > objects that are in-compressible (in a way that saves us memory in > > zsmalloc) by any of the ZRAM's algorithms. > > > > > read_block_state > > > zram_algo_idx(zram, index) > 0 ? 'r' : '.'); > > > > > > zram_read_from_zpool > > > if (zram_algo_idx(zram, idx) != 0) > > > idx = 1; > > > > As an idea, maybe we can store everything re-compression related > > in a dedicated meta field? SKIP flag, algorithm ID, etc. > > > > We don't have too many bits left in ->flags on 32-bit systems. We > > currently probably need at least 3 bits - one for RECOMP_SKIP and at > > least 2 for algorithm ID. 2 bits for algorithm ID put us into situation > > that we can have only 00, 01, 10, 11 as IDs, that is maximum 3 recompress > > algorithms: 00 is the primary one and the rest are alternative ones. > > Maximum 3 re-compression algorithms sounds like a reasonable max value to > > me. Yeah, maybe we can use flags bits for it. > > If possbile, let's go with those three bits into flags since we could > factor them out into dedicated field, anytime later since it's not ABI. Ack.