Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1191955rwl; Sat, 25 Mar 2023 20:19:56 -0700 (PDT) X-Google-Smtp-Source: AKy350a5l8Sc9WKQFF/nYKvsME1hxcfsVNLAhAqEc8Zo91RrURMdqIqp/xOUTBZhvqTr30NSz4GR X-Received: by 2002:aa7:dc10:0:b0:502:1d19:d252 with SMTP id b16-20020aa7dc10000000b005021d19d252mr6956237edu.17.1679800796067; Sat, 25 Mar 2023 20:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679800796; cv=none; d=google.com; s=arc-20160816; b=T2DKB2VJ5EFPEuYHtfWmxmqhIxsOGqLHJ5PzsbolcCzWZvG/p8KZ7JBZRZA817Onpa kkuGewhG4GlWJm9A2L3mSDz7NLujq9zSD8izhg+n2m06dL0VtJ1TkZsQMTs+nPdlZs7Y AQA/pF/QY0ni0qRQR2DF0wxn7iFbMQ1syZ1Es3+HXSif7INbpjEhd2pTim7SEbwQuZK0 SFz+OVFrHzkZLvlboOitqbMH4nRRpgDeSuBsIk3uhKMdZ3zzuWT6EMJ7R86apcVrbHJF Ch9okQPHb9OvYefxbCotMf3xYKm3CWPGkFCXxrHptAFEhohIhQG/UFS/GhEbO9a0veEQ jJEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=haiHSIXyTrgs+nuMuGJ9uAsYLTzypzPClX75p2zdkII=; b=uDSOvb7cMEKHe9WW98UVc0YU+dKO6xNqZ6kZMCuQBRUPG+Cycyj4zO7nnF/+ofvPWs eXGWCrA/L5u9IiOeWLiK7lcUyXHmPAsE4BJZOj8Jn8fcUfiHqUcT2GqIAcUMtQ2aQ73y 1qSx419JRZbttworaKlnM3LqcxRyogLvgrrmcmL+xqOLtdNi3Im1wt0XD/PM1MCAndFY nOp7lgWkF74pF4FRjaHpThef5zgU7P3b7G75sCoEf7kPkJEBG6gqzSj8GAfGsMfB5VW4 NDRnqHGxouMnnUYCan2aQVUi0weqhsgLOww/Ssm5/3ACUz9G+t3wuaP+HWVJwfl3/vPJ wAqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OzELbhN3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020aa7cd06000000b00501ea9917c5si9740700edw.74.2023.03.25.20.19.31; Sat, 25 Mar 2023 20:19:56 -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; dkim=pass header.i=@chromium.org header.s=google header.b=OzELbhN3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbjCZDIT (ORCPT + 99 others); Sat, 25 Mar 2023 23:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjCZDIS (ORCPT ); Sat, 25 Mar 2023 23:08:18 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A6E211E for ; Sat, 25 Mar 2023 20:08:16 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so5476853pjz.1 for ; Sat, 25 Mar 2023 20:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679800095; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=haiHSIXyTrgs+nuMuGJ9uAsYLTzypzPClX75p2zdkII=; b=OzELbhN3X+YAej5ML0RVHSfuCdukvlLnpP0NlS1Cpbe3GvmV0qwE9FCZ1wEY3HfcFE bJPdtr4L+1YQmA63TEJq592M+mqxrw34NpadrLIDdPgsdxy68US2kIgzsTspnwG2bOcj nDa8PNpfTn7uqznhso9JlD8l6c3oATx1SXIcs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679800095; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=haiHSIXyTrgs+nuMuGJ9uAsYLTzypzPClX75p2zdkII=; b=eNoqQzsxLvyKQsxhfqO4HtziGDdcADmcKOZKFe5bvOafaW7rwI4dZSsjzSzlIWroU2 MAT9gnwp1sHPrB9TFfUJEPbKjfVp7+DiQ2NZU7H15UemlS/rU6FXIlalU1WSiTHCqn18 ELMkN5qIWxQTDMXVOP/4/osMgDb1fRC6S2PcTZ/dF/7o+kAJ+ZNljw5OuT1YNY8K86ag zX/P8ugpiKL5qlKABq6z2CwzGyk5uByQlfG12SY89glm3F2tG4T7NwQ07riM2xkE1GLD u7Y81UzPqv3rD3m13z3NfAou7ByJ5hA1eC5NE6LPP+1st6BoqrcLh4NsMxuPcKD/391x BnUA== X-Gm-Message-State: AAQBX9fIvIpKhSRv6wtvUN6mNXSKM9XY0d+DUk0PVEUlWsqD44vm5gld qYb9MSWDduMeWiVNuLg/LoH5dA== X-Received: by 2002:a17:902:f0cb:b0:1a1:aa68:7e61 with SMTP id v11-20020a170902f0cb00b001a1aa687e61mr6827103pla.33.1679800095682; Sat, 25 Mar 2023 20:08:15 -0700 (PDT) Received: from google.com (KD124209188001.ppp-bb.dion.ne.jp. [124.209.188.1]) by smtp.gmail.com with ESMTPSA id jk17-20020a170903331100b0019e88453492sm16730366plb.4.2023.03.25.20.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 20:08:15 -0700 (PDT) Date: Sun, 26 Mar 2023 12:08:10 +0900 From: Sergey Senozhatsky 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 2/4] mm/zswap: skip invalid or unchanged parameter Message-ID: <20230326030810.GC3269998@google.com> References: <20230325071420.2246461-1-liushixin2@huawei.com> <20230325071420.2246461-3-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230325071420.2246461-3-liushixin2@huawei.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 On (23/03/25 15:14), Liu Shixin wrote: > +++ b/mm/zswap.c > @@ -761,15 +761,15 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp, > char *s = strstrip((char *)val); > int ret; > > + /* no change required */ > + if (!strcmp(s, *(char **)kp->arg) && zswap_has_pool) > + return 0; > + > if (zswap_init_failed) { > pr_err("can't set param, initialization failed\n"); > return -ENODEV; > } > > - /* no change required */ > - if (!strcmp(s, *(char **)kp->arg) && zswap_has_pool) > - return 0; I probably would suggest to simply remove `*(char **)kp->arg` from zswap code entirely, it doesn't solve any real problem (as far as I can tell).