From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75C23ECAAD3 for ; Fri, 9 Sep 2022 16:52:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC5E46B0071; Fri, 9 Sep 2022 12:52:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D74818D0001; Fri, 9 Sep 2022 12:52:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C64B86B0073; Fri, 9 Sep 2022 12:52:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B92316B0071 for ; Fri, 9 Sep 2022 12:52:31 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 87040120C19 for ; Fri, 9 Sep 2022 16:52:31 +0000 (UTC) X-FDA: 79893140502.04.475E89D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 16A4E400D8 for ; Fri, 9 Sep 2022 16:52:29 +0000 (UTC) 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-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-573-RT1EUYw7OKOQmKImmC4vsw-1; Fri, 09 Sep 2022 12:52:28 -0400 X-MC-Unique: RT1EUYw7OKOQmKImmC4vsw-1 Received: by mail-wm1-f71.google.com with SMTP id c128-20020a1c3586000000b003b324bb08c5so2770663wma.9 for ; Fri, 09 Sep 2022 09:52:28 -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=aV1psB7glwmsYlY6T1O0dGYq5WhuVlKs85C35xqbSV6nkF5b2Mcx6OUpDMePaNui4v xNso/C0varGOhY3TbiJ7M/7tIMI1csTI7DSP6Bm/wey9MadxNXtNNSP2vbN/F3ymtoO2 1rSKo6c9k7ja9rOovLVVIgA7I/8jHyownPtyTydrFPYv5gIi8RUATFXHIdj+cj8x+EN1 1dAAWMTM8wiYjFdnOGM7UO97rrxF8+8g+AzFFZf8fuQrJnbfY5oJdJeUR7h3RKLlUzkD WGyKdOGoC/3VKvZkCWArJd7K6DsvaIS147Sar8eQTArGPlMUWCUN8Sxp+1Tv6lbBdVRP pPFA== X-Gm-Message-State: ACgBeo2jnMDtD4PM2niBavJ85VwPD6t03XKr6Fy3x+orlNYva5xFGmcT W5rlsdq1xs6egUMKijDpaP5HKzOgdni/X1Jgih774uBN4gtUdgkBSRosvKuz3wQJ3Aqg2Elul6+ wbFqV2RL6ynI= X-Received: by 2002:a5d:5887:0:b0:220:81ca:ec4f with SMTP id n7-20020a5d5887000000b0022081caec4fmr8300759wrf.263.1662742347119; Fri, 09 Sep 2022 09:52:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5RknKv2bcRzLPW8dqcU1t28MvBwm6FSTgg11b29hhDYbaxlAWZcpOhlZvbEhttkqn0VW4Kmg== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662742350; a=rsa-sha256; cv=none; b=tjvNqY/rTrV/jnkRoUVobTc16MbMyk3ABLpzX3sbFMoiVLcoQODY3XsPyOkN6fnlQm6Vcl ItbOOjUQuj6/B3WMnp/6efMuQRiN+iSbHj3vrCk3S71VIC6o8Sh2kbf/dCbG92AE9BJeEk 7aNz08XYhIv1O9kyacB4xMAcTOUgKCk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Dswb32OI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662742350; h=from:from:sender: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:dkim-signature; bh=PajPt/TC46nKfhgfrV2SJTEfYUdbGNiCND1AO7d5Qf8=; b=wE+UNmxmYE8TOO0tBcSL7Rz77WG1tF043YTWgHe5reBtlLZB5/QguR8NmldkC7sd8d0qsI W/UIcj7gD2vBUglSp/42a3FRhQUiZkH2LBXKbl5ZN+5aUwq7RRLYpLGsJ/ut4ki2KPZiZZ X7siPJiA2xkITaLsbT2Gd0qKMW+suZA= X-Rspam-User: X-Rspamd-Server: rspam05 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Dswb32OI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Stat-Signature: 8bfz3rwky7gfm3gpozoo3ozmkcmp35dw X-Rspamd-Queue-Id: 16A4E400D8 X-HE-Tag: 1662742349-949892 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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