From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7D9D3B47DA for ; Thu, 30 Apr 2026 21:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777585136; cv=none; b=Za9LsC6pGBrFBMONNxHa7xNuiVsPiy66r7WhsfLdVWOGUcgqbGNcUruOx3coulC3CMuTrv+ocp6kOWi1VVrqG9f0YOjTcsEWYDLFo3aFdurR5kvB77zjaaywuPWo5MiZREzQ7eWnkArd5x5RPDRzkZOPu7tg0w7xjwakKhiX9Gk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777585136; c=relaxed/simple; bh=cpnmt/91jXCqkzzOdRu1rP4v3cuTUUQpsYBROazHHJ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pfsmy+K2SNeTB6PYWc8WBEbDR4Yt6fKARDfC9lfpMvyMPT1aXl/wuKhtIob/BwlYAMUefOyZqwqEWmius+9z1oZD8N8+7wxxJGnnqi5+ym1P9XWSPNEKLFtmWgYWEHv1Iy5Yx5rN7DgyypRVLQDJAiIvX0LPZAnznqFoF4k5Lc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QoJhK95E; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QoJhK95E" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-448528f4e69so889823f8f.3 for ; Thu, 30 Apr 2026 14:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777585133; x=1778189933; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wV0TDhPEWgtbRyMvsisK13V3qfSWWjG7b0Z2LUrzoD0=; b=QoJhK95EriODWmrUC91Wy81Z5cYkibX734yQvBJdJf9MWasK/6kJ1iCf5EaAnv0bGW f+9qTYJ4caBjPh+1IogV6miTTkaNZik2s4FSoCGTma6PKnzC7czI2UVisLvbmGdZK4S7 ALj2ZoBnALtEW19w/60HARn0llChyRp9We/8aEamSVnaRjBvfI+Id1yxKHykzg3yotyD ukAf83MHBM4J8gAfL+HGqcInyl/B5LpRnSyFBDhfrPkgv0WmAXcykzsXBSdi8itZVMsy Nr5NCQg55CoRx5bfJy3yVgnaRDley+UjeCsSus7TeW6kP05cvpU9OQKaBJxL7YsksDci rBbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777585133; x=1778189933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wV0TDhPEWgtbRyMvsisK13V3qfSWWjG7b0Z2LUrzoD0=; b=Ygob6/kl+nGTZ07+D+GrkzRA7aGxk5UXefjH63oWyO0WMnB86ei2Qe1jDo7nuake6s vNYlz9hs68ZCmeYW5wh8ix8oPjIPWer+I83WpoPmW+WZwSKrQUv3zu6wubVhdPCFHZFo 5c4mvpbFzHCsr03RCb+UUU5e9G8tRa+/NJgAlUibRaIvazI8FW+naT79+GWCeImzZSlf Qv2ngAxzAXW0LXeWYpyCuWXqeJExFtRqgfutRp4+EZBdAd4fHVWguPb+y6cnhNGzG1pG XdzH6tyYBzg9h3yEjn4tPHZWZvPx+kSd6lP1gZAh3ggLP2UKiIKelqRIyDVqvRSCng4y KQAA== X-Gm-Message-State: AOJu0YxW4zVfiPC+fMgCgRIXTImC8UA/rXECHux7QUpfMPqQKeykLumH xskNj3yIyY8HuuseSwYGs2XQ9ty3IL8lFZTQFBHYRK4YdPOi1Oy9Kx3b X-Gm-Gg: AeBDiesmdIekNTUZbnqDVa9Soud3w3hu9E2eB+DyPqiPebUq4qNQrMPvy6S4VkCt475 FpzURr4VMYP3R5usefozSGl7ElJ9tJd7QSpji0iC6Cl1Qnxqjm+PphRztTM4mWZpTN3rsVg4XNN 4rkQMzh67LaifKXPfRVZUGsq3BJ7TROjpSxhCE5WlY4xR00bKSUJKJ+kv8ool5AJIbi1kiRYD8f U04o7MS2iOr22CJA5JtuiqbOT40uouziBmZ0wVy6bp6HuDDDbIRCymBLHdIKI26rVIoU/OirjqA 5eTb1D1ZuP3fZE2D1ODc6kYsHsOJy36ZAvdh3QrhaSZ3io/f3KBWGIgtNxPLAMEmPetplGuXVvN cVvAEIzXs/kbM0t2dFDnOOx0zwQMJBUNb9/H0PaQMJTFqWisN8EJpWhkWSTQ0JJWFr+GiuDsjq3 F1h9Xhndt2GQR16U3+Gvz5QamTbbNPmij6LurHWUy1 X-Received: by 2002:a05:6000:2088:b0:43d:70b3:7edf with SMTP id ffacd0b85a97d-4493cc3fe15mr7547387f8f.12.1777585133127; Thu, 30 Apr 2026 14:38:53 -0700 (PDT) Received: from yuri-framework13 ([78.211.51.156]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44a9879ef89sm418510f8f.30.2026.04.30.14.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 14:38:52 -0700 (PDT) From: Yuri Andriaccio To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider Cc: linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: [RFC PATCH v5 08/29] sched/rt: Introduce HCBS specific structs in task_group Date: Thu, 30 Apr 2026 23:38:12 +0200 Message-ID: <20260430213835.62217-9-yurand2000@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260430213835.62217-1-yurand2000@gmail.com> References: <20260430213835.62217-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-Transfer-Encoding: 8bit From: luca abeni Add an array of sched_dl_entity objects in task_group. Create the dl_bandwidth struct and add a field for it in task_group. Add a rq pointer field in struct rt_rq. --- For each CPU on the host system, the task_group manages a sched_dl_entity and a rt_rq object, which in turn keeps a pointer to its locally managed runqueue. The sched_dl_entity object manages the deadline server which will be scheduled for execution on the CPU, while the rt_rq object is instead used to reference the local runqueue's specific data and entities and it is used when an actual task must be scheduled when the CPU is given to the dl_server. The dl_bandwidth object keeps track of the currently allocated bandwidth for the cgroup. Co-developed-by: Alessio Balsini Signed-off-by: Alessio Balsini Co-developed-by: Andrea Parri Signed-off-by: Andrea Parri Co-developed-by: Yuri Andriaccio Signed-off-by: Yuri Andriaccio Signed-off-by: luca abeni --- kernel/sched/sched.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 770de5afd3a9..1c614e54eba4 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -322,6 +322,13 @@ struct rt_bandwidth { unsigned int rt_period_active; }; +struct dl_bandwidth { + raw_spinlock_t dl_runtime_lock; + u64 dl_runtime; + u64 dl_period; +}; + + static inline int dl_bandwidth_enabled(void) { return sysctl_sched_rt_runtime >= 0; @@ -495,10 +502,17 @@ struct task_group { #endif /* CONFIG_FAIR_GROUP_SCHED */ #ifdef CONFIG_RT_GROUP_SCHED + /* + * Each task group manages a different scheduling entity per CPU, i.e. a + * different deadline server, and a runqueue per CPU. All the dl-servers + * share the same dl_bandwidth object. + */ struct sched_rt_entity **rt_se; + struct sched_dl_entity **dl_se; struct rt_rq **rt_rq; struct rt_bandwidth rt_bandwidth; + struct dl_bandwidth dl_bandwidth; #endif struct scx_task_group scx; @@ -854,6 +868,12 @@ struct rt_rq { #ifdef CONFIG_CGROUP_SCHED struct task_group *tg; /* this tg has "this" rt_rq on given CPU for runnable entities */ #endif + + /* + * The cgroup's served runqueue if the rt_rq entity belongs to a cgroup, + * otherwise the top-level global runqueue. + */ + struct rq *rq; }; static inline bool rt_rq_is_runnable(struct rt_rq *rt_rq) -- 2.53.0