Message ID | 20230325071420.2246461-1-liushixin2@huawei.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp235881vqo; Fri, 24 Mar 2023 23:31:36 -0700 (PDT) X-Google-Smtp-Source: AKy350bKPaQT9f2troH6GIIntsO1MrQDL1vHXnGFc0Ls8Fi/1IxSC6zdpw0KUY8SASWLCk4ABvVZ X-Received: by 2002:a17:902:d501:b0:19c:a9b8:58eb with SMTP id b1-20020a170902d50100b0019ca9b858ebmr6262553plg.12.1679725895750; Fri, 24 Mar 2023 23:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679725895; cv=none; d=google.com; s=arc-20160816; b=OCmz6iFgpkU8XvRy5CuOLoG6IaGcbtdH3YHvx4Ikgc7XIxzcyee20qxBbTq8xh+D90 azxNZGv2pME5IzBIX4i/e1SLOo4n9JET1Lv7tufw54Q+9+rhm8jPYzlA5CGkNpGeII9p sTxQ+BmpQxD0g9l7H78InDVYuucA+14oK5REto3YN1OMgTFa61GoQpwBOzP/p9SKEiTq Dnw1BbFCKj0xs9sc2p3WVn2vD+h0OIOr9M/IstDFH4eSO3AMP6AWlpJW3cxB9T3OTmfK pgp7lQyHSXy5/wKHDLTId9Un+wqN/rGHLsxr13PnEe4GvHPQn24DSPuIn5kKpSth8qHE grcw== 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=YqRJjmGqyFTC/0k/czhpubg7zFqQ7v4LwXzVttNzS/o=; b=HJ/73KS/3r93C+yigduEZAlnh52rJp/MIDtXSy5UlmSdwThSoLG3H6p1KVmUAUuEmD 0zqR3c+1qU6UT6ORWpbJ7NrmEgoZe+5eyYMCDn9+ILMh8Hqt87TLFEiOQErUL3EakwMu 6B+I6nDSWMMZ2NPil1t4fI7jae11RCtQYQy7XZ6XWuhMEkmBqae448dQLKDlDmQLOUEI 8tn56r4jYqYb71xAj/c/EfPJCS5L7F21c5jNTSWd3zNXagGz/5o3XdiXRuDcOV6KxCvJ pfyyeNPWpoYdvjwuzFA4wR577DTJjf00nHEkMkI3XSp/P2X8r6tGR0Z6XZb2mcwT7jzG Sf5Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a634659000000b0050bcf249337si20949585pgk.502.2023.03.24.23.31.23; Fri, 24 Mar 2023 23:31:35 -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 S232087AbjCYGYc (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Sat, 25 Mar 2023 02:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbjCYGYb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 25 Mar 2023 02:24:31 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01FC315174 for <linux-kernel@vger.kernel.org>; Fri, 24 Mar 2023 23:24:25 -0700 (PDT) Received: from dggpemm100009.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Pk8DF1KNjzKmMW; Sat, 25 Mar 2023 14:23:57 +0800 (CST) 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.2507.21; Sat, 25 Mar 2023 14:24:21 +0800 From: Liu Shixin <liushixin2@huawei.com> To: Seth Jennings <sjenning@redhat.com>, Dan Streetman <ddstreet@ieee.org>, Vitaly Wool <vitaly.wool@konsulko.com>, Andrew Morton <akpm@linux-foundation.org>, Nathan Chancellor <nathan@kernel.org>, Christoph Hellwig <hch@lst.de> CC: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, Liu Shixin <liushixin2@huawei.com> Subject: [PATCH -next v7 0/4] Delay the initialization of zswap Date: Sat, 25 Mar 2023 15:14:16 +0800 Message-ID: <20230325071420.2246461-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: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761320260857316635?= X-GMAIL-MSGID: =?utf-8?q?1761320260857316635?= |
Series |
Delay the initialization of zswap
|
|
Message
Liu Shixin
March 25, 2023, 7:14 a.m. UTC
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. v6->v7: Add two new patch[1,3] to cleanup the code. And cover zswap_init_* parameter by zswap_init_lock to protect against conflicts. v5->v6: Simplify the code and delete the patches about frontswap suggested by Christoph. Liu Shixin (4): mm/zswap: remove zswap_entry_cache_{create,destroy} helper function mm/zswap: skip invalid or unchanged parameter mm/zswap: replace zswap_init_{started/failed} with zswap_init_state mm/zswap: delay the initializaton of zswap mm/zswap.c | 94 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 33 deletions(-)