From patchwork Thu Aug 25 14:20:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12954731 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 3A55CC64990 for ; Thu, 25 Aug 2022 13:46:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86FA7940007; Thu, 25 Aug 2022 09:46:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81D166B0074; Thu, 25 Aug 2022 09:46:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E4E3940007; Thu, 25 Aug 2022 09:46:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5B9166B0073 for ; Thu, 25 Aug 2022 09:46:02 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 313A3A0354 for ; Thu, 25 Aug 2022 13:46:02 +0000 (UTC) X-FDA: 79838238564.24.4F50DBC Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf02.hostedemail.com (Postfix) with ESMTP id 421F180009 for ; Thu, 25 Aug 2022 13:46:01 +0000 (UTC) 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 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661435161; a=rsa-sha256; cv=none; b=a3LAYtdLWyZx6BY+OHvVEPETw/bsYD1epOnH42Oco6EhwSt5Lh66kBAS/AnWuzulHtfO0m sMmJ5Lug5SXnlgsP3Wx2LtDhmzI/7oQuUO8k5VxW5jkHdR5yg32tF5Rxt8GkV7Rs5nejMu JgI1dQptAEXzVnOaI3h6SkhZaSmGsYU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661435161; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=4kB/UjD22MO1vaenAepPjDlzxu/vlAcKZ5VK4GftFYU=; b=t7qmxPnjqSe15c1Incqy/5+wm08RUoyEKBs+IBTezUYWxCQJFjFVfvw4a8r1B93eDRZ8Ds CPa/lzO3NLODGU5nAHKKRuqCqFK9kVK7hWYVRxfVvsSX9/CmsDJKq6rqjClW2MbPO+vTqn NEUwxXLhRoD2PrMMDjPl0LkaUWcPHN0= X-Stat-Signature: 9qnwrfjzund1nfbcwt7sxnn3q1f37ryu X-Rspamd-Queue-Id: 421F180009 X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-HE-Tag: 1661435161-962794 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: 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(-)