Message ID | 20230403121318.1876082-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 b10csp2226466vqo; Mon, 3 Apr 2023 04:27:26 -0700 (PDT) X-Google-Smtp-Source: AK7set+sx8L8xU7U1lupSU0yHjigGF9uBHrFLNUvd1LphPS3+ZKGJR62P+M9SQHb225hV3TXyhoP X-Received: by 2002:a05:6a20:bca8:b0:da:e44f:5284 with SMTP id fx40-20020a056a20bca800b000dae44f5284mr26613699pzb.30.1680521246603; Mon, 03 Apr 2023 04:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680521246; cv=none; d=google.com; s=arc-20160816; b=otIkQMTF9GXfiZ6VEfo34w3s+CqE0vjer67nD5oLDBfEIv2Fm/EQDB/oF/KHrO7gy+ +HGxywU5kp1n8ruhjvo2klVQfXtzn3a+dnVXYYH0TYnMqGVsWJiCcdyIqabzoCSH2tZ4 WWbwqh+qJ2+6Qqa6NEs6IGrp0kFn57XxmUUOQW8k65xetAgG3Swfu1aB9JZdtFGnTwTa FVsOZaG8C6lnviDYND1XTQlsre+RNY8o+9WFPZcz+vh9zwoFCxYbDUsNqqvbYFuf/PkA 0Sp130gXXarQEC/ppsDpHqYiNV6fBViu+q7ElZafaWGNw6uKJGrM93K+jOVx9sk75ES6 Vz4g== 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=b4J1RkZFNn+HR6T4U6Y+WUvddZnJ0U0PI7FKC631Q5A=; b=IfdzYGZA4wwgPqYcTz7LwrWoZ+qppgV6CrupFZ85FhcAuQas6sj27s+P0zIFD0Kzh2 t31p9Q3FDOBprNqYVbQMbFuxEmhsMsBjx/miST0/4Zl6TNVYaZkFnx6+uQw15BmO1VmJ XBytE1rVh0j3Ed4R1Pc9siQFEBtDkUM/aG/PdXYOEhQxRtFN58WVFIHtgkYdXkTpZ2kG 2Kd+BwT++JXe340GB/6ynpi9wFIYsEXBuo2FzK9NRXCibpdpBenktzfa5fkENL4KHpql rChrVaSQlh/hxJS07GDhx/oWys16C/z/GKWJmGfW7ym0wZ1aOb8OEbDuE8U+tUbJUZNQ wedg== 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 e16-20020aa798d0000000b005a919e42b9esi7914734pfm.196.2023.04.03.04.27.14; Mon, 03 Apr 2023 04:27:26 -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 S231967AbjDCLXY (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 07:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjDCLXU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 07:23:20 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A9B525F for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 04:23:18 -0700 (PDT) Received: from dggpemm100009.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PqpMX5QxQznZnC; Mon, 3 Apr 2023 19:19:52 +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.23; Mon, 3 Apr 2023 19:23:15 +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 v8 0/3] Delay the initialization of zswap Date: Mon, 3 Apr 2023 20:13:15 +0800 Message-ID: <20230403121318.1876082-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=-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?1762154246415799419?= X-GMAIL-MSGID: =?utf-8?q?1762154246415799419?= |
Series | Delay the initialization of zswap | |
Message
Liu Shixin
April 3, 2023, 12:13 p.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. v7->v8: Do some cleanup. And remove the second patch in v7 which is unrelated to the initialization of zswap. 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 (3): mm/zswap: remove zswap_entry_cache_{create,destroy} helper function mm/zswap: replace zswap_init_{started/failed} with zswap_init_state mm/zswap: delay the initialization of zswap mm/zswap.c | 111 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 43 deletions(-)