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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3F66C7EE23 for ; Thu, 4 May 2023 07:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18D2D6B0075; Thu, 4 May 2023 03:11:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1150E6B0078; Thu, 4 May 2023 03:11:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F20386B007B; Thu, 4 May 2023 03:11:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by kanga.kvack.org (Postfix) with ESMTP id AA0086B0075 for ; Thu, 4 May 2023 03:11:08 -0400 (EDT) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > > . >