Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2200318rwn; Fri, 9 Sep 2022 09:54:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7R3tpK0M9Fo63QuKWM549OI2dlM4N0pVf0oExajBie4MfymAsFOF67hCVO0owMx4F/WCj3 X-Received: by 2002:a17:906:8a47:b0:741:5d6a:13e5 with SMTP id gx7-20020a1709068a4700b007415d6a13e5mr10581079ejc.60.1662742487617; Fri, 09 Sep 2022 09:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662742487; cv=none; d=google.com; s=arc-20160816; b=M1YnVr0V01bSB24K2gkSJHAQV17xQ4i/+baFy/8Xto817GFSzrhgmyV50IBnFW1oO9 1fyNgKdnoB/GQCNTp8NrYzmY6q5IYVtw2jg7t1/6wOqfHO16vWjP70O3ZLnHXHeyJJKn W5pyjjQBG/C69qHyH3TXUVUp3Ou0Org/TxBAFII5Q5iZk2yiymtnPiqnpyeHmLhgQBgM uZaLpv8re5fC0eIbhgpRJ2WlvyImo0F425ytrGBb5Aq4F7jfx9igp/g7jQ7UuvUgEdDv ybkclT77jk0nU6uB+M0sh+M0uUuD+DvMiM0vpVUujH5QoMrIvcTvIErWktVCb7AKrNic 2NQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=PajPt/TC46nKfhgfrV2SJTEfYUdbGNiCND1AO7d5Qf8=; b=if/WfMwu9FFmx7mqdo9KH63Aa7nlTsmuawV2JLDxP/BHZscBOqDrvmvFrQ+28bVEJQ bnhISwUERurP/tV2MGtVJzSYqHYvVFPfux9d+cLEcHRXpifGduov48Dheepd6SwQAQ3F lTGYwDbBOdCl77c1l8X4Pi+RnNLBYJc8VpghEDyazcCFhrc0LoNikUMW9SDNj89rUVeS k9M3mPKwrUlQzbV+5GbphFUi52JOff0HOUcZsOMnj7lJMdMRO9fSmDEav9VDE6eGiU9j HYtiMdVMWL8nYjpXLj+TsjPw0R9fLlEj63WiK2mjgkvxLo0ZYbZyjLaqut09PtiVXv/x 9WQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dswb32OI; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr13-20020a1709073f8d00b007313312730esi795240ejc.85.2022.09.09.09.54.21; Fri, 09 Sep 2022 09:54:47 -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=@redhat.com header.s=mimecast20190719 header.b=Dswb32OI; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231806AbiIIQwd (ORCPT + 99 others); Fri, 9 Sep 2022 12:52:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiIIQwb (ORCPT ); Fri, 9 Sep 2022 12:52:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678FEDEC8 for ; Fri, 9 Sep 2022 09:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662742349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PajPt/TC46nKfhgfrV2SJTEfYUdbGNiCND1AO7d5Qf8=; b=Dswb32OIjxwhoF7nP6a9grFJMfKCicISr0Z8Fg8N+cgFSY4zhGDkINipFc8G+2GTKNb/ud QI599wCI/4HKFGvGaLv61sZMVsAa4Q5cqGO4hUzNsXfxSIl0pKSq3apP5HcD4ZoDx5bTwz /vF8ZMw0mQGzzUVcB34e7fsCObd8hZo= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-573-3HujZFEFOX2-OCqHYWrzRA-1; Fri, 09 Sep 2022 12:52:28 -0400 X-MC-Unique: 3HujZFEFOX2-OCqHYWrzRA-1 Received: by mail-wr1-f69.google.com with SMTP id s26-20020adfa29a000000b00228b0cdb116so494614wra.23 for ; Fri, 09 Sep 2022 09:52:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=PajPt/TC46nKfhgfrV2SJTEfYUdbGNiCND1AO7d5Qf8=; b=vREFDnTfj6gNdWVK2xxRCAJa1l0lr+6LKr/7P3WMK0PZC2giN4yACvFbx73ErFYout rdGD4Z+YU6SfTA9rZd9a1jP3TmEuQuEtKI9PqFQXA42ySp13snOMh7gm4uqrWKfYtGI5 wHldwOlBaecLS50U5u06AIwbcsjb9hmxeXJ7jgdsPQ3wcpqtWINj2Mlrc/zXQZiYgDPu fUZsF4wazCSUsdx2ZUDY1sRYRFWIiWf/wcDEeN+t6NzA5I1EJUi6cxxSJVVYbebxLam9 VIUEQyyBLMgpFP2RHAAROPpaythMcODZ0c+aFJgxJ4IPg2upHUfbiGzRQIQuh8/+kbJg ktbA== X-Gm-Message-State: ACgBeo0ACWp1pf2bnyb19LVflJKQdV0qNvOSYGSPcvcucEVBcl7Fv/Hv n9LxbnqH5/9cUQi+2rfPFQQJReyatdt/QO/7HbY6p3m9hNWF3NXZRG5JRn1mCWu1iV8gGaue/rA Fd5Xl+G3ypeJUFWTaMig5qI3k X-Received: by 2002:a5d:5887:0:b0:220:81ca:ec4f with SMTP id n7-20020a5d5887000000b0022081caec4fmr8300758wrf.263.1662742347119; Fri, 09 Sep 2022 09:52:27 -0700 (PDT) X-Received: by 2002:a5d:5887:0:b0:220:81ca:ec4f with SMTP id n7-20020a5d5887000000b0022081caec4fmr8300750wrf.263.1662742346887; Fri, 09 Sep 2022 09:52:26 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:6300:1fe0:42e1:62c5:91b6? (p200300cbc70463001fe042e162c591b6.dip0.t-ipconnect.de. [2003:cb:c704:6300:1fe0:42e1:62c5:91b6]) by smtp.gmail.com with ESMTPSA id n18-20020a05600c501200b003a846a014c1sm1200646wmr.23.2022.09.09.09.52.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 09:52:26 -0700 (PDT) Message-ID: <712acfd4-f7f4-457e-f1a2-ca0f076c6d24@redhat.com> Date: Fri, 9 Sep 2022 18:52:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] mm/shuffle: convert module_param_call to module_param_cb Content-Language: en-US To: Liu Shixin , Andrew Morton , Dan Williams , Rusty Russell Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kefeng Wang References: <20220909083947.3595610-1-liushixin2@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909083947.3595610-1-liushixin2@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 On 09.09.22 10:39, Liu Shixin wrote: > module_param_call is now completely consistent with module_param_cb, so > there is no need to keep two macros. Convert module_param_call to > module_param_cb since former is obsolete and latter is more kernel-ish. > > Signed-off-by: Liu Shixin > --- > mm/shuffle.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/mm/shuffle.c b/mm/shuffle.c > index c13c33b247e8..fb1393b8b3a9 100644 > --- a/mm/shuffle.c > +++ b/mm/shuffle.c > @@ -12,23 +12,22 @@ > DEFINE_STATIC_KEY_FALSE(page_alloc_shuffle_key); > > static bool shuffle_param; > -static int shuffle_show(char *buffer, const struct kernel_param *kp) > -{ > - return sprintf(buffer, "%c\n", shuffle_param ? 'Y' : 'N'); > -} > > -static __meminit int shuffle_store(const char *val, > +static __meminit int shuffle_param_set(const char *val, > const struct kernel_param *kp) > { > - int rc = param_set_bool(val, kp); > - > - if (rc < 0) > - return rc; > - if (shuffle_param) > + if (param_set_bool(val, kp)) > + return -EINVAL; > + if (*(bool *)kp->arg) > static_branch_enable(&page_alloc_shuffle_key); > return 0; > } > -module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400); > + > +static const struct kernel_param_ops shuffle_param_ops = { > + .set = shuffle_param_set, > + .get = param_get_bool, > +}; > +module_param_cb(shuffle, &shuffle_param_ops, &shuffle_param, 0400); > > /* > * For two pages to be swapped in the shuffle, they must be free (on a LGTM Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb