Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5223413pxb; Wed, 26 Jan 2022 07:23:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHcRpO5ajr4IyKWakPG32nlOBz9+XZNsZMRbHi+qK/O5xOM4m75E4C52deeAUDUlR2+mwm X-Received: by 2002:a63:354f:: with SMTP id c76mr19245623pga.193.1643210601808; Wed, 26 Jan 2022 07:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643210601; cv=none; d=google.com; s=arc-20160816; b=i3yiy3gXgABnIDQB6ESK03zYSwVjGqzdOo6kJhaiaGmULUAhBHH2GAjJDEm1i2S+NW ptvWfQe5D6+uDUCghxN5J5wY1OL68cmbFL3RNUnQILZr1WhYmfD/0hTYnRPm8Symso3J 2dB0/fB7cGXjR8iA4A5mXZjAkjRWv2oQNM7yMPM1/t9PeaSL49VbYq0BHxK4mnG/8p+2 o32Z6Fm1VTPFpxlUe9PYUdcrFhEqfVjpk1gSCNCaxf1jEsIeU0PTTqPsUROwVk6MjKQg P3FxpPvzwCN6D3zHpDr82gh+N3ZqopjvGEA50Wzafsfw082Mz3Je+OTwMpoUx8e7q1hX Ll6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=2b5CsUAZK6EBhhLr6c76gD7S5T1vvLBOJg3YuNA63AU=; b=cGd2LVHMROMRyBHPlJHK9hgH8oZ3b1WCCi0R0ac/06GDcxcg5Yw7bwVJ6ZoYG7lm62 HkjpijTpYSk95+dQOL5HIwyw8vHKh4gIk3kT9rHCW9F594dhtj7n0DWELX812ezONgNc CfAHSdLs+H6Vl0mDKBF0Ymxv4SL0kwlC8IjwOg1/+YQ4lQxMnQMgXCuI3qC6ZVNabMyD EjPn1WE6q4AvREK1qdTueMd21iZYotew29gzANF+4oQk7yQi/n6Ddl/k9mAheEKULAcu bnQLOkDhUSYidL1DTKbbKmh2HCqxwju6GNQttLYCgPCTqygHuF73jwViMzSykwwD7n6t cUig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si18683286pgl.788.2022.01.26.07.23.09; Wed, 26 Jan 2022 07:23:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236194AbiAZCSE (ORCPT + 99 others); Tue, 25 Jan 2022 21:18:04 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:50824 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235987AbiAZCSD (ORCPT ); Tue, 25 Jan 2022 21:18:03 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V2tKVfc_1643163477; Received: from 30.21.164.198(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0V2tKVfc_1643163477) by smtp.aliyun-inc.com(127.0.0.1); Wed, 26 Jan 2022 10:17:58 +0800 Message-ID: <7f8a14be-762b-7ab8-4cef-1de6799d2dce@linux.alibaba.com> Date: Wed, 26 Jan 2022 10:17:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask() Content-Language: en-US From: Tianchen Ding To: Zefan Li , Tejun Heo , Johannes Weiner , Waiman Long , "Peter Zijlstra (Intel)" Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220118100518.2381118-1-dtcccc@linux.alibaba.com> In-Reply-To: <20220118100518.2381118-1-dtcccc@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping~ Any maintainer take a look? On 2022/1/18 18:05, Tianchen Ding wrote: > subparts_cpus should be limited as a subset of cpus_allowed, but it is > updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to > fix it. > > Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag") > Signed-off-by: Tianchen Ding > --- > kernel/cgroup/cpuset.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index bb3531e7fda7..804ff5738c5f 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, > * Make sure that subparts_cpus is a subset of cpus_allowed. > */ > if (cs->nr_subparts_cpus) { > - cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus, > - cs->cpus_allowed); > + cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed); > cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus); > } > spin_unlock_irq(&callback_lock);