Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4670534rdb; Fri, 15 Sep 2023 08:54:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXAPeX4m91i0NMT2C8QVj7L67V6CmrfN4KSdxTxqa2vnDM88LQQ6s8cVwcmOftIGuqCizp X-Received: by 2002:a05:6a21:7888:b0:153:56b1:8417 with SMTP id bf8-20020a056a21788800b0015356b18417mr2635813pzc.21.1694793255029; Fri, 15 Sep 2023 08:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694793255; cv=none; d=google.com; s=arc-20160816; b=E/b1vR4ecMOfmHhK39iFh0R+c8VbNRQHZ/FtBx37IfZj63gAu84Iqq/Nqoo+l8a0Iq 6gZxg1AVAeYn/47fsLx1d4Zh7xRwwm+v65kg5NaKEOVOeaIjnFa/Ezb48fjL+HW/r91v bP5grcGPjU2gwEBhJzSYW6wq/dqVxDmJgvry4zZVlxnBu92PWibZEc/HAnLZbnsVcVe7 INF4nTMiHGAS3F3rb6g5rm0vbixlMdGJLAczNGsXyVH8Mwn/uEMEaXbyEjJl/0BltJWK B5RanQMD/PMu20zBEpIs35bAa/80AYQkUO8R3knhAKXtyUmesx97pMe9qQQt9XWSUEUG eY4w== 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=++3jOpyFKDNw4lMmnGbvdoA9qOsQtwb5oYzs29/VD/o=; fh=L38uG/AYoTQFm6PZwfrny4lZEFiboMAvUoKV2tLQESI=; b=St9p4IjioPmGcZBh7E0DNlnlhAl6hGNoq/fH+TXFxKQDONgc/OLRI0crN+K2pd+QV2 XSGm72XDbF9OKCREuHuPeEjih7I16615OCWvjTlU/y9AAfRGogUJWISTgvUigb46rU3N JeJvGd0BPxju9RP1fCHKIIoShXyWQKXAJWfpjmmrCZLdnW5EPA1B6/0b/CCjkR1aT6Vo KLLSApxJw0QY/1IVXyEQn8iq1Djlclsejq3IOlth4FhnzxGgyuBUPahs6RmliJjctV+H MfKtf/tSdetRioowXxJf6k+SZgdHJ3FpMxbmazMHOLso7uLs0krm2MJ3hYF1DAkv3el5 9Ysg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t22-20020a63eb16000000b005660335e26fsi3377644pgh.485.2023.09.15.08.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 08:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B10FE81C4A8B; Fri, 15 Sep 2023 08:47:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236212AbjIOPqx (ORCPT + 99 others); Fri, 15 Sep 2023 11:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236426AbjIOPqt (ORCPT ); Fri, 15 Sep 2023 11:46:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 412402D7D; Fri, 15 Sep 2023 08:46:08 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 29B861FB; Fri, 15 Sep 2023 08:46:45 -0700 (PDT) Received: from e126645.arm.com (unknown [10.57.93.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CBFD63F738; Fri, 15 Sep 2023 08:46:05 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: rui.zhang@intel.com, aaron.lu@intel.com, Pierre Gondois , Waiman Long , Zefan Li , Tejun Heo , Johannes Weiner , cgroups@vger.kernel.org Subject: [PATCH 0/1] cgroup/cpuset: Rebuild sched domains if isolated partition changed Date: Fri, 15 Sep 2023 17:45:03 +0200 Message-Id: <20230915154505.363754-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:47:38 -0700 (PDT) Hello, The patch aims to rebuild the sched domains if the cpus of an isolated partition are updated. Another issue might have been found, but it seemed to involve more complex modifications. To reproduce this issue: # mkdir cgroup # mount -t cgroup2 none cgroup/ # mkdir cgroup/A1 cgroup/B1 # echo "+cpuset" > cgroup/cgroup.subtree_control # echo 0-3 > cgroup/A1/cpuset.cpus # echo isolated > cgroup/A1/cpuset.cpus.partition # echo 4-6 > cgroup/B1/cpuset.cpus # cat cgroup/A1/cpuset.cpus.partition isolated // Make the isolated partition invalid as not having // an exclusive cpuset # echo 0-4 > A1/cpuset.cpus # cat cgroup/A1/cpuset.cpus.partition isolated invalid (Cpu list in cpuset.cpus not exclusive) // Expected result, internal state of the cgroup: // - prs_err: PERR_NOTEXCL // - flags: CS_CPU_EXCLUSIVE | CS_MEMORY_MIGRATE | CS_SCHED_LOAD_BALANCE // Make the isolated partition valid: # echo 0-3 > A1/cpuset.cpus # cat cgroup/A1/cpuset.cpus.partition isolated invalid (Cpu list in cpuset.cpus not exclusive) // Unexpected result, internal state of the cgroup: // - prs_err: PERR_NOTEXCL // - flags: CS_CPU_EXCLUSIVE | CS_MEMORY_MIGRATE | CS_SCHED_LOAD_BALANCE The issue seems to be that in update_cpumask(), the cgroup tree is only traversed if there is a need to invalidate the partitions. Cf. the case above, I think it should also be traversed if there is an invalid state that might be re-validated. Regards, Pierre Pierre Gondois (1): cgroup/cpuset: Rebuild sched domains if isolated partition changed kernel/cgroup/cpuset.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.25.1