Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp158400rwr; Thu, 4 May 2023 00:31:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dIAUokRc+yQ9iz6T3mZXvEP+9SP24S+K3UBeyIoEsISQTQ1gsg+MsSBn44sLXzPvDFYQi X-Received: by 2002:a17:90b:198f:b0:246:5787:6f5d with SMTP id mv15-20020a17090b198f00b0024657876f5dmr1551161pjb.10.1683185483181; Thu, 04 May 2023 00:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683185483; cv=none; d=google.com; s=arc-20160816; b=u50SHUxVhKzYQHClEQNoEsUGjGYJ6NcO9kpahQtAREC039F7GJkwfgm3DMJbqGibpP TOl4jsTOD+91E5mbzHbFfaqP0kabsoFc6mLI+IKWTZnk032VL9RnncIMVjBhyLCe5YMN KsLE8GTTWzJmhdAPrOBRJgRxGyIzzD60fvj+b2McXZoH4qWNJw3a8UlbRsLksYLO0mIw 21EcbRzytJ+mNjKQs9jPgPgkT1Rkqhq6gQDxjpjzmGJECLuIharKHY5avnj8iRgW/To4 OhXUoe8doFHw+kJQTfXlapI9udZtPaWNLcHmnUAdym/d7S0Wv4QWomKF6h6y0vNNbIqB twXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=vRSEJeSBXSW7VHInhPUqnThwJ61iDcTCvJBrTcVodvU=; b=iHhrEPGKLExR8HKQ1MwZDSRmo4DC6jQ03kImmh9C3ftnDo4nVsYmVYLiSRo0S4FL2Y YEpsdE29NZF0cR7xjDg4M0JfpvZ5qoGb21eRkf3nOKU0P0rGBXR2tJjVUS8uiPvO502q M3vLoK7ULC+pps+zbNRLFlcEuqndxs/vS7e5AQGxNvF2jf1MDC/MbBOwWtZnz/an6v8J 0TEWU/odHqS8eWsArDkplONhbdaxAlBH+mW8zZm+XqsbFWKK83obCAHk0jcDDRcvihzQ z5QsWU58js0TKU296n5kLvgJx3fhEGkN3wWc1s5CeiYYNYDVqQBuSYsU6Gb1au7m+J6D fqQw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a631d09000000b0051b5de41857si6587739pgd.101.2023.05.04.00.31.11; Thu, 04 May 2023 00:31:23 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjEDHLL (ORCPT + 99 others); Thu, 4 May 2023 03:11:11 -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 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 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 > > . >