Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1225767rwe; Sat, 27 Aug 2022 03:41:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR51W7QKaAMrMXqiHeIXsuEbI2ooohQyFlMpmX3ti0QIQdlCmZ/OpdjBQsEeRULU+/TrgT9+ X-Received: by 2002:a17:902:d48a:b0:16f:51a:252a with SMTP id c10-20020a170902d48a00b0016f051a252amr7489944plg.71.1661596895790; Sat, 27 Aug 2022 03:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661596895; cv=none; d=google.com; s=arc-20160816; b=S+DrfI6RUqQOMGHecWI23bmfSv7BcJQDv7hRu0VElsfqgpawkV51gsHCF8+TYDUYNW 2qzfBBn3abCiRvkbvnMTDblV0CkvU4wMAb6BmkquGnxXsgnNukArcTmm1KnfA/yQxQA7 E6WRhPHyuJlZI5RH8nRaZCbAzJiyQUbteek0fZgKxu69WvyZFGJbZIGFDletn9Ftg1WU Gda189fvwrLl3yWtr85GgGPPdgO8JlHnb90Ap4lHL6rUeKusKm2q0uC0G1beGugqV1ND 7SjfSYOQK5kZGBOWpE57hWYVXsM1ZGlPRlrnOkuLcxMdgF7sx3y+y1Pcqg8hOskA+WlT 81aw== 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=TaHdkKF7KJuOiNq3t8yVhb1Sy5jct/JSQZ6uzSmzf2Y=; b=0i7/8dED1qw75trLdr52oyBemf71NdkX+N5jd/+3NqTxndnJrp0B9+FPXSjaGxUyb7 3OjqIa6bLOGR1YuAEuZB0YkfKvEpQLCVzuOO9BuM03bDLokUbC4i5lGO/vOS6IcF00Ql fNx8H76/ioR5dsCPV18lQyrhRx9UwrU+iszLoCpXEY8cgiJNVcHJUGLxFl0ynJlGfh72 Ot3upnO87zPzNNNMpyvJEW56I75oei3rDzvicyECgoZ7iP12yDajhYlppuqy3rihr4gl J2g0M6DDjXF+9RHt4MXqs3zcAR7f3VDDRTxVx3NEvhbI+ZeZfPJlIdsI1Z3lIq1JQJhq b5FQ== 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 27-20020a17090a005b00b001f307a7871fsi3983612pjb.45.2022.08.27.03.41.24; Sat, 27 Aug 2022 03:41: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 S234417AbiH0KMC (ORCPT + 99 others); Sat, 27 Aug 2022 06:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbiH0KLs (ORCPT ); Sat, 27 Aug 2022 06:11:48 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C617252A9 for ; Sat, 27 Aug 2022 03:11:45 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MFC7t0Cm8z1N7Kn; Sat, 27 Aug 2022 18:08:10 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 18:11:43 +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; Sat, 27 Aug 2022 18:11:43 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH -next v3 5/5] mm/zswap: skip confusing print info Date: Sat, 27 Aug 2022 18:46:00 +0800 Message-ID: <20220827104600.1813214-6-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220827104600.1813214-1-liushixin2@huawei.com> References: <20220827104600.1813214-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: dggems705-chm.china.huawei.com (10.3.19.182) 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 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()) { -- 2.25.1