From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C53549553C for ; Tue, 9 Jun 2026 15:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781020013; cv=none; b=JEnXfLKpSEevmMmK4jJmZsScjHZQ4xyEKX+iCrMfTeuoKUZWMp/tBVyZLyc+GLzTm3e2cR0jg6nkOFf9hJQdh9Xvqd6Sn3W1PEYBm4y7ZXEn+tYgmHqCbqPrmR3T8LZG6aVbWa93+ekdysEuwwfNajZM2m54c0ra39UO5wr4y0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781020013; c=relaxed/simple; bh=+10onJO+W5BOSXLmXSI1bLQs3ISBGVQreNFwTxRYx7c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n4f1PMU31xKlxMG1YVkAuSTsRSeXom72nDxl2V6hi2tBKPakYle5+oVlXCO/ttenSdLAgM5CNiRAZk8Unk+ArYYdhWzIToStB21WhaF/5z6SU+qiNhiisqa5NEk6Ex3EROk+nVvVa8RVfuqefa8OyRj8hQNx8oDLhRC0HdLc4gc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IMrI1wx9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=tY13qfqf; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IMrI1wx9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="tY13qfqf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781020010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wA//FI/2V4/dhiJOqrsJhgwbCCnYt4JC9cGle24iCFY=; b=IMrI1wx9BY9DrOKJAkfTxYMMn9xmF+7hqrkrj2hAyTmlfIjkOI/8Mcd5MTZ/c06lDUZfej 9ET6pz5nqx/1yTn/mOIFwfNJ3nkb4d128cRAZfchLC5+TQz2j7p4W5BoMA1H6p9tjgMAP0 fNIF2Z2WEJ6PcfbmsLBIm1PvjR20hpc= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-T1eO9JBvOBeoHRXpgA4VWg-1; Tue, 09 Jun 2026 11:46:49 -0400 X-MC-Unique: T1eO9JBvOBeoHRXpgA4VWg-1 X-Mimecast-MFC-AGG-ID: T1eO9JBvOBeoHRXpgA4VWg_1781020008 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-490a060eb84so37155435e9.0 for ; Tue, 09 Jun 2026 08:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781020008; x=1781624808; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wA//FI/2V4/dhiJOqrsJhgwbCCnYt4JC9cGle24iCFY=; b=tY13qfqfUUGy0jDTnuFIpDwV/4miJc6gcpoMCs/Q92bS19nCXhBuht49alnOJGFI05 6ThDD9oE096JETGnszlehtPcpEE20e7cdri36jy8MJFaI48JsK5fnNHSmjv2nUFeHiJ+ pUy266dRgJflZOl2UpCZkucVcofrqTAL6IJRhb2dpAIWPq8Crc036f10vc8e2v08OlBj eNCKoyaGo05Infr5ymr9mTsJjoc5l99Gml+Aiar5JjPkzfxfH5Iep/k5TgdfGzDD4jAi S2X7SksIpX7j08fpLmbeLPf9bVUahvvBYDEu0twny2n4WYyG1SLYEtPwPQEHkT1IgPuc bCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781020008; x=1781624808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wA//FI/2V4/dhiJOqrsJhgwbCCnYt4JC9cGle24iCFY=; b=dnYyekomf755PqQ/GikHp1v3S33F1lATtINY0GFfoBt3EuMLls+4TmDdLzNg/nGghx 6AVd0n7+7W93U7yNrUHUMc0YJ8CQWJUuudtoHl1s54vucmSxA0bSV3++j7mzSZupop7S 2SyYDU9a2G02K+tmO7hpiV0MkNKnTXa8rr73ldWU3ZsbveprVU/cg44yLqwYYBOlpCsd oHMM4EBxxEgMze/m0puN5UXJJU8+4H/cpmCIsOG2TM0d/wPUp9UaivHSkP1x/ufd17V+ RX7ZXwWWaC2ZYHZtAFRPyBIHxOSBtzvFnVxrdMrjqBCnC15GNRyyFWfd3Hk0ebPJV/5I EKvg== X-Forwarded-Encrypted: i=1; AFNElJ8dUeS1oBYoOZ40daogqt9tnxajgLLZV/FxzY0l1XCv2HPxNJ/ptQytjDLNSJd6QH/gjBeOu7Cth3kp5Z0=@vger.kernel.org X-Gm-Message-State: AOJu0YwE8nHxYlyt5/0r7FsyZoCcGlTD/dPFBPhKAmPk+3G7TSgLPYUo GaC88FvBIkGSo1ZL5zFJF71cOhkQkNjocnH5zGIB1HqeNaaS0/MBtfmGB7gdSLTXhBWBjy0Ez36 wTo7c1UMMvbkF4klOK0b/QA38f9Uthq11Cf0hKsYIyxV+Cjieaseb/qC8EYN9RKNBSA== X-Gm-Gg: Acq92OFBy2NO2zLBg93k39uc3ihCd3qboFo3Gzrl++Ql5Jz1Ys+sxFlOQmkNQsXFYKC XXJGf8NBhYYJuMm9y6lmNe3XW8qSGdtBjxYfgc038tWA3/HJrjlddKZ6FBupM8D319NINyEu/HD /FM9xQnKvamXeHY/xNpugd0JUNMpCMrU7jYNjmQB6Niac7v5+CR0dG+nLi0f1i0hXIxP2Edz8dO DPQTAJPQCOnmVA48dXGyVDUO++sSy84M+FdqGnUwDlWXq/AYI40skJMa/9P6AMMeeboeFJX07kN 6Uuf5rClaHe8HDdlYviQRGog7jUmRLN4XfXX53ag88gq+2QWAZAqB4a+6jCXp9mYzaY1cjPS3gE aLs9LZzcep/LNQeSbEWiZxF9CDm8Bgzs4tPhgS8BdXGqsAh1rEXsVGgab5FZn1+w= X-Received: by 2002:a05:600c:870f:b0:490:44eb:c1e7 with SMTP id 5b1f17b1804b1-490c2624a03mr331518465e9.30.1781020007801; Tue, 09 Jun 2026 08:46:47 -0700 (PDT) X-Received: by 2002:a05:600c:870f:b0:490:44eb:c1e7 with SMTP id 5b1f17b1804b1-490c2624a03mr331517885e9.30.1781020007355; Tue, 09 Jun 2026 08:46:47 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.95.181]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc40716bsm522410715e9.12.2026.06.09.08.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 08:46:46 -0700 (PDT) Date: Tue, 9 Jun 2026 17:46:44 +0200 From: Juri Lelli To: Yuri Andriaccio Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: Re: [RFC PATCH v6 00/25] Hierarchical Constant Bandwidth Server Message-ID: References: <20260608121546.69910-1-yurand2000@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260608121546.69910-1-yurand2000@gmail.com> Hi Yuri, Thanks for sending this out. On 08/06/26 14:15, Yuri Andriaccio wrote: > Hello, > > This is the v6 for Hierarchical Constant Bandwidth Server, aiming at replacing > the current RT_GROUP_SCHED mechanism with something more robust and > theoretically sound. The patchset has been presented at OSPM25 and OSPM26 > (https://retis.sssup.it/ospm-summit/), and a summary of its inner workings can > be found at https://lwn.net/Articles/1021332/ . You can find the previous > versions of this patchset at the bottom of the page, in particular version 1 > which talks in more detail what this patchset is all about and how it is > implemented. > > This v6 version works on the comments by the reviewers and introduces the > following meaningful changes: > - Update to kernel version 7.1. > - Refactorings and general cleanups. > - Removal of substantial duplicated code. > - Express more locking constraints in code. > - New cpu.rt.max interface. > - Refactoring of migration code to reduce code duplication. > The new migration code now reuses the existing push/pull and similar functions > and specializes where needed, substantially reducing the footprint of group > migration code from previous versions. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > New cgroup-v2 interface: > After extensive discussions with the kernel's maintainers, we have built a new > interface to support HCBS scheduling. Since this will be a cgroup-v2 only > feature (the fate of cgroup-v1 old RT_GROUP_SCHED has yet to be decided), it was > possible to drop the original v1 interface entirely and create a completely new > one that is similar to those that are already existing. > > Every cgroup has now two new files: > - cpu.rt.max (similar to the cpu.max file) > - cpu.rt.internal (read-only, not available in the root cgroup, it may be > removed if deemed unnecessary, see later for details) > > In this new interface, HCBS cgroups may either be set to use deadline servers, > and thus reserving a specified amount of bandwidth, very similarly to the > previous system, or can delegate their FIFO/RR tasks' scheduling to the nearest > ancestor that it is configured (default on group creation). If the nearest > configured ancestor is the root cgroup, tasks will be effectively run on the > root runqueue even if their cgroup is not the root task group. > > This means that subtrees are allowed to retain the original non-RT_GROUP_SCHED > behaviour, scheduling on root, while the feature is nonetheless active. In the > meantime other subtrees may use HCBS, and the whole hierarchy can coexist > without issues. > > This behaviour is specified in the cpu.rt.max file, which accepts the string > " ". A zero runtime disables FIFO/RR scheduling for > tasks in that group, a non-zero runtime creates a reservation and uses HCBS, a > runtime of 'max' instead tells the scheduler to use the nearest configured > ancestor for the FIFO/RR task scheduling. > > The admission test now does not only check the immediate children of a cgroup > for schedulability (recall that a group's bandwidth must be always greater than > or equal to its children total bandwidth), but it has to check its whole > subtree: if a child delegates its tasks to its parents (runtime = 'max'), then > this child's own children (the grandchildrens) are effectively viewed as > immediate children that compete for the same bandwidth of their grandparent, and > so on down the hierarchy. > > To support both threaded and domain cgroups, the original test that allowed only > to run tasks in leaf cgroups has been removed: this is already enforced for > domain cgroups by existing code, while this must not be the case for threaded > cgroups. > > Since groups in the middle of the hierarchy can now also run tasks, their > dl_servers must be configured properly: a parent cgroup dl_servers can only use > their assigned bandwidth minus the total of their children. The cpu.rt.internal > file reads exactly what is this "remainder" bandwidth. Since dl_servers must > have a runtime and period values assigned, the period is taken from the user > configured cpu.rt.max file and the runtime is computed from the remainder bw. > This runtime and the period are the values shown by cpu.rt.internal. > > Supporting both threaded and domain cgroups also dropped all the extra code > related to active and 'live' cgroups as mentioned in previous RFCs. > I started playing with the new interface and ended up with the following bash-5.3# cat cpu.rt.max (root) 10000 100000 bash-5.3# cat g1/cpu.rt.max 10000 100000 bash-5.3# cat g1/cpu.rt.internal 9999 100000 which looks odd to me, as nothing is running on g1 yet and no children groups either. Maybe a rounding error of some kind? Thanks, Juri