From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
Johannes Weiner <hannes@cmpxchg.org>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH 2/2] cgroup/cpuset: Optimize cpuset_attach() on v2
Date: Mon, 21 Nov 2022 14:11:03 -0500 [thread overview]
Message-ID: <78de73b0-2a27-592b-b70b-ca209962fdef@redhat.com> (raw)
In-Reply-To: <20221121185042.GA15225@blackbody.suse.cz>
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
WARNING: multiple messages have this Message-ID (diff)
From: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Zefan Li <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sebastian Andrzej Siewior
<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Subject: Re: [PATCH 2/2] cgroup/cpuset: Optimize cpuset_attach() on v2
Date: Mon, 21 Nov 2022 14:11:03 -0500 [thread overview]
Message-ID: <78de73b0-2a27-592b-b70b-ca209962fdef@redhat.com> (raw)
In-Reply-To: <20221121185042.GA15225-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>
On 11/21/22 13:50, Michal Koutný wrote:
> On Sat, Nov 12, 2022 at 05:19:39PM -0500, Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 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
next prev parent reply other threads:[~2022-11-21 19:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-12 22:19 [PATCH 0/2] cgroup/cpuset: v2 optimization Waiman Long
2022-11-12 22:19 ` Waiman Long
2022-11-12 22:19 ` [PATCH 1/2] cgroup/cpuset: Skip spread flags update on v2 Waiman Long
2022-11-12 22:19 ` Waiman Long
2022-11-12 22:19 ` [PATCH 2/2] cgroup/cpuset: Optimize cpuset_attach() " Waiman Long
2022-11-12 22:19 ` Waiman Long
2022-11-21 18:50 ` Michal Koutný
2022-11-21 18:50 ` Michal Koutný
2022-11-21 19:11 ` Waiman Long [this message]
2022-11-21 19:11 ` Waiman Long
2022-11-23 15:19 ` Sebastian Andrzej Siewior
2022-11-23 15:19 ` Sebastian Andrzej Siewior
2022-11-14 21:46 ` [PATCH 0/2] cgroup/cpuset: v2 optimization Tejun Heo
2022-11-14 21:46 ` 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=78de73b0-2a27-592b-b70b-ca209962fdef@redhat.com \
--to=longman@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.