* [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option
@ 2020-03-30 14:06 Waiman Long
2020-03-30 14:07 ` Waiman Long
2020-04-03 15:43 ` Tejun Heo
0 siblings, 2 replies; 4+ messages in thread
From: Waiman Long @ 2020-03-30 14:06 UTC (permalink / raw)
To: Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet
Cc: linux-kernel, cgroups, linux-doc, Joel Fernandes, Sonny Rao, Waiman Long
The cpuset in cgroup v1 accepts a special "cpuset_v2_mode" mount
option that make cpuset.cpus and cpuset.mems behave more like those in
cgroup v2. Document it to make other people more aware of this feature
that can be useful in some circumstances.
Signed-off-by: Waiman Long <longman@redhat.com>
---
Documentation/admin-guide/cgroup-v1/cpusets.rst | 11 +++++++++++
kernel/cgroup/cpuset.c | 8 ++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Documentation/admin-guide/cgroup-v1/cpusets.rst b/Documentation/admin-guide/cgroup-v1/cpusets.rst
index 86a6ae995d54..7ade3abd342a 100644
--- a/Documentation/admin-guide/cgroup-v1/cpusets.rst
+++ b/Documentation/admin-guide/cgroup-v1/cpusets.rst
@@ -223,6 +223,17 @@ cpu_online_mask using a CPU hotplug notifier, and the mems file
automatically tracks the value of node_states[N_MEMORY]--i.e.,
nodes with memory--using the cpuset_track_online_nodes() hook.
+The cpuset.effective_cpus and cpuset.effective_mems files are
+normally read-only copies of cpuset.cpus and cpuset.mems files
+respectively. If the cpuset cgroup filesystem is mounted with the
+special "cpuset_v2_mode" option, the behavior of these files will become
+similar to the corresponding files in cpuset v2. In other words, hotplug
+events will not change cpuset.cpus and cpuset.mems. Those events will
+only affect cpuset.effective_cpus and cpuset.effective_mems which show
+the actual cpus and memory nodes that are currently used by this cpuset.
+See Documentation/admin-guide/cgroup-v2.rst for more information about
+cpuset v2 behavior.
+
1.4 What are exclusive cpusets ?
--------------------------------
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 58f5073acff7..729d3a5c772e 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -358,8 +358,12 @@ static DECLARE_WORK(cpuset_hotplug_work, cpuset_hotplug_workfn);
static DECLARE_WAIT_QUEUE_HEAD(cpuset_attach_wq);
/*
- * Cgroup v2 behavior is used when on default hierarchy or the
- * cgroup_v2_mode flag is set.
+ * Cgroup v2 behavior is used on the "cpus" and "mems" control files when
+ * on default hierarchy or when the cpuset_v2_mode flag is set by mounting
+ * the v1 cpuset cgroup filesystem with the "cpuset_v2_mode" mount option.
+ * With v2 behavior, "cpus" and "mems" are always what the users have
+ * requested and won't be changed by hotplug events. Only the effective
+ * cpus or mems will be affected.
*/
static inline bool is_in_v2_mode(void)
{
--
2.18.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option
2020-03-30 14:06 [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option Waiman Long
@ 2020-03-30 14:07 ` Waiman Long
2020-04-03 15:43 ` Tejun Heo
1 sibling, 0 replies; 4+ messages in thread
From: Waiman Long @ 2020-03-30 14:07 UTC (permalink / raw)
To: Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet
Cc: linux-kernel, cgroups, linux-doc, Joel Fernandes, Sonny Rao
On 3/30/20 10:06 AM, Waiman Long wrote:
> The cpuset in cgroup v1 accepts a special "cpuset_v2_mode" mount
> option that make cpuset.cpus and cpuset.mems behave more like those in
> cgroup v2. Document it to make other people more aware of this feature
> that can be useful in some circumstances.
>
> Signed-off-by: Waiman Long <longman@redhat.com>
> ---
> Documentation/admin-guide/cgroup-v1/cpusets.rst | 11 +++++++++++
> kernel/cgroup/cpuset.c | 8 ++++++--
> 2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/admin-guide/cgroup-v1/cpusets.rst b/Documentation/admin-guide/cgroup-v1/cpusets.rst
> index 86a6ae995d54..7ade3abd342a 100644
> --- a/Documentation/admin-guide/cgroup-v1/cpusets.rst
> +++ b/Documentation/admin-guide/cgroup-v1/cpusets.rst
> @@ -223,6 +223,17 @@ cpu_online_mask using a CPU hotplug notifier, and the mems file
> automatically tracks the value of node_states[N_MEMORY]--i.e.,
> nodes with memory--using the cpuset_track_online_nodes() hook.
>
> +The cpuset.effective_cpus and cpuset.effective_mems files are
> +normally read-only copies of cpuset.cpus and cpuset.mems files
> +respectively. If the cpuset cgroup filesystem is mounted with the
> +special "cpuset_v2_mode" option, the behavior of these files will become
> +similar to the corresponding files in cpuset v2. In other words, hotplug
> +events will not change cpuset.cpus and cpuset.mems. Those events will
> +only affect cpuset.effective_cpus and cpuset.effective_mems which show
> +the actual cpus and memory nodes that are currently used by this cpuset.
> +See Documentation/admin-guide/cgroup-v2.rst for more information about
> +cpuset v2 behavior.
> +
>
> 1.4 What are exclusive cpusets ?
> --------------------------------
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 58f5073acff7..729d3a5c772e 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -358,8 +358,12 @@ static DECLARE_WORK(cpuset_hotplug_work, cpuset_hotplug_workfn);
> static DECLARE_WAIT_QUEUE_HEAD(cpuset_attach_wq);
>
> /*
> - * Cgroup v2 behavior is used when on default hierarchy or the
> - * cgroup_v2_mode flag is set.
> + * Cgroup v2 behavior is used on the "cpus" and "mems" control files when
> + * on default hierarchy or when the cpuset_v2_mode flag is set by mounting
> + * the v1 cpuset cgroup filesystem with the "cpuset_v2_mode" mount option.
> + * With v2 behavior, "cpus" and "mems" are always what the users have
> + * requested and won't be changed by hotplug events. Only the effective
> + * cpus or mems will be affected.
> */
> static inline bool is_in_v2_mode(void)
> {
On second thought, I should have clarified the cpuset_v2_mode option in
the cpuset.c file itself also.
Cheers,
Longman
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option
2020-03-30 14:06 [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option Waiman Long
2020-03-30 14:07 ` Waiman Long
@ 2020-04-03 15:43 ` Tejun Heo
2020-04-03 16:10 ` Waiman Long
1 sibling, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2020-04-03 15:43 UTC (permalink / raw)
To: Waiman Long
Cc: Li Zefan, Johannes Weiner, Jonathan Corbet, linux-kernel,
cgroups, linux-doc, Joel Fernandes, Sonny Rao
On Mon, Mar 30, 2020 at 10:06:15AM -0400, Waiman Long wrote:
> The cpuset in cgroup v1 accepts a special "cpuset_v2_mode" mount
> option that make cpuset.cpus and cpuset.mems behave more like those in
> cgroup v2. Document it to make other people more aware of this feature
> that can be useful in some circumstances.
>
> Signed-off-by: Waiman Long <longman@redhat.com>
Applied to cgroup/for-5.7.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option
2020-04-03 15:43 ` Tejun Heo
@ 2020-04-03 16:10 ` Waiman Long
0 siblings, 0 replies; 4+ messages in thread
From: Waiman Long @ 2020-04-03 16:10 UTC (permalink / raw)
To: Tejun Heo
Cc: Li Zefan, Johannes Weiner, Jonathan Corbet, linux-kernel,
cgroups, linux-doc, Joel Fernandes, Sonny Rao
On 4/3/20 11:43 AM, Tejun Heo wrote:
> On Mon, Mar 30, 2020 at 10:06:15AM -0400, Waiman Long wrote:
>> The cpuset in cgroup v1 accepts a special "cpuset_v2_mode" mount
>> option that make cpuset.cpus and cpuset.mems behave more like those in
>> cgroup v2. Document it to make other people more aware of this feature
>> that can be useful in some circumstances.
>>
>> Signed-off-by: Waiman Long <longman@redhat.com>
> Applied to cgroup/for-5.7.
>
> Thanks.
>
Thanks,
Longman
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-03 16:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 14:06 [PATCH v2] docs: cgroup-v1: Document the cpuset_v2_mode mount option Waiman Long
2020-03-30 14:07 ` Waiman Long
2020-04-03 15:43 ` Tejun Heo
2020-04-03 16:10 ` Waiman Long
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®