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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBC5CC6FD1C for ; Thu, 23 Mar 2023 07:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbjCWH7g (ORCPT ); Thu, 23 Mar 2023 03:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjCWH7e (ORCPT ); Thu, 23 Mar 2023 03:59:34 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7AAF974 for ; Thu, 23 Mar 2023 00:59:31 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 5D07068AA6; Thu, 23 Mar 2023 08:59:27 +0100 (CET) Date: Thu, 23 Mar 2023 08:59:27 +0100 From: Christoph Hellwig To: Vitaly Wool Cc: Liu Shixin , Seth Jennings , Dan Streetman , Andrew Morton , Nathan Chancellor , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next v6 2/2] mm/zswap: delay the initializaton of zswap Message-ID: <20230323075927.GB20444@lst.de> References: <20230322102006.780624-1-liushixin2@huawei.com> <20230322102006.780624-3-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 22, 2023 at 06:17:12PM +0100, Vitaly Wool wrote: > On Wed, Mar 22, 2023 at 10:30 AM Liu Shixin wrote: > > > > Since some users may not use zswap, the zswap_pool is wasted. Save memory > > by delaying the initialization of zswap until enabled. > > To be honest, I'm not a huge fan of this. Would enabling zswap module > build instead solve your problem? making zswap build modular would be a mess. It is core MM infrastructure and now we'd need to start dealing with adding and removing it at runtime as well as module refcounting.