Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp71305rwe; Fri, 26 Aug 2022 00:28:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4QwWTQhZ4WO+3lqhC8+hWC5KVz48pxZ63COZPBtoN6dpTjDR/FTWreOXQs90OHPayO2tph X-Received: by 2002:a17:902:e94f:b0:173:d0d:c4f5 with SMTP id b15-20020a170902e94f00b001730d0dc4f5mr2525923pll.167.1661498892501; Fri, 26 Aug 2022 00:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661498892; cv=none; d=google.com; s=arc-20160816; b=voh0quzmhctdKUj5Pdwdi5mIEc8G9OlgqahW3XGJeraFtiRz0m6AowT8Aux8ORY/Q9 qM5yWIAtJgpp5EtgssolFTtUCPox8G9ytkTBnmHTBRq6y/zj4Kc8ojTQAvwk3A/t1afx FRUCzeZtZ3ePIG4+7Oz5QF1GTRKAz3yKJlK9tCDikq/PaRbp4oGcNmGyGzy3o70HAbo3 +BQy5g21yd8BsKv8efh8QsiHz/yrS94mJEFCcZFMIcGn8P3KerHXKKktLu2NQ303e3AA +jTin/Z0GBaGFhXJYx8wksY5G45U2HGk0kR8TFFi4BK2faaTpFEoM9pQusxC+C2b5a4K ugoQ== 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=OahUqFHF59IOJA8C0EtD1C7K64cLGRFMZJzoHwjN/J+EHmX3IgR+qzYetx9USQpiy1 bicjbKFjK6EZqn251TL2009ztNLsDnbHJ48yzlXibJAvGwFhKCknntNlWbUI2QYkkjCk PTF73j/LsW8EUcyyqsUtDymNQPLTXt/lesm4jKU2vV57Kxa35y00zubjzW4fycwVXVAy qUQnz2wF2GDUDjhQTrTYa5Zpoi0JNM7PEiW3iUaH4Tahq81D8TzdJ6cXf9eF+5NyH4oj RBhzpjEt2yPigqoOY/mBt3hz7wtunE1xQvbIvR481TDZtsmjUbNz5NuBRq9gh/0lnU63 /TWg== 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 a72-20020a63904b000000b004129ace9fe0si1011870pge.698.2022.08.26.00.28.00; Fri, 26 Aug 2022 00:28:12 -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 S244982AbiHZHAZ (ORCPT + 99 others); Fri, 26 Aug 2022 03:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244840AbiHZHAP (ORCPT ); Fri, 26 Aug 2022 03:00:15 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D92910AB for ; Fri, 26 Aug 2022 00:00:13 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MDVxM2yzPz19VdM; Fri, 26 Aug 2022 14:56:39 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 14:59:59 +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; Fri, 26 Aug 2022 14:59:58 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH -next v2 3/3] mm/zswap: skip confusing print info Date: Fri, 26 Aug 2022 15:34:32 +0800 Message-ID: <20220826073432.4168976-4-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220826073432.4168976-1-liushixin2@huawei.com> References: <20220826073432.4168976-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: 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=-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