Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp265103rwn; Wed, 14 Sep 2022 20:31:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR7afmBdV2QX8JTH2b5TKWQY+eFUEtUbU2GX3RGUs1r5ghc8K3J1ghrkbKwrUyXAGWeXB4vN X-Received: by 2002:a17:906:4fc3:b0:72e:eab4:d9d7 with SMTP id i3-20020a1709064fc300b0072eeab4d9d7mr27093368ejw.599.1663212687306; Wed, 14 Sep 2022 20:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663212687; cv=none; d=google.com; s=arc-20160816; b=0QQBGL7KnFWiogE69Uz815s2lobVTUbM82N+mXdevWuKyr+7bBt7mYSno3AbMOIGPX k6OZ7P8UssSHC0qEw0v0yhJR0jgn+aapgiaJyjWn+ZVOUtbQq5rGcXuty2NdiVFPyl09 WJ6hdsRq9/DZzceIiJiRmlaqRYuFDTahK5TWhk6/XJ2vu1Sr4+JgHCPq2GpG4vb/8F3m /8VkbFVd7LZgDhhKHTa+u9JJsGx7rDNgDQLmuljz6omBJsZiOvMT2NHNKVqapYGvw+CK hVh19ozgTt5nXg2oe/N6G5xAQwZ/eSJ+ssu+4h7duMe4kTGFXJ4X9h464TmLIwowVJ20 iANA== 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=BBCACH8+0eAP9Qs5GtT3WrHrOIEAPkQB3bZmHWyXokebRm1p6HnalOA5mR9sTnCmPB rSTlTI67ZY5oN1eYqQPKlkU90od0lYUE/Xj5X3l4M6Ifk2+mhc3+UyguAs957e1mYzFw k8B4L5+PnNUMBUC0hP21E7rimN6vL3YaMYwt5NeQSshLKOkGr5Rx1B0taIN+ElRHic7h OGmC0ZoIFKNRqTmPQE86zUDeZaY9tXdxO9N28qKqrEoNC7pbW1itGiGPuzB5EdojuWwm G/gWOpg/ywWz+IGcBNNt8DwGvzSDwe/e+Aj3Iacn1sLGFdH1wSWp0e+2ihWaIHwGcH/U 4c9g== 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 dd3-20020a1709069b8300b0073c14b6560bsi15586342ejc.177.2022.09.14.20.30.48; Wed, 14 Sep 2022 20:31:27 -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 S229875AbiIODQa (ORCPT + 99 others); Wed, 14 Sep 2022 23:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiIODQN (ORCPT ); Wed, 14 Sep 2022 23:16:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4254915F3 for ; Wed, 14 Sep 2022 20:16:11 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSj0P11MpzNmJ2; Thu, 15 Sep 2022 11:11:33 +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, 15 Sep 2022 11:16:08 +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, 15 Sep 2022 11:16:08 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v5 5/5] mm/zswap: skip confusing print info Date: Thu, 15 Sep 2022 11:50:03 +0800 Message-ID: <20220915035003.3347466-6-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220915035003.3347466-1-liushixin2@huawei.com> References: <20220915035003.3347466-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 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