Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1550736rwr; Wed, 3 May 2023 17:37:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70Zm39JyIxd87gpotSD9jrgXMqu8OYtRWt7XCUMmDFCGSTMXCwhFYzcfHndeJxKBqLcdLO X-Received: by 2002:a17:902:b213:b0:1a2:8c7e:f315 with SMTP id t19-20020a170902b21300b001a28c7ef315mr1935473plr.21.1683160674670; Wed, 03 May 2023 17:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683160674; cv=none; d=google.com; s=arc-20160816; b=GbJsHwUl26wIOdowD/mkOZJyElhZEHr205dEODBTmVRXyr5ilGVbIYZo1jCuKak753 ggl3zQbm+EmvGmKdjMnaV0P0fO3JAvObh/fL2TaBbKpwL3NLDEPjTikds7lye7VrfIU9 mBzj2K8qe2zPJsC5r3YDZ0MAJ5lCh+juIEnewn2FX7meOtzBHLTLMHLqhICCijo9Hf0U bJOqzGzveS2Q8bZzcB2NHAz3u8wmEBvP1RdfTFbVxdhuoedUu/RDX8inA+QGPMOOgfEN H9m/vobNXv7Ykux5u7KUzp/Q49hV1QRu5T7qHOwrDmRlP3Mej2GbTc6RA5Z6f2f9TUNi JUYw== 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=7vQ5LtU82wHXy4yqeGR03FmQei9dn4hIyS7S4R5ZW4w=; b=UfTX5Q/KNsrd3koLwI8E3AX9ifa+w4jX4omalSZmPFLS4JcHsozHefmi36s8lUyL8/ bMzjYrZgsLFQtN/mtbSd5TE5+dDsfhXIWICsTdFPutUGvmBlvkE73HePeIGB2D8EhX/6 d4dYncE1ldvCRTNWkaVgyIcqFFsx2DWXhay6bhdNWE4114fy2YeMxtXlI432dIkT/rZQ rK3kXEV7iKkpkcGD90VB7WFNM/1YkdoV+dvWbpwSCXMSAoSLw2tO4dpTfDv1oqQfXvgB JaZvpq0TJ/yF196Lh0N4AF0u3pwZhQUlUu2GyL1WvcRRlSRL1PcKdWuwCFALa8O1bZVD H2jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gp1mKLKJ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a170902e80e00b001a6fe422894si35855956plg.200.2023.05.03.17.37.27; Wed, 03 May 2023 17:37:54 -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=@kernel.org header.s=k20201202 header.b=gp1mKLKJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbjEDAME (ORCPT + 99 others); Wed, 3 May 2023 20:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjEDAMC (ORCPT ); Wed, 3 May 2023 20:12:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00F3649F5 for ; Wed, 3 May 2023 17:12:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90B3C62D0D for ; Thu, 4 May 2023 00:12:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4AC0C433EF; Thu, 4 May 2023 00:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683159120; bh=7vQ5LtU82wHXy4yqeGR03FmQei9dn4hIyS7S4R5ZW4w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gp1mKLKJrv+lOUYMAgOQ2vCR+mAWQ1yUjC+1eZMv6423cUtI/pqYxKQmbxUz6xMNB HBZa+gd0cYPefotDmhuRUOUb/BYglfd4aEikWoR2aT3HGtNAoZIpfGYZVDiMZOMlJh VnfBcAUQMpx0NFoQU+ek65mAiDwJ1YM3EpgFMXRa3w2Krrqjv1CEgd7bn/7hAbQlks B5b05e1egjpTqgyb99INaR4/OrXJUDxD6HixJthRdi6FN6ldYzL/sQfnh+QMVqM/DE miTpi37l+6I+bYeO42zdpC60AKQyJPNehJraaEX0LBlXYS9IvFmXKPBHZXFyf6THLY G1++9/5+L1jsg== Date: Wed, 3 May 2023 17:11:58 -0700 From: Chris Li To: Liu Shixin Cc: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next v9 0/3] Delay the initialization of zswap Message-ID: References: <20230411093632.822290-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230411093632.822290-1-liushixin2@huawei.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Shixing, On Tue, Apr 11, 2023 at 05:36:29PM +0800, Liu Shixin wrote: > In the initialization of zswap, about 18MB memory will be allocated for > zswap_pool. Since some users may not use zswap, the zswap_pool is wasted. > Save memory by delaying the initialization of zswap until enabled. Sorry I am late to this discussion. I notice you are already at V9. Anyway, I am curious how much of the 18MB was came from the zswap_pool alone and how much of it came from the other part of the initialization. If it is the zswap_pool alone, it means that we can have a smaller patch to get most of your 18M back. I also notice you move a lot of __init function back to normal functions. That would mean those functions wouldn't be able to drop after the initialization phase. That is another reason to move less of the initialization function. Chris