Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2125503rwl; Sun, 26 Mar 2023 16:32:30 -0700 (PDT) X-Google-Smtp-Source: AK7set8j7HjwuZFx2rNntSxkjQpA+lyNJgGXEtPQV5tnzkbuVv6LwYTawTWI63nKdVzhv2TGe+7u X-Received: by 2002:a05:6a20:bf2a:b0:d8:d720:7fa with SMTP id gc42-20020a056a20bf2a00b000d8d72007famr8218997pzb.0.1679873550061; Sun, 26 Mar 2023 16:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679873550; cv=none; d=google.com; s=arc-20160816; b=TGD9M1FWynncFqgRPye+Z0gc4crFzW81Ik8z7BrWMkpEPvTfl9w72zDn7oGpkjYOOr tAZBdvB0sVr5rXv29u+a8abJzvRx4mFwgF+0L4r3gQXPiKeLw1ZkOQqpTSb38ql+BmaY DRLVOEmoO8E36A5z3rf6xBNSJ3IJS7Ro+6WXXWcIHZsFf5OXS3tu+ikNy68lBXUkNNuc qul9AwQXOBYhaJl5qYEL2qmLiAQKzrRayGpzzKx8VOENcs5hb67Sie7ZTxIAO7cFs+UU cLPSQO9boV4BZP9hopfz0cU5YBf351e4/0EALBH4pzS1RHUC9Xd/WMEdVfp3h2l37qnb RTXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wEh1v7PHK+ZETJ6Q8RPQEIvDKmHW77CNRkNCzaWd2mI=; b=kx7SlRziCyCbTFFHZ5A6ipy7aqgF4dzkIuhlcvZ53z5+/IvxxxwjXPVyyWlyhCD4aN C6WvfQgTnTzGHek2oy0ELyU+roIBybZSDsFUyUS9uEq/ZpxlgFWGInjHPQWhMw0bv+8J hFSMrNDL5Ef1u/rXOnGy4Ks1q5W58cQ3GVIAQxkkEHT/BicVKNx/49804pDPDq51VrW0 sd74HZ+FF6sc7nrF8HU8iXdYlD/3hm3f5aXg3YPU3dZ+D2+hdLwxN8WSDEvjcFovaTid xs8t+rQg+lNj7jMn0RBt4iqryzKrvnw3JAHrzvMwHgEH1DrOwCRcXtXz3tt3NkBqx17e k8Uw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020aa79983000000b006282169cc74si6190365pfh.222.2023.03.26.16.32.17; Sun, 26 Mar 2023 16:32:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbjCZX3W (ORCPT + 99 others); Sun, 26 Mar 2023 19:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbjCZX3V (ORCPT ); Sun, 26 Mar 2023 19:29:21 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1280259DB for ; Sun, 26 Mar 2023 16:29:14 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id B7DFB68B05; Mon, 27 Mar 2023 01:29:09 +0200 (CEST) Date: Mon, 27 Mar 2023 01:29:09 +0200 From: Christoph Hellwig To: Liu Shixin Cc: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next v7 4/4] mm/zswap: delay the initializaton of zswap Message-ID: <20230326232909.GD19631@lst.de> References: <20230325071420.2246461-1-liushixin2@huawei.com> <20230325071420.2246461-5-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230325071420.2246461-5-liushixin2@huawei.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 > @@ -1480,11 +1500,14 @@ static int __init zswap_debugfs_init(void) > /********************************* > * module init and exit > **********************************/ > -static int __init init_zswap(void) > +static int zswap_setup(void) > { > struct zswap_pool *pool; > int ret; > > + if (zswap_init_state != ZSWAP_UNINIT) > + return 0; I feel like doing this in zswap_enabled_param_set would be a lot cleaner. With that we could do a switch on the possible enum values for zswap_init_state there, and that is a good way to explain the possible outcomes.