All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@redhat.com>
To: Waiman Long <longman@redhat.com>
Cc: Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com,
	luto@amacapital.net, Mike Galbraith <efault@gmx.de>,
	torvalds@linux-foundation.org, Roman Gushchin <guro@fb.com>,
	Patrick Bellasi <patrick.bellasi@arm.com>
Subject: Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent
Date: Wed, 30 May 2018 16:00:21 +0200	[thread overview]
Message-ID: <20180530140021.GF3320@localhost.localdomain> (raw)
In-Reply-To: <1527687991-1431-1-git-send-email-longman@redhat.com>

Hi,

On 30/05/18 09:46, Waiman Long wrote:
> It was found that the cpuset.cpus could contain CPUs that are not listed
> in their parent's cpu list as shown by the command sequence below:
> 
>   # echo "+cpuset" >cgroup.subtree_control
>   # mkdir g1
>   # echo 0-5 >g1/cpuset.cpus
>   # mkdir g1/g11
>   # echo "+cpuset" > g1/cgroup.subtree_control
>   # echo 6-11 >g1/g11/cpuset.cpus
>   # grep -R . g1 | grep "\.cpus"
>   g1/cpuset.cpus:0-5
>   g1/cpuset.cpus.effective:0-5
>   g1/g11/cpuset.cpus:6-11
>   g1/g11/cpuset.cpus.effective:0-5
> 
> As the intersection of g11's cpus and that of g1 is empty, the effective
> cpus of g11 is just that of g1. The check in update_cpumask() is now
> corrected to make sure that cpus in a child cpus must be a subset of
> its parent's cpus. The error "write error: Invalid argument" will now
> be reported in the above case.
> 
> Reported-by: Juri Lelli <juri.lelli@redhat.com>
> Signed-off-by: Waiman Long <longman@redhat.com>

Looks like it fixes the bug.

Reviewed-and-Tested-by: Juri Lelli <juri.lelli@redhat.com>

Thanks,

- Juri

WARNING: multiple messages have this Message-ID (diff)
From: Juri Lelli <juri.lelli@redhat.com>
To: Waiman Long <longman@redhat.com>
Cc: Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com,
	luto@amacapital.net, Mike Galbraith <efault@gmx.de>,
	torvalds@linux-foundation.org, Roman Gushchin <guro@fb.com>,
	Patrick Bellasi <patrick.bellasi@arm.com>
Subject: Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent
Date: Wed, 30 May 2018 16:00:21 +0200	[thread overview]
Message-ID: <20180530140021.GF3320@localhost.localdomain> (raw)
In-Reply-To: <1527687991-1431-1-git-send-email-longman@redhat.com>

Hi,

On 30/05/18 09:46, Waiman Long wrote:
> It was found that the cpuset.cpus could contain CPUs that are not listed
> in their parent's cpu list as shown by the command sequence below:
> 
>   # echo "+cpuset" >cgroup.subtree_control
>   # mkdir g1
>   # echo 0-5 >g1/cpuset.cpus
>   # mkdir g1/g11
>   # echo "+cpuset" > g1/cgroup.subtree_control
>   # echo 6-11 >g1/g11/cpuset.cpus
>   # grep -R . g1 | grep "\.cpus"
>   g1/cpuset.cpus:0-5
>   g1/cpuset.cpus.effective:0-5
>   g1/g11/cpuset.cpus:6-11
>   g1/g11/cpuset.cpus.effective:0-5
> 
> As the intersection of g11's cpus and that of g1 is empty, the effective
> cpus of g11 is just that of g1. The check in update_cpumask() is now
> corrected to make sure that cpus in a child cpus must be a subset of
> its parent's cpus. The error "write error: Invalid argument" will now
> be reported in the above case.
> 
> Reported-by: Juri Lelli <juri.lelli@redhat.com>
> Signed-off-by: Waiman Long <longman@redhat.com>

Looks like it fixes the bug.

Reviewed-and-Tested-by: Juri Lelli <juri.lelli@redhat.com>

Thanks,

- Juri
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-05-30 14:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 13:46 [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent Waiman Long
2018-05-30 13:46 ` Waiman Long
2018-05-30 14:00 ` Juri Lelli [this message]
2018-05-30 14:00   ` Juri Lelli
2018-05-31  1:25 ` Zefan Li
2018-05-31  1:25   ` Zefan Li
2018-05-31  1:25   ` Zefan Li
2018-05-31  7:43   ` Peter Zijlstra
2018-05-31  7:43     ` Peter Zijlstra
2018-05-31  8:12   ` Zefan Li
2018-05-31  8:12     ` Zefan Li
2018-05-31  8:12     ` Zefan Li
2018-05-31  8:26     ` Peter Zijlstra
2018-05-31  8:26       ` Peter Zijlstra
2018-05-31  8:41       ` Juri Lelli
2018-05-31  8:41         ` Juri Lelli
2018-05-31  8:42       ` Zefan Li
2018-05-31  8:42         ` Zefan Li
2018-05-31  8:42         ` Zefan Li
2018-05-31 13:22         ` Waiman Long
2018-05-31 13:22           ` Waiman Long
2018-05-31 15:58           ` Tejun Heo
2018-05-31 15:58             ` Tejun Heo
2018-05-31 16:16             ` Peter Zijlstra
2018-05-31 16:16               ` Peter Zijlstra
2018-05-31 16:19               ` Tejun Heo
2018-05-31 16:19                 ` Tejun Heo
2018-05-31 16:38                 ` Peter Zijlstra
2018-05-31 16:38                   ` Peter Zijlstra
2018-06-06 20:56                   ` Tejun Heo
2018-06-06 20:56                     ` Tejun Heo
2018-05-31 16:28             ` Waiman Long
2018-05-31 16:28               ` Waiman Long

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=20180530140021.GF3320@localhost.localdomain \
    --to=juri.lelli@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=efault@gmx.de \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=longman@redhat.com \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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.