From patchwork Thu Sep 15 03:50:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12976804 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 1446DC6FA8A for ; Thu, 15 Sep 2022 03:16:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC4128D0002; Wed, 14 Sep 2022 23:16:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A07AB8D0003; Wed, 14 Sep 2022 23:16:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89A528D0003; Wed, 14 Sep 2022 23:16:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7F7108D0002 for ; Wed, 14 Sep 2022 23:16:14 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 55C20405D5 for ; Thu, 15 Sep 2022 03:16:14 +0000 (UTC) X-FDA: 79912856268.06.EF06477 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id 13C664009B for ; Thu, 15 Sep 2022 03:16:11 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSj0P11MpzNmJ2; Thu, 15 Sep 2022 11:11:33 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 11:16:08 +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, 15 Sep 2022 11:16:08 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v5 5/5] mm/zswap: skip confusing print info Date: Thu, 15 Sep 2022 11:50:03 +0800 Message-ID: <20220915035003.3347466-6-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220915035003.3347466-1-liushixin2@huawei.com> References: <20220915035003.3347466-1-liushixin2@huawei.com> MIME-Version: 1.0 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663211774; 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:in-reply-to:references:references; bh=TaHdkKF7KJuOiNq3t8yVhb1Sy5jct/JSQZ6uzSmzf2Y=; b=bV2r/vCr2UqbhdGC14gZu+pfFOfW5VxKJZcy0tnJxTYg/VBEDNqOJZRXf2NWhAp0nN3GmA O7I7l7wz7W7oF+AAMBmjhKNRMNdT7kk/d+ApLtOx2HfRahtkjzEf2mOu88Ry3SX6yTfkyw lKDIx1iJNCNVqSsPd3RlyrHf+7YXeNc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663211774; a=rsa-sha256; cv=none; b=49vRqxFnMKesrdqrdFrgqvBEdd8MieajEqjX+vGnmb6YsoKbnqZB2iSGC3wH7O5Pvu6SmC qT+mylGcfsXdg6OfLGjntCMJcX5RyY28HVshXg5v8xQvj1GMwBztwdQXZEhO+wybBCibFX tkwuQQIZwJar+x+W89WfjZNDit9Ss1M= Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam08 X-Rspam-User: X-Stat-Signature: umk463e1sgne5azpit43csb5ag3qraeq X-Rspamd-Queue-Id: 13C664009B X-HE-Tag: 1663211771-252512 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: It's confusing when we disable zswap while zswap is init failed or has no pool. If no change required, just return directly. Signed-off-by: Liu Shixin --- mm/zswap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mm/zswap.c b/mm/zswap.c index 4c476c463035..ef7463550e49 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -886,6 +886,15 @@ static int zswap_zpool_param_set(const char *val, static int zswap_enabled_param_set(const char *val, const struct kernel_param *kp) { + bool res; + + if (kstrtobool(val, &res)) + return -EINVAL; + + /* no change required */ + if (res == *(bool *)kp->arg) + return 0; + if (system_state == SYSTEM_RUNNING) { mutex_lock(&zswap_init_lock); if (zswap_setup()) {