From patchwork Thu Aug 25 14:20:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12954733 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 A3D35C64991 for ; Thu, 25 Aug 2022 13:46:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33E0C940009; Thu, 25 Aug 2022 09:46:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2ECE6940008; Thu, 25 Aug 2022 09:46:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B4D5940009; Thu, 25 Aug 2022 09:46:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 08FE7940008 for ; Thu, 25 Aug 2022 09:46:03 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id ACB5114052B for ; Thu, 25 Aug 2022 13:46:02 +0000 (UTC) X-FDA: 79838238564.29.4A2C120 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 0AC724000F for ; Thu, 25 Aug 2022 13:46:01 +0000 (UTC) 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 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=1661435162; a=rsa-sha256; cv=none; b=bVVfJgWS/GikRRHzyLwNQmCfrHyKShXUPn4bbtg9z+zDaEFCHPHBeJ1eYnf1ZsHop3n9+0 f+kjEcMpbTreOC4mgtAIuR4g9sl4oWmaLQTPwmrAIrEEGyn9NhURXTViQ6gYlDXsi/MEEU tH6VY+2GtfoGOrNQmfiqzZMdDbvE0d0= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661435162; 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=kREl+HX35btfe5q9SNQYsCKet8XFZmzHwleKEODBnYU=; b=Eno+SPE0ON7Ey3UWqYZv2tF8rYwyj1qV1kyoYLas+6y9U9l+FGVFtPTUmkvCKgFvkiKdBn N/j87tnYKMZCwbju6yuI10pMs0kGAChn5TGWa2LzfgbuU/SlAIAewUHo9u9xMpMTFO5YpQ OOKaPh2+aIp1yI89PsyG0ZinP38GQgE= Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.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: rspam09 X-Rspam-User: X-Stat-Signature: tjcpparb6gd4pdyrhosnt6jtq71etxjd X-Rspamd-Queue-Id: 0AC724000F X-HE-Tag: 1661435161-351065 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 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()) {