Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1256092rwl; Sat, 25 Mar 2023 22:00:15 -0700 (PDT) X-Google-Smtp-Source: AKy350Ygv2rns62twSR/w/xV72CEcKgBEK2bLDPXyogJTi+nDW6WshR0KRVIVWNjaQCObnM8erj8 X-Received: by 2002:a62:1904:0:b0:5b4:beb2:2042 with SMTP id 4-20020a621904000000b005b4beb22042mr7742307pfz.19.1679806815519; Sat, 25 Mar 2023 22:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679806815; cv=none; d=google.com; s=arc-20160816; b=bQtzv1Uw7czLRHhhLUlXZDdKFWYvl8jStJNqUXS3HkkqYARUzUCHFRzFKiVjBJAotx wfjbyfkXmCCfrIjWnE71VvFxB62/ywgOrSrfirp29Ll4eNj7fADPTLltvfyOBl3jhC2f AkkxYY0SjN+Ahy2CBsgfTR6RfyTGbJ+3J5/+nX3ejErX4jiiYbnS3K5DDzipFIcvLvWP rdqt6JVOFSZva0W1O7aY8Wm3tXOuYRq4lh+Sqp4HhyMCbUSF3fYF7EK5hqVfFiXz8xj8 r7yaoWpfRKirU6YAnIE7f1A/1QGSplLncmvgJtu9FGmjMIen6JXhF7ldrCNqtAQMthw5 cEvg== 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=8QM1QHLHovDhJzAjlOXny2HDNK64Zjmklql6ekR44ec=; b=NHFn3zD93lPB0vCudylNZuIoxZEbXlxUZSFs/xjoYkZnJHEZj2hnAdWa/gr9MvaH11 8dHM//3Ku5f7Uo7Rhi1h/oXmQiSf0/6S5iqD/ej2zLKLI3hBAomt6A5szbqdW3zvlbej sqVQwQJHMUNSm5Kzfk0Ubrx+dpYka6TW0M2+kYL+h0QJNm6KxGO7ChKYAI3hw3VV2OZA d+xhiYOT6KxFX58LLWMkUcUQRvC/SShMQtAgGuYQ/S8ro5xxprnxvqZTgYGK1ve0/GRS 9G/1kNz/j0cy7vZnFXYrw8B/h9ip4R4H6JpjyjI8D1xbiOyfhnxClHdJOKMW75TVpcoX 7duw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IcxZxSEH; 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 h14-20020a056a001a4e00b00627fbc1cb02si18178495pfv.338.2023.03.25.21.59.59; Sat, 25 Mar 2023 22:00:15 -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=IcxZxSEH; 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 S231841AbjCZExf (ORCPT + 99 others); Sun, 26 Mar 2023 00:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231410AbjCZExe (ORCPT ); Sun, 26 Mar 2023 00:53:34 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BD1270B for ; Sat, 25 Mar 2023 21:53:33 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id q102so4946192pjq.3 for ; Sat, 25 Mar 2023 21:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679806413; 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=8QM1QHLHovDhJzAjlOXny2HDNK64Zjmklql6ekR44ec=; b=IcxZxSEHYLzyIPpHba6988UhJUOlViWxxsBecBnsuL8YEk7IOr6zBxV8En2Gn5XPVf qbvs9f7/6TVaV0SWoS/CM/yc6P8P9onTMCQ80z43nBhpoUtIAWIBln37NHnpcA/5mu+4 k2Y/Xd4RYb6lr7IjelqZIR9yFoHBBj5IY4RoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679806413; 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=8QM1QHLHovDhJzAjlOXny2HDNK64Zjmklql6ekR44ec=; b=oj9dR+tKr+3hd3owCxrKFep8A4UItnDYdRLxCgmeJiZEx+Ij2VtGTn+ztszxZ4kSIa OwW8OUSatWAzjLJbCZhhRpUlbEqUjiowZyA4oB5JgutPQ8anNd2IxYDjYPt68Avs3QY+ WqtyDvN+PVRiHmeNfGoj8Frpca3p7b7Lc/z9jY0mEPGIDbm8iM/4UUtQZjQGVbq+UOXT zhCrR+xwBKYZRoMJEQsFNhpqbIciVeqdfFLCrw//IAgkG6LdRxK9BZzG62ASad6p3nwT EbnMjLCScXIzYmHaA9p0zZkIn9PhhbFmEv3shtBCx0b8Pt/S5M4xnltgvvT3LvZGYvRz xXug== X-Gm-Message-State: AO0yUKUzjAlNfPoR4BILCL2XT+N198cy4dnzx615p429cu2FcedC0gB6 8UdiXKIDiJwgXV99B7IrLCcsbg== X-Received: by 2002:a05:6a20:3f0c:b0:db:4c00:7918 with SMTP id az12-20020a056a203f0c00b000db4c007918mr7132697pzb.0.1679806413373; Sat, 25 Mar 2023 21:53:33 -0700 (PDT) Received: from google.com (KD124209188001.ppp-bb.dion.ne.jp. [124.209.188.1]) by smtp.gmail.com with ESMTPSA id bn10-20020a056a00324a00b005a8aab9ae7esm16467454pfb.216.2023.03.25.21.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 21:53:32 -0700 (PDT) Date: Sun, 26 Mar 2023 13:53:27 +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, Sergey Senozhatsky Subject: Re: [PATCH -next v7 2/4] mm/zswap: skip invalid or unchanged parameter Message-ID: <20230326045327.GE3269998@google.com> References: <20230325071420.2246461-1-liushixin2@huawei.com> <20230325071420.2246461-3-liushixin2@huawei.com> <20230326031723.GD3269998@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230326031723.GD3269998@google.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/26 12:17), Sergey Senozhatsky wrote: > On (23/03/25 15:14), Liu Shixin wrote: > > 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; > > Bool kernel param can be any of these letters 'YyTt1NnFf0'. Doing things > to kp->arg outside of kernel/params.c is not going to be easy, let's not > even try. Please disregard my previous email. kp->arg is always true or false at this point. I'd still prefer to not do kp->arg in zswap.