Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp654266rwe; Thu, 25 Aug 2022 07:04:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7GzwqsQrLqJVuEyhcaO/N3fwXzk6Q9RpWfbRozwcOMiwEVkhmWqHPN+zQLmJcKNL8NFkSi X-Received: by 2002:a17:903:41c5:b0:172:fc8b:d186 with SMTP id u5-20020a17090341c500b00172fc8bd186mr3956091ple.90.1661436295529; Thu, 25 Aug 2022 07:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661436295; cv=none; d=google.com; s=arc-20160816; b=uPzWS1PQsV5inMEWLB1JoQdoxbRKGS1j48WLgcxwm4BIoBeFOpN1HJlMcuRrgc1cna nndDfp0kRofMzFUtE1EIKLJKXddidoH5RXoFEZeOHG9DBvDIQ76EfG8Y29HwmnGz733J AG+U8jG0aarOp6p9rP4D//nLszZEgkQmjXzM49ysqgure0ZBzp3Th5vQrQEldBbBcAVv erJ52688f9AsU5qW4B2m7bUacAhQdDrRqhmh1RsG0OwAAHYg1Kf6luKQTP8R9ATgjMqw bOtl7XiYomzPOg/ZW4zAkyvRtjeXcb0QFR5IN8rXufTsb25DuK4VxOb+dENBW1O2RPIA MyUg== 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=4kB/UjD22MO1vaenAepPjDlzxu/vlAcKZ5VK4GftFYU=; b=m5w161GeVk5DIleUg88nyRS6snqHC63saRjYS3jUEUu7gp5vWBDnZ0AIQW05NhE/g4 RChc1nV6PhOZi0mjJfd+SdEfERE+wJHUZ1qrMFqk4TK33GxS2JchbsnqJrJbsWEDrZe8 GyFpclV9eqRAupS8O3o2qRsz3mPvNUVucQW2UAeQGO/LflbAuYDWVx4pDALTeZj/dVkK FgArV4RONbuS2y8B9yiU+evc17UGrzBmOJCpknqlfa8Ilanj51P+9eY7p22ZFeeFWCay BWUsgDK6y/3Vyu8VLDZhnfuqvxQLqtO885u5OfDATbgVop8b6XxlYwjpLnd7d6h7yv4c 2jTw== 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 e3-20020a170902cf4300b0016eec1292e4si20063497plg.500.2022.08.25.07.04.20; Thu, 25 Aug 2022 07:04:55 -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 S242628AbiHYNqI (ORCPT + 99 others); Thu, 25 Aug 2022 09:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239454AbiHYNqD (ORCPT ); Thu, 25 Aug 2022 09:46:03 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26088286F4 for ; Thu, 25 Aug 2022 06:45:59 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MD40K4064zlWKf; Thu, 25 Aug 2022 21:42:41 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 21:45: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; Thu, 25 Aug 2022 21:45:56 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton CC: , , Liu Shixin Subject: [PATCH -next 0/3] Delay the initializaton of zswap Date: Thu, 25 Aug 2022 22:20:34 +0800 Message-ID: <20220825142037.3214152-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: dggems703-chm.china.huawei.com (10.3.19.180) 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. 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 | 75 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 18 deletions(-) -- 2.25.1