Re: [PATCH 5/6] cgroup/cpuset: optimize cpuset_mems_allowed_intersects()

Tejun Heo
2024-05-14T16:50:16Z

On Tue, May 14, 2024 at 12:47:59PM -0400, Waiman Long wrote:
> > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> > index 4237c8748715..47ed206d4890 100644
> > --- a/kernel/cgroup/cpuset.c
> > +++ b/kernel/cgroup/cpuset.c
> > @@ -5010,6 +5010,9 @@ EXPORT_SYMBOL_GPL(cpuset_mem_spread_node);
> > int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
> > const struct task_struct *tsk2)
> > {
> > + if (tsk1 == tsk2)
> > + return 1;
> > +
> > return nodes_intersects(tsk1->mems_allowed, tsk2->mems_allowed);
> > }
> Reviewed-by: Waiman Long <longman@redhat.com>

I'm not sure this is worth the added code.

Thanks.

--
tejun