lkml.org 
[lkml]   [2022]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] cgroup/cpuset: Optimize cpuset_attach() on v2
From

On 11/21/22 13:50, Michal Koutný wrote:
> On Sat, Nov 12, 2022 at 05:19:39PM -0500, Waiman Long <longman@redhat.com> wrote:
>> + /*
>> + * In the default hierarchy, enabling cpuset in the child cgroups
>> + * will trigger a number of cpuset_attach() calls with no change
>> + * in effective cpus and mems. In that case, we can optimize out
>> + * by skipping the task iteration and update.
>> + */
>> + if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
>> + !cpus_updated && !mems_updated) {
> I'm just wondering -- why is this limited to the default hierarchy only?
> IOW why can't v1 skip too (when favorable constness between cpusets).

Cpuset v1 is a bit more complex. Besides cpu and node masks, it also
have other flags like the spread flags that we need to looks for
changes. Unlike cpuset v2, I don't think it is likely that
cpuset_attach() will be called without changes in cpu and node masks.
That are the reason why this patch focuses on v2. If it is found that
this is not the case, we can always extend the support to v1.

Cheers,
Longman

\
 
 \ /
  Last update: 2022-11-21 20:12    [W:1.784 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site