Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5500255pxb; Wed, 19 Jan 2022 21:11:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxq/x3PGPf9A2nUOM7cpkFlewUh8vxNfiX4rimi65kwGlO/aQbugthh/LgIYP0F1q0Z8otD X-Received: by 2002:a17:902:bd93:b0:149:ba01:e67a with SMTP id q19-20020a170902bd9300b00149ba01e67amr36632932pls.156.1642655465148; Wed, 19 Jan 2022 21:11:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642655465; cv=none; d=google.com; s=arc-20160816; b=mAi1Fs3zYVB97OxB2N/C7ZqQf2XRGE1YGUNGPOeDaoErqBGjnOOoIZGx2PmIH2nLpc mLn0ovZW5eeOuDpuuW8IFlrp620cj/ZPHKkq3gLAqGlijpxTo3AV7vQAkCTkB2sIOpB0 ILZ3DK/MbExIJyzbDN2P8IeMOgDM+1o7sS5KRKqwM4uaEvW3eo1bS1Oki9+NbmpKg+34 fON9geNeujuftkycmkutSvRqH+0/1h+OYrLexjybD/h+lK+5Cysi3KxNnAmmjiG5V17W LFxCDt4juWTHYRH+WAKIb2ol4UofBPT9Lkg3q9YPMphupr+LlXsHPnw9V7vKnIcaTo6R OGXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ieyNNv35CUnuGee14wRA2HcpASsdqxvQI3ElOZhx/0Q=; b=XSdj+Wf699kHxdpDmuIryBHPUAKo/UfYdwx6L6/iltJDm6Yq/mls7BJDqFgjGd4bTq V5u2hBKRpqO5T7Bd6Y5FAiYIDii1VFJy+Tp3Q7Vz4YnSmyllsro0DcPZLGRvKA8re+Lq uwpH94CaGZeaMMErh3EB0kNKxmKrXLRdXE6l1UHhdv1y0nthYyuOBu+UKlYd2CpBZEeO AdJqCT4mnW3XcoaNoRJSeb8T36qj/HbQhCzwer4r6IpAm2N4N+uOVsWxPVpXHFT/cE2k rqgMq0tI8R8w1YnRwor+nXhoXs3i8xBZvHxTngSfLEQB68dcm+YS9VmjpWWCBMhANnIv NJEg== 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 mi3si2431413pjb.99.2022.01.19.21.10.24; Wed, 19 Jan 2022 21:11:05 -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 S236325AbiARKFb (ORCPT + 99 others); Tue, 18 Jan 2022 05:05:31 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:43289 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232812AbiARKFa (ORCPT ); Tue, 18 Jan 2022 05:05:30 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V2C14H1_1642500318; Received: from localhost.localdomain(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0V2C14H1_1642500318) by smtp.aliyun-inc.com(127.0.0.1); Tue, 18 Jan 2022 18:05:26 +0800 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 Subject: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask() Date: Tue, 18 Jan 2022 18:05:18 +0800 Message-Id: <20220118100518.2381118-1-dtcccc@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.33.0