Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp346084imm; Thu, 31 May 2018 01:13:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/5Ghb5x2vDriO7+ipuwcAtWAVDw5+km9cXh+cOWWSxaQjEUpJv4cTk4KCi2NJLFanFh/T X-Received: by 2002:a63:8848:: with SMTP id l69-v6mr4817977pgd.149.1527754438604; Thu, 31 May 2018 01:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527754438; cv=none; d=google.com; s=arc-20160816; b=gWOBvf0zE2dfbhxgGu0UFasS6ShFz4tGQk+H3UNY6Qhyz3tgcx9LV7lLEYVls1qHUT Q9YoaTzvlgXYvoy84uhEiMwfyJ4sjJNrRNIDrclblzJ8XWLXfak+HqtUXPgIS9Z6JKNM Nj7y7jW/1MkJRthFGJYmmeVJF0r4/OQj08Ed6knfLSoO77KoE7lrppBGKhY6zyk4JiY6 6OQZ9G0LhYsU1eiLFEPO8ZK816i9L2OQ/6PVRvZzqZYJBTx9CRbgIt0WUGT66qqJJ/vk glKlE5xX8+1Y9YovsGznSbisBNjA2mSwp53fGeEPn+Xbei6ZLnTs+KO85l6/DNekdwZw 2oyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=o0d30pqzmP+ZVgXSoQPBdRWUiAkzJT1WBTboOQh7fSk=; b=mf6dw0Uv7Eobzu7Kgw65B5MyMPniVc0lmqpwFZUGp1sx3IJfm303hzwrhbKKIpVgEC UENx1aZ7/l46PfIyzwIFf8iXii4OzfxhC5tEx9NSHRgInFXcuYfIKHaR0pH6CPF6XcVa MpB7y8tfDmSy3QM4Lis5YEosu1bHFOuBsgX81vVJg0PR1mKzbz8y17AFi7x9WFwTbbr1 X3llnDoIhYP2N72/SGPBYcKlKAFcg/HSIYEvJuSJUnzVOXK02a9GOPiYMtqJYUYIn3Xq DerfPEcU6yqSPshRM85W75hFUT6xt53EIE+tAZPJYoslldznND2Aya0OkSqSU+CHo/OH 7twA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v41-v6si36551761plg.451.2018.05.31.01.13.44; Thu, 31 May 2018 01:13:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbeEaIMx (ORCPT + 99 others); Thu, 31 May 2018 04:12:53 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58862 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753947AbeEaIMo (ORCPT ); Thu, 31 May 2018 04:12:44 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 16AB0F2582AB2; Thu, 31 May 2018 16:12:39 +0800 (CST) Received: from [10.177.19.236] (10.177.19.236) by smtp.huawei.com (10.3.19.206) with Microsoft SMTP Server (TLS) id 14.3.382.0; Thu, 31 May 2018 16:12:35 +0800 Subject: Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent To: Waiman Long , Tejun Heo , "Johannes Weiner" , Peter Zijlstra , "Ingo Molnar" References: <1527687991-1431-1-git-send-email-longman@redhat.com> <5B0F4F09.9050100@huawei.com> CC: , , , , , , Mike Galbraith , , Roman Gushchin , Juri Lelli , Patrick Bellasi From: Zefan Li X-Enigmail-Draft-Status: N1110 Message-ID: <5B0FAE72.1090204@huawei.com> Date: Thu, 31 May 2018 16:12:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5B0F4F09.9050100@huawei.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/5/31 9:25, Zefan Li wrote: > Hi Waiman, > > On 2018/5/30 21: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. >> > > We made the distinction between user-configured CPUs and effective CPUs > in commit 7e88291beefbb758, so actually it's not a bug. > I remember the original reason is to support restoration of the original cpu after cpu offline->online. We use user-configured CPUs to remember if the cpu should be restored in the cpuset after it's onlined.