mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: lizefan.x@bytedance.com, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpuset: Remove unused cpuset_node_allowed
Date: Mon, 27 Feb 2023 21:52:40 -0500	[thread overview]
Message-ID: <d6df5140-ed7c-2c12-8e5a-d5c3fbf30a47@redhat.com> (raw)
In-Reply-To: <0222742e-3c31-b75d-6027-3b6da2be16be@shopee.com>

On 2/27/23 21:40, Haifeng Xu wrote:
>
> On 2023/2/27 22:56, Waiman Long wrote:
>> On 2/27/23 03:07, Haifeng Xu wrote:
>>> Commit 002f290627c2 ("cpuset: use static key better and convert to new API")
>>> has used __cpuset_node_allowed instead of cpuset_node_allowed to check
>>> whether we can allocate on a memory node. Now this function isn't used by
>>> anyone, so we can remove it safely.
>>>
>>> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
>>> ---
>>>    include/linux/cpuset.h | 12 ------------
>>>    1 file changed, 12 deletions(-)
>>>
>>> diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
>>> index d58e0476ee8e..7fad5afe3bba 100644
>>> --- a/include/linux/cpuset.h
>>> +++ b/include/linux/cpuset.h
>>> @@ -82,13 +82,6 @@ int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask);
>>>      extern bool __cpuset_node_allowed(int node, gfp_t gfp_mask);
>>>    -static inline bool cpuset_node_allowed(int node, gfp_t gfp_mask)
>>> -{
>>> -    if (cpusets_enabled())
>>> -        return __cpuset_node_allowed(node, gfp_mask);
>>> -    return true;
>>> -}
>>> -
>>>    static inline bool __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
>>>    {
>>>        return __cpuset_node_allowed(zone_to_nid(z), gfp_mask);
>>> @@ -223,11 +216,6 @@ static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)
>>>        return 1;
>>>    }
>>>    -static inline bool cpuset_node_allowed(int node, gfp_t gfp_mask)
>>> -{
>>> -    return true;
>>> -}
>>> -
>>>    static inline bool __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
>>>    {
>>>        return true;
>> The kernel convention is to add a "__" prefix to a function name if there is higher level helper without the "__" prefix that uses it. Since cpuset_node_allowed() is no longer used. We should just rename __cpuset_node_allowed() to cpuset_node_allowed() and get rid of the unused helper. A bit more code changes are needed for this, though.
>>
>> Cheers,
>> Longman
>>
> Maybe we can still use cpuset_node_allowed in __cpuset_zone_allowed? If so, less code need to be changed.
>
mm/page_alloc.c has 2 references to __cpuset_node_allowed() in their 
comments. These references should also be updated as well. That is why I 
said a bit more code needs to be touched.

Cheers,
Longman


  reply	other threads:[~2023-02-28  2:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  8:07 Haifeng Xu
2023-02-27 14:56 ` Waiman Long
2023-02-28  2:40   ` Haifeng Xu
2023-02-28  2:52     ` Waiman Long [this message]
2023-02-28  3:13       ` Haifeng Xu
2023-02-28  8:35   ` [PATCH] cpuset: Clean up cpuset_node_allowed Haifeng Xu
2023-03-17 21:37     ` Tejun Heo
2023-03-18  1:35     ` Waiman Long
2023-03-18 21:30       ` Waiman Long
2023-03-24  2:03         ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6df5140-ed7c-2c12-8e5a-d5c3fbf30a47@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=haifeng.xu@shopee.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®