Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp673590rwe; Thu, 25 Aug 2022 07:21:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7sj7M3wOZQDfRKjiywsa7Gw36fiT722ERtgtpduuaJWv/PPh9mipE0N1otDrUI5NKAAbS+ X-Received: by 2002:a17:907:1c87:b0:73d:d99e:5eb9 with SMTP id nb7-20020a1709071c8700b0073dd99e5eb9mr1027658ejc.418.1661437270660; Thu, 25 Aug 2022 07:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661437270; cv=none; d=google.com; s=arc-20160816; b=04eYS4BWoeTtXgkiwE8hfVxq/vtel8kUt0nWHblqYDG7S3cScvRE3eWrHC/1yK19ZZ fXM16YUPXnr00JKyM+EnGaF3AaqWcSyXvCkxzG4AMWxxdQtCsBgXOJ/Q8QiGl+uqyYtu A+LKNIMs6oSwqAqADn4PeQu7QCPI/FiPiXtsbv6wOa5wxqzl9xJahCJxg7awq0PxT6IT DZgebgJR6gDXYgQ4FclsUOV9VvA7HVd6Ms6CW8SUo+jVKuC0GfJBNInapea5sIUxNTXo Ih1GcmzMGZvEw19ydQLaUIQDN0yxvsJCwxFcpCpN3hPDMCSzPj7YQxDRX0LUOfhsSKcS lJQw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kREl+HX35btfe5q9SNQYsCKet8XFZmzHwleKEODBnYU=; b=VVsCR7L0ODef07WAlGMTNMta54uuFWK1Tbv/NcdnKUqH1Muoihd1QKFhRF2WlhB6K4 Ce/zCxlbWJ8Gpe+FCDpIerLOGPeDSadva1V63e5OHh3zff9RF2z6zTwa8qMHbBbInKDg 654bqpl7b5atH6kPok1q3sDqP0/tCCg/rNxFO91TUek9cdOUwOXhKqNMxr9178myoQkh 1z8TAZPBKJ1BBsFfVpuqTquGb2dxpDoxfT0VuHszpJr3hdrYPOlN18JwkjzIoMXHJt+X FPay1hs/kMc6VZOfH9iTuQSgx2LTAbO+OomEeO8tF8Q98PzgxpoGd8VBkZhwTQLzZGL2 k9jA== 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 qw12-20020a1709066a0c00b00730aa841c5bsi4206147ejc.964.2022.08.25.07.20.43; Thu, 25 Aug 2022 07:21:10 -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 S242108AbiHYNqF (ORCPT + 99 others); Thu, 25 Aug 2022 09:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232805AbiHYNqD (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 25F2A26123 for ; Thu, 25 Aug 2022 06:46:01 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MD40M0Dn2zlWWy; Thu, 25 Aug 2022 21:42:43 +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, 25 Aug 2022 21:45:58 +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:58 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton CC: , , Liu Shixin Subject: [PATCH -next 3/3] mm/zswap: skip confusing print info Date: Thu, 25 Aug 2022 22:20:37 +0800 Message-ID: <20220825142037.3214152-4-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220825142037.3214152-1-liushixin2@huawei.com> References: <20220825142037.3214152-1-liushixin2@huawei.com> 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 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 90df72aceb08..fdf376f239fd 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()) { -- 2.25.1