diff mbox series

[2/4] Revert "sched/topology: Introduce for_each_numa_hop_mask()"

Message ID 20230925020528.777578-3-yury.norov@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series sched: drop for_each_numa_hop_mask() | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 15566 this patch: 15566
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 3920 this patch: 3920
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16961 this patch: 16961
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 22 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yury Norov Sept. 25, 2023, 2:05 a.m. UTC
Now that the only user of for_each_numa_hop_mask() is switched to using
cpumask_local_spread(), for_each_numa_hop_mask() is a dead code. Thus,
revert commit 06ac01721f7d ("sched/topology: Introduce
for_each_numa_hop_mask()").

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 include/linux/topology.h | 18 ------------------
 1 file changed, 18 deletions(-)

Comments

Jacob Keller Sept. 25, 2023, 10:46 p.m. UTC | #1
On 9/24/2023 7:05 PM, Yury Norov wrote:
> Now that the only user of for_each_numa_hop_mask() is switched to using
> cpumask_local_spread(), for_each_numa_hop_mask() is a dead code. Thus,
> revert commit 06ac01721f7d ("sched/topology: Introduce
> for_each_numa_hop_mask()").
> 
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> Signed-off-by: Yury Norov <ynorov@nvidia.com>
> ---
>  include/linux/topology.h | 18 ------------------
>  1 file changed, 18 deletions(-)
> 
> diff --git a/include/linux/topology.h b/include/linux/topology.h
> index fea32377f7c7..344c2362755a 100644
> --- a/include/linux/topology.h
> +++ b/include/linux/topology.h
> @@ -261,22 +261,4 @@ sched_numa_hop_mask(unsigned int node, unsigned int hops)
>  }
>  #endif	/* CONFIG_NUMA */
>  

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

I might have squashed all of 2 through 4 into a single patch but not a
big deal.

> -/**
> - * for_each_numa_hop_mask - iterate over cpumasks of increasing NUMA distance
> - *                          from a given node.
> - * @mask: the iteration variable.
> - * @node: the NUMA node to start the search from.
> - *
> - * Requires rcu_lock to be held.
> - *
> - * Yields cpu_online_mask for @node == NUMA_NO_NODE.
> - */
> -#define for_each_numa_hop_mask(mask, node)				       \
> -	for (unsigned int __hops = 0;					       \
> -	     mask = (node != NUMA_NO_NODE || __hops) ?			       \
> -		     sched_numa_hop_mask(node, __hops) :		       \
> -		     cpu_online_mask,					       \
> -	     !IS_ERR_OR_NULL(mask);					       \
> -	     __hops++)
> -
>  #endif /* _LINUX_TOPOLOGY_H */
Yury Norov Sept. 25, 2023, 10:55 p.m. UTC | #2
On Mon, Sep 25, 2023 at 3:46 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
>
>
>
> On 9/24/2023 7:05 PM, Yury Norov wrote:
> > Now that the only user of for_each_numa_hop_mask() is switched to using
> > cpumask_local_spread(), for_each_numa_hop_mask() is a dead code. Thus,
> > revert commit 06ac01721f7d ("sched/topology: Introduce
> > for_each_numa_hop_mask()").
> >
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > Signed-off-by: Yury Norov <ynorov@nvidia.com>
> > ---
> >  include/linux/topology.h | 18 ------------------
> >  1 file changed, 18 deletions(-)
> >
> > diff --git a/include/linux/topology.h b/include/linux/topology.h
> > index fea32377f7c7..344c2362755a 100644
> > --- a/include/linux/topology.h
> > +++ b/include/linux/topology.h
> > @@ -261,22 +261,4 @@ sched_numa_hop_mask(unsigned int node, unsigned int hops)
> >  }
> >  #endif       /* CONFIG_NUMA */
> >
>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>
> I might have squashed all of 2 through 4 into a single patch but not a
> big deal.

I just wanted to keep the changes more trackable. No objections to squash 2-4,
whatever maintainers will feel better.

Thanks,
Yury
Jacob Keller Sept. 25, 2023, 11:01 p.m. UTC | #3
On 9/25/2023 3:55 PM, Yury Norov wrote:
> On Mon, Sep 25, 2023 at 3:46 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
>>
>>
>>
>> On 9/24/2023 7:05 PM, Yury Norov wrote:
>>> Now that the only user of for_each_numa_hop_mask() is switched to using
>>> cpumask_local_spread(), for_each_numa_hop_mask() is a dead code. Thus,
>>> revert commit 06ac01721f7d ("sched/topology: Introduce
>>> for_each_numa_hop_mask()").
>>>
>>> Signed-off-by: Yury Norov <yury.norov@gmail.com>
>>> Signed-off-by: Yury Norov <ynorov@nvidia.com>
>>> ---
>>>  include/linux/topology.h | 18 ------------------
>>>  1 file changed, 18 deletions(-)
>>>
>>> diff --git a/include/linux/topology.h b/include/linux/topology.h
>>> index fea32377f7c7..344c2362755a 100644
>>> --- a/include/linux/topology.h
>>> +++ b/include/linux/topology.h
>>> @@ -261,22 +261,4 @@ sched_numa_hop_mask(unsigned int node, unsigned int hops)
>>>  }
>>>  #endif       /* CONFIG_NUMA */
>>>
>>
>> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>>
>> I might have squashed all of 2 through 4 into a single patch but not a
>> big deal.
> 
> I just wanted to keep the changes more trackable. No objections to squash 2-4,
> whatever maintainers will feel better.
> 
> Thanks,
> Yury

I'm fine with keeping them separate.
diff mbox series

Patch

diff --git a/include/linux/topology.h b/include/linux/topology.h
index fea32377f7c7..344c2362755a 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -261,22 +261,4 @@  sched_numa_hop_mask(unsigned int node, unsigned int hops)
 }
 #endif	/* CONFIG_NUMA */
 
-/**
- * for_each_numa_hop_mask - iterate over cpumasks of increasing NUMA distance
- *                          from a given node.
- * @mask: the iteration variable.
- * @node: the NUMA node to start the search from.
- *
- * Requires rcu_lock to be held.
- *
- * Yields cpu_online_mask for @node == NUMA_NO_NODE.
- */
-#define for_each_numa_hop_mask(mask, node)				       \
-	for (unsigned int __hops = 0;					       \
-	     mask = (node != NUMA_NO_NODE || __hops) ?			       \
-		     sched_numa_hop_mask(node, __hops) :		       \
-		     cpu_online_mask,					       \
-	     !IS_ERR_OR_NULL(mask);					       \
-	     __hops++)
-
 #endif /* _LINUX_TOPOLOGY_H */