Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3122311rwe; Mon, 29 Aug 2022 06:16:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR7zHqAVcT61Ird6CRUnSXTDqahIBu+0T85gtt//WWrdSKus032hYMGbrRtBIz//+QQj8L2h X-Received: by 2002:a17:906:668b:b0:730:a5b7:8985 with SMTP id z11-20020a170906668b00b00730a5b78985mr12935630ejo.548.1661779000269; Mon, 29 Aug 2022 06:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661779000; cv=none; d=google.com; s=arc-20160816; b=K2U8RLrOFtcB609rCHYs2eWMoZohuNhRlxWRnrSfXOq/3WqgzrpI+byDl/0Ua0C3cK OoPsZQq2Qx1o4hkA9s5fWSobJyaEzEYQCs/XMrZvo6D/trZdO5lykOYGMHyATlTsXp8l Trw4MCyedNExDxpPe/JMAZZCkCmdYBmQCvFjfUaKovWPflq9gzoU9DxTnAL/mVrNjDtE SpOh5mq8xOMYHoL8pDflz2nE5uy/gvrb4lMxuRYp0F2ClyuyLGTAQoJEHtdivvSO/WwX 8B3WxqyUy0jPCjEOirWfVtvCK/nhROp1w1LNexzQvtVnnjgPvZVMMcnYTVH4cWsb8zEm d1cw== 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=P69z2S0SegPKg6qoDY8U8vvnv5s86IAnvPnUOrOOzHU=; b=eRkSd/ohGKuGt7/CZhFtxJ+2CxTDsipaY82Hh/HL2WyEiAdXwhTG0dIa8pZnj8/18f GhefHozIwkB9R8fSOrsvNtNuIBZaRQ6G4DUXSc5/OuxowWSPkK70Bwk5jcADVCFk5JhN N4LnlYZQHw8UybfnEOwL0oSk+6L4XLwp0gHVBxudG0MFjTQe+0ZWi/csJf+rx7qd6Aav E8wAgT3cDWww+bbcZ8ScRmLa6kfsNKTT61QvjD6LKyJKkDGvG19zJQT/S4qPJIMTW+QJ OMjDk91xN8Cm/7dWUyhOIsnHVXPixpehqdzsekY3EE4AKiFb65gRgQ2EZB4l9a+Y54yN vEXg== 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 dz13-20020a0564021d4d00b004486942c31bsi3018676edb.274.2022.08.29.06.16.14; Mon, 29 Aug 2022 06:16:40 -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 S229817AbiH2M6a (ORCPT + 99 others); Mon, 29 Aug 2022 08:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiH2M4j (ORCPT ); Mon, 29 Aug 2022 08:56:39 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8281D5586 for ; Mon, 29 Aug 2022 05:48:40 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MGVZ43lG1zHnW5; Mon, 29 Aug 2022 20:46:52 +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; Mon, 29 Aug 2022 20:48:37 +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; Mon, 29 Aug 2022 20:48:37 +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 v4 6/6] mm/zswap: skip confusing print info Date: Mon, 29 Aug 2022 21:23:02 +0800 Message-ID: <20220829132302.3367054-7-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829132302.3367054-1-liushixin2@huawei.com> References: <20220829132302.3367054-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: dggems702-chm.china.huawei.com (10.3.19.179) 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 dac1714c7eda..be466ccf489b 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