Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6145400rwl; Wed, 22 Mar 2023 07:06:42 -0700 (PDT) X-Google-Smtp-Source: AK7set98723poM0uAYA3gSQDKOnUppzKcM+NZLDafAfwkngsM8JBotkSlhJZ3yBlbFMIFtXWFIsO X-Received: by 2002:a17:902:e84f:b0:19c:be09:20d5 with SMTP id t15-20020a170902e84f00b0019cbe0920d5mr4172781plg.11.1679494002663; Wed, 22 Mar 2023 07:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679494002; cv=none; d=google.com; s=arc-20160816; b=EsavGdE9E5Ry9jGZCq2tMwwrmJX5IUUFKJnedyGqF9uyZ9bj0PgqpuFEjabF3Af7D9 G9DkCvfrxYxskzLISTh3ZOrLvH+nQT7mQRUJoPlqhAjYnUUP4M/UhT+McH76tYc8SWRI pU22ZekWuahs7IKSxEcULkGr2hvVdna/MxmIoTtiPX1ODq2qTSC7alebLVxgsVRrVCU4 7VOvK4N8MBOiyjXlXpcaC6hAK60ICySoQePsCX13/haPiM3aw+slbMzp6ij6jUEpvsyh o90bowWDkC8bYw5//7512pve7135aQL+HyS2Ab67Nr4iUNd4YiZbcmBOxtpeAjWXCuEP RWRg== 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=QeV/4pStBX06yUhhDME7pBubEPm2yYcKchFLAtihrJ4=; b=zx4s4XeQNttyyK0Hq/l0uHJAR8/ivpaJ2CAlQXk+vRma7ZSYQGvSEjHSN6JCiBe7Qw EFNBkLcPZHSDJ5Iw+Ogb6VgyijgKQJqIRH/qhe9dsPo3bq9Nyi2lCgjhh3LOVBryG2Bp X2MtOWEPP+5W//mE7YsvOsfaWCf+oIIO1LJOx2rCoedaLY+zzU8CQPCrTuAPC9IUhiu5 ESfDfIrSaVZwGGTa6vIQQ1AMbbdOfb30sQuG/xNAnonIiAIFbxHJWxPOwj0pPSb++C0z BLncUztYLlvUiKyEaeSXU/FdLCJOOPmHnCX1/mhIw09I8GDojejGPRSlA4a+sDJl6YLX VbDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 66-20020a630145000000b004f2920ecea3si16425404pgb.623.2023.03.22.07.06.21; Wed, 22 Mar 2023 07:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbjCVOAO (ORCPT + 99 others); Wed, 22 Mar 2023 10:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbjCVOAM (ORCPT ); Wed, 22 Mar 2023 10:00:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4735626B1; Wed, 22 Mar 2023 07:00:09 -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 D91B24B3; Wed, 22 Mar 2023 07:00:52 -0700 (PDT) Received: from e125579.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 42C033F71E; Wed, 22 Mar 2023 07:00:06 -0700 (PDT) From: Dietmar Eggemann To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Waiman Long , Tejun Heo , Zefan Li , Johannes Weiner , Hao Luo Cc: Steven Rostedt , Vincent Guittot , Daniel Bristot de Oliveira , Luca Abeni , Tommaso Cucinotta , Qais Yousef , Wei Wang , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: [RFC PATCH 0/2] sched/cpuset: Fix DL BW accounting in case can_attach() fails Date: Wed, 22 Mar 2023 14:59:57 +0100 Message-Id: <20230322135959.1998790-1-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I followed Longman's idea to add a `deadline task transfer count` into cpuset and only update the `dl task count` in cpuset_attach(). Moreover, I switched from per-task DL BW request to a per-cpuset one. This way we don't have to free per-task in case xxx_can_attach() fails. The DL BW freeing is handled in cpuset_cancel_attach() for the case `multiple controllers and one of the non-cpuset can_attach() fails`. Only lightly tested on cgroup v1 with exclusive cpusets so far. Dietmar Eggemann (2): sched/deadline: Create DL BW alloc, free & check overflow interface cgroup/cpuset: Free DL BW in case can_attach() fails include/linux/sched.h | 4 ++- kernel/cgroup/cpuset.c | 55 +++++++++++++++++++++++++++++++++++++---- kernel/sched/core.c | 19 +++----------- kernel/sched/deadline.c | 53 +++++++++++++++++++++++++++++---------- kernel/sched/sched.h | 2 +- 5 files changed, 97 insertions(+), 36 deletions(-) -- 2.25.1