From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbeE3OAd (ORCPT ); Wed, 30 May 2018 10:00:33 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:40973 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbeE3OAa (ORCPT ); Wed, 30 May 2018 10:00:30 -0400 X-Google-Smtp-Source: ADUXVKIniajK8YWwnRZ4dgIXKWk7pG0eH7DhSUUCmOPt2Bv+bJ++Dee1w1wWYGBhiVH5eb097ue6uA== Date: Wed, 30 May 2018 16:00:21 +0200 From: Juri Lelli To: Waiman Long Cc: Tejun Heo , Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , 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 , torvalds@linux-foundation.org, Roman Gushchin , Patrick Bellasi Subject: Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent Message-ID: <20180530140021.GF3320@localhost.localdomain> References: <1527687991-1431-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527687991-1431-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Waiman Long Looks like it fixes the bug. Reviewed-and-Tested-by: Juri Lelli Thanks, - Juri