Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp77330rwi; Tue, 25 Oct 2022 20:34:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4r/WlzBMIWtSKVkuDSmfLmPaX24r99o/LodwE7HAJNs+svcHo5Bo5ay62xkJs21VSOgnfc X-Received: by 2002:a63:6c84:0:b0:43c:700f:6218 with SMTP id h126-20020a636c84000000b0043c700f6218mr35231411pgc.420.1666755274915; Tue, 25 Oct 2022 20:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666755274; cv=none; d=google.com; s=arc-20160816; b=GHF5eKI3q65K3cZWBtEPKWofDBVNnwrXTyMQxai+vAmLjNVylfNqVLg6rAY6qJH7pr myULnF7Jb9o/tlb7jTYXfxzasr1kE03RvF9IqMXgwFws176lr4eCXqbiULEquVr6DL5j PTjEd19kdtnFbcviGy2DC7LBzZ4WoMZac+IDuuDkKEEJ0zlYnbca18emAFrEYhW1wlyi ckTxzrWSdrcvEKE1seRc27CRT566IfyoclHMG7NjvRDHs03iviFW6Q831t8iaw/e9p0i 08Uvd6jSsoRIUVoLFk/QHiDY9y22fL+p3PQGsgbm2kqOSUwOh7h/M/EM8IdRh4Fyum/s tJDw== 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=7l/phVh9ff32IB3giZcQ3ydhEdMONedR6Fn9Kqfzr3o=; b=br7YKf9MCQlOApy9PSjANgkiCKH6KLGo52uW6xIvSaoRlYdbK8s1KMi72FS+gasp7L ZTsl4FsuN2ku/3BlvNKQm8ePAxQgf667XmQf7setLVptVsOs3c6kf4LwNU0LI0dYNXLI y02YRIhRiu1tMAFUQzFc9pmW1LBFOsvJk3mosAM9lz57L11j8QjzzO042/jVBeLoZnUI ST01slhXwz1lZQMi25JPv4EO7xVrcWp10D9JEXIj9aLV81ESjxA9GNioPU/rPzKPuOYQ CRmIrGsxPqEwailUtmtfU5pXruKySV7oIQa7RnfSp600Rs6C4RpG17d8P0Zk3NKvFJMK AbmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bXgpMeMQ; 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 p21-20020a631e55000000b00439ae523fd2si5744816pgm.289.2022.10.25.20.34.22; Tue, 25 Oct 2022 20:34:34 -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=bXgpMeMQ; 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 S231681AbiJZCP2 (ORCPT + 99 others); Tue, 25 Oct 2022 22:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiJZCP1 (ORCPT ); Tue, 25 Oct 2022 22:15:27 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423629A9EC for ; Tue, 25 Oct 2022 19:15:26 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id q9-20020a17090a178900b00212fe7c6bbeso840318pja.4 for ; Tue, 25 Oct 2022 19:15:26 -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=7l/phVh9ff32IB3giZcQ3ydhEdMONedR6Fn9Kqfzr3o=; b=bXgpMeMQ6ZAdE7l4TOCMLmc8fPSZwjZcspv322R1PC98EOACflsw9eXue0g3JDs28u P9jRSwKFkb3FVY4CE/eQwqn3ZhmORTHf4Z9jS7KUkN+2PD/ztSRCmnDJvEemDfNwkOJZ Cz7vA1WOZDB3aWwmYgFxsRFCvIdKgaAxHWryM= 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=7l/phVh9ff32IB3giZcQ3ydhEdMONedR6Fn9Kqfzr3o=; b=LFlplw2YLiDT+HNYBDGcPekDA0UB20XfctwB7s2Bede+sxiEKjDOxEml8kKrgWf8dx gXJtqwoPbNo2wmFbhCSF5SIArxwYZUL56OhCPUVP4tLdCa6/zREQgSXS2koj4x8sa/Rp 7BF+/IlmadjpAFK0xvy/ENr6ZdlHRwSQRCXbPpG5k+/FMxJH/9sgjjm0Mz+z4rYz7qG1 MWmSRaVEA2hZcobjxlgLvxvSpGgRWXwyVFLIPoo3igD3pnG+jDhBRfxNzCu/SSD2hYyQ mkse88trc9YRZbnT3zPh46nvtxiXdrSBn6YjXxoay3ykHylUZeeEW393goqqesfH1GkD TmzQ== X-Gm-Message-State: ACrzQf3d5gFqMwG/e9A2lHcfHx0kq3u8o9CDNpunX7mAzltXZa4M90He XyxrsNXtY+GoGP2+TRDMGurQFQ== X-Received: by 2002:a17:902:b717:b0:184:4a5c:c74a with SMTP id d23-20020a170902b71700b001844a5cc74amr42049886pls.0.1666750525648; Tue, 25 Oct 2022 19:15:25 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:faf6:e503:6cac:3b53]) by smtp.gmail.com with ESMTPSA id a191-20020a621ac8000000b00561382a5a25sm2026197pfa.26.2022.10.25.19.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 19:15:24 -0700 (PDT) Date: Wed, 26 Oct 2022 11:15:20 +0900 From: Sergey Senozhatsky To: Alexey Romanov Cc: minchan@kernel.org, senozhatsky@chromium.org, ngupta@vflare.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru Subject: Re: [PATCH v2] zram: add size class equals check into recompression Message-ID: References: <20221025162638.7853-1-avromanov@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221025162638.7853-1-avromanov@sberdevices.ru> X-Spam-Status: No, score=-2.6 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,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 (22/10/25 19:26), Alexey Romanov wrote: > +/** > + * zs_lookup_class_index() - Returns index of the zsmalloc &size_class > + * that hold objects of the provided size. > + * @pool: zsmalloc pool to use > + * @size: object size > + * > + * Context: Any context. > + * > + * Return: the index of the zsmalloc &size_class that hold objects of the > + * provided size. > + */ > +unsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size) > +{ > + struct size_class *class; > + > + class = pool->size_class[get_size_class_index(pool, size)]; > + > + return class->index; > +} > +EXPORT_SYMBOL_GPL(zs_lookup_class_index); I cherry-picked it with one tiny tweak: I want this to be ahead of my series (break dependency on my series). So I removed pool parameter from `get_size_class_index(pool, size)` in this patch and add it back in my series (when I change get_size_class_index() prototype).