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 E52C1C7EE21 for ; Thu, 4 May 2023 07:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbjEDHLN (ORCPT ); Thu, 4 May 2023 03:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbjEDHLK (ORCPT ); Thu, 4 May 2023 03:11:10 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D55CB1730 for ; Thu, 4 May 2023 00:11:08 -0700 (PDT) Received: from dggpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QBlHV49NSzpSyV; Thu, 4 May 2023 15:07:02 +0800 (CST) Received: from [10.174.179.24] (10.174.179.24) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 4 May 2023 15:11:05 +0800 Subject: Re: [PATCH -next v9 0/3] Delay the initialization of zswap To: Chris Li References: <20230411093632.822290-1-liushixin2@huawei.com> CC: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , Christoph Hellwig , , From: Liu Shixin Message-ID: <9b2b6dac-9a3d-efcb-9706-44f6df1fe2bf@huawei.com> Date: Thu, 4 May 2023 15:11:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/5/4 8:11, Chris Li wrote: > 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. You're right, the most came from zswap_pool. > > 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. Thanks for your advice. I've thought about it before, but I thought there is less impact for the size of kernel, so I didn't do it. > > Chris > > . >