Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp75804rwe; Fri, 26 Aug 2022 00:35:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vqXoiklDBgKdt/CjFvSGzklPItE+PWcgR7GDfNHFmbdmqUzIdeZPygM+jbK+mQ4t/F6Fi X-Received: by 2002:a17:90b:1d0b:b0:1f5:6554:d556 with SMTP id on11-20020a17090b1d0b00b001f56554d556mr3029466pjb.168.1661499327082; Fri, 26 Aug 2022 00:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661499327; cv=none; d=google.com; s=arc-20160816; b=jsCF/CeBXDzR1oOXaOD325qsNWc+rMYX+5ZJXIUhXdvMCBkvINHjQlUZx5VBp0Nwzt O9HUHZm1aj4lhHvDsPR7UzB15/NnW7tyXMt5iAPQ/OHhWWyIeJYEpCrbjdwJ1aFbLcC8 VFvsldB+EWY7WnEFBRBnIVTsPO8Fq0272OcvDe7bUI9AoN0pNhCJ9dHdyYR1HOSURjgn M2zcIAgSDayA4KjKSA3ATehCWU/SS1DYPSfLnr/cfnrp39j7MF3XfbbmswmN71lEiMZA jGa1GXdd+y0JJSPaoLbi02L04E09+Yg8GnlsCdnuvYJGwV6J6rIrGj3F4UCn5ktL/gZ6 i6WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UtS38zuynlXPkBZYmIQ86cDIK65mENPCJyOo27HEEFk=; b=IUECDl+msTQ8CSZjJq26vE8erw27ACerH0PtnnB47gjOHdVTkKnhzbAqn9yY1a3jOS vKJeseA9nyXgdfSvxrbqoeSQjobaL93pL0k7lap8YoIdIHbeFZ8ykRjY+SwFZ6SNb89X 0JnvQk2FZ1zryF2ynfdxkOx4NxPP/BhxU/B8Zizbwi+PtH+zTLALb4RtqTVSf+BUioU/ jQKA0Gd9bli6r7Bal2CStD19JAfb4DZQWr6M6/aBxuD9vCr/b+l9LTyp1poT4+0znrh3 63cmxRexFbLhF9giyPMICjEUsgM8RHXKJk2RNikzHJAdcz19UKn/dSxLSYiUnFkAZF2q hiTw== 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 l7-20020a170903120700b0016ed87fd1efsi973143plh.467.2022.08.26.00.35.15; Fri, 26 Aug 2022 00:35:27 -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 S230207AbiHZHAF (ORCPT + 99 others); Fri, 26 Aug 2022 03:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiHZHAB (ORCPT ); Fri, 26 Aug 2022 03:00:01 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8AD153019 for ; Thu, 25 Aug 2022 23:59:59 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MDVx50L3HzkWK5; Fri, 26 Aug 2022 14:56:25 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 14:59:57 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 14:59:57 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH -next v2 0/3] Delay the initializaton of zswap Date: Fri, 26 Aug 2022 15:34:29 +0800 Message-ID: <20220826073432.4168976-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 In the initialization of zswap, about 18MB memory will be allocated for zswap_pool. Since not all users use zswap, the memory may be wasted. Save the memory for these users by delaying the initialization of zswap to first enablement. v1->v2: Change init_zswap to zswap_init suggested by Andrew. Liu Shixin (3): mm/zswap: replace zswap_init_{started/failed} with zswap_init_state mm/zswap: delay the initializaton of zswap until the first enablement mm/zswap: skip confusing print info mm/zswap.c | 77 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 19 deletions(-) -- 2.25.1