Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3416268rwi; Tue, 1 Nov 2022 21:18:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5B/LVsD8fM5dkrMUDMeUkgBuEcMhzsDb48sA+LMk6++ApNBkVNYGFJUuTYORl32n2NRKIk X-Received: by 2002:a17:903:292:b0:186:dae9:c089 with SMTP id j18-20020a170903029200b00186dae9c089mr22499061plr.31.1667362680684; Tue, 01 Nov 2022 21:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667362680; cv=none; d=google.com; s=arc-20160816; b=yFcdEKWOJ9FL5Cmre1AYAXuS8VXrK6WLtjBUq8xi2ctm56QPaJKAxdN3UXXDdeoSJQ tfcgAebxOYfuR/STpiSs3DxFP9HspJLQgw6RAVO3rS/nfHfeKkXbmAR1uFNCQNl+OtIt ts0gGqF5vnANpsyTmBw99Vzpa+dvDE2xRpMB1W7FJ3tZrmm4JvaY1NtFXoy29Wl0LbE0 jnHnbDrIJ6q3WHwRWccoHkMPVes8HLTvRU7ri+Op/tw6SAdbke6J0Jmug9kB2D1k9sFF FuN1tqVy+D8GyT1nXafyqq7XpbAXxCW448wfR2n0h/BOJBYW/rPOCRNoV6L8yNo0JNOK z53w== 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=yMJn7jimJNcA0G1Sq5Hqirc0aLfOad24t/l8klU9DOY=; b=DEmoz0e4by3L9FHcD6HTcYcP5GiLxdLqLvZPJ7OEMFz7T16OD69TBYyWEe4ShCA0Hv AePdmCS8VLqViuBrRUpSKuVYaiwejAUGoYy0ABN2XjV+6oDkBKPNS9G+n4i8CXOxpWWc Bi9Tkby4JxhRGt1Kto3ngvRtsf+fYYpDACJfNbbJJs/BqCaMgHnZRX3w4E/ExRbn5dyj 56aQA4NyPDV2zuC+795CGshOxSweAgg/+wXJ/WN3Y2484xSNmWUkMW+FuAl7zKaodA27 Wz9dDMJSTe1mHj+Sd2HBMS6E/DMTdpvL3XM4p02sY3skKQVRjOLx1rO1r+P6SHbFmC2p Rrfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TvlCXQ8N; 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 pc7-20020a17090b3b8700b00212fd5f1ad5si1091942pjb.160.2022.11.01.21.17.48; Tue, 01 Nov 2022 21:18:00 -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=TvlCXQ8N; 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 S229534AbiKBEKJ (ORCPT + 97 others); Wed, 2 Nov 2022 00:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiKBEKH (ORCPT ); Wed, 2 Nov 2022 00:10:07 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A74A522B1B for ; Tue, 1 Nov 2022 21:10:06 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id u6so15415797plq.12 for ; Tue, 01 Nov 2022 21:10:06 -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=yMJn7jimJNcA0G1Sq5Hqirc0aLfOad24t/l8klU9DOY=; b=TvlCXQ8NjdJp1yLfUtUk2P/Qs8V2AtrOrI2xgiu3Ccl70bvVqtB1OiixpaYrdGLg0b F1CM+HwzOpl4kdctIFecwM/pulSZLLzbns9c9n53I4HtSSSASGT5k3r8MResxKdwvEth RN1WckQyiTKybASLNAzoTuNYjiaXkY6lw8UB0= 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=yMJn7jimJNcA0G1Sq5Hqirc0aLfOad24t/l8klU9DOY=; b=7Di+3qCVe4Lemm+toe4yRU2NsvVcXIJG4wqqBUGq9TfjWFKA+atMECu/PQzcFfezIH Yhn2TiHZ3WpsRnt8ZUF0SHKCkXAyT9I0Hm0OwmMfrltD8Az85VpLlABM3fsrrH1kG/0c rOEIbIFBtnKZt8xsh+Mph4tKJVoe06GrNELUcOPzZhEvTY5YkyQjzzQA8ou9QjgexyD8 OgTFUi2QH3Zq4ao/dxETiAjmLoO3xlykz0oCobsscwYHtLLT3WvLOkquHJN/H2qloE5s ceveiU2uzE9oEEdscoBn9rrKZKVDBy0AxQ+F39t31euzsldGBECquqatwRhl++jHlMMt 1I6g== X-Gm-Message-State: ACrzQf0CjOieAvbY1iA6TMWQxe2/nT0rSfkz89w0Uqihqa5fcj3AmfNU ZYhRol92LkUD+ar2zPldG0nei88WHH4e1g== X-Received: by 2002:a17:902:d4ce:b0:187:17bd:44d7 with SMTP id o14-20020a170902d4ce00b0018717bd44d7mr16559179plg.84.1667362206240; Tue, 01 Nov 2022 21:10:06 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f558:dfb0:7cb7:44d9]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b00186c6d2e7e3sm7119248plb.26.2022.11.01.21.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 21:10:05 -0700 (PDT) Date: Wed, 2 Nov 2022 13:10:01 +0900 From: Sergey Senozhatsky To: Nhat Pham Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH 4/5] zsmalloc: Add ops fields to zs_pool to store evict handlers Message-ID: References: <20221026200613.1031261-1-nphamcs@gmail.com> <20221026200613.1031261-5-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221026200613.1031261-5-nphamcs@gmail.com> X-Spam-Status: No, score=-3.2 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 On (22/10/26 13:06), Nhat Pham wrote: > +struct zs_pool; > + > +struct zs_ops { > + int (*evict)(struct zs_pool *pool, unsigned long handle); > +}; > + > struct zs_pool { > const char *name; > > @@ -242,6 +248,12 @@ struct zs_pool { > /* List tracking the zspages in LRU order by most recently added object */ > struct list_head lru; > > +#ifdef CONFIG_ZPOOL > + const struct zs_ops *ops; > + struct zpool *zpool; > + const struct zpool_ops *zpool_ops; > +#endif I really don't think I follow this zpoll_ops and zs_ops things. Why do we have zs_ops?