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 08A5E3B9600 for ; Wed, 21 Jan 2026 09:46:06 +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=1768988769; cv=none; b=jv7ezTuMTILMD4hB6UdSrnWex28LMd1uiv1MLwXJiBaz18LSIrBxD/QyyUdr9iP6KIuNLS4LCi6OGrL1BtsV0UKM3BiAQnPzzbG0R2M3GCPSfwZqJR+S+4FrjukV5uim3v6+QHDBMowxor/hzucTT7rAahtNzS+d7UUb+fOZp0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768988769; c=relaxed/simple; bh=bWp7rzSvlXOx7GzsVbnjJ+UlT10/FUI9/7MvERhAM+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Moukzr9r11nPl4f5QeD+iRJd04lIUocPQ0LzOQJUCuGxxX3owvYzSS/JZTxRQzxSEbeqoQjuzpi85Y13wwhKAnNF2mtefk+crH6pym7PEbNxiV9V7NqbaPCyFs65Aq/QWAuskzexQpzG+Z+8Ao822mpnlfp48tVx7xAaa7tSJOo= 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=OvCQYLB9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=UqilVRwh; 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="OvCQYLB9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="UqilVRwh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768988766; 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=AcW7KH9B2GOlSNsiQPWqIA9dx5Xc1iazXZvtYlupYAo=; b=OvCQYLB9gnuI6b7IkPAFYu0ZXeRxXJ/D5smRnMUDsb0WeVYiCug7K9nqrrGNTxn5Ji0PIQ tB+k8k9IGF9SakViYu95vOG0n40HBKHdhTbB4U/vlq+yVQe0L9trjPa7/IySLNFSE64WDb 8ee3KKzy58lkgt1CAgW6XehWKIo78Po= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-JN2N9PrEOsCkZ749vnGi0g-1; Wed, 21 Jan 2026 04:46:04 -0500 X-MC-Unique: JN2N9PrEOsCkZ749vnGi0g-1 X-Mimecast-MFC-AGG-ID: JN2N9PrEOsCkZ749vnGi0g_1768988763 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-435991d4a3aso388031f8f.1 for ; Wed, 21 Jan 2026 01:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1768988763; x=1769593563; 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=AcW7KH9B2GOlSNsiQPWqIA9dx5Xc1iazXZvtYlupYAo=; b=UqilVRwhO0Rq1jNl9qjlBFPyTqZ0Yoy0IVOeHbQKOU1fllXnL3gESSPThWjqxGFtEE 3/dmH6MDUL8mCVwX/n33FTeEwBSxl7k1SRqi8vu/lBLUNbgmvXHttuLpWz2oRq6Ke4sP 1/oI9I3Hk2MEHWYZ9JwleUBcdm7hpFbV3gMB2+w1nwFPRs762FNeIkORTiTrKW5+zTNt 3BOTqEOxsw1L+56X8bLCswnVDMTcPEF2oqLfiuNjJJg+Lf6YHIBUzp7AnLoGna6sY1XY hIwq6KbpoO1RjdlwJjl3gADnhL434N3myBxyGgihFH+WPmCFs+zw5jtlTV9WqNycpFXW LE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768988763; x=1769593563; 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=AcW7KH9B2GOlSNsiQPWqIA9dx5Xc1iazXZvtYlupYAo=; b=Ti4XgfBxjVKDWXM132l8TSu5abCg43wUkCHQSf76Qif3b+XrTbIx6at3h5eeJFicSM lJ2d/bUoi3VKxNYCnWFY0R0on/MzaLgrGZI2723NALodEIUvlXZTFplOAjzBPfkoW6TF s8UQndSncfnuXT+w/GzVzP2udE5mbgLgFjTMCoh+hzmnjGBB89lHbo4l6zKpOLL3JVes coZV9KWpaSkM+JWWeVhz9vu7ty6A740yE6ZkzwevxqbnyU4bY13J5Nv8lPZUqqWwAGOa 2ruqgrqjzgjWxjucPW+/UakJf9QpcTHxfwol08XHnX5Z/1BKAPQcSS38yWQGJh3V/AlQ COxQ== X-Forwarded-Encrypted: i=1; AJvYcCV1BoL0b5Grba47nMSU5faXHFLu1126PLjrHDS4gUVwgkC6spgvs3F9cBHNYNAVPGEFoAPbmXXsT1HZnpA=@vger.kernel.org X-Gm-Message-State: AOJu0YyAZoc1/YSWHrPjRZ7CiMY3k5egFIl5ljWxq62Q4Fs1B8nf578v 64u1e5cox/+Ghx8opuw/1P4+LCDJV+6mabbtzqNK48O+UojL1znd5w5TodINAOY/MaI7S5T7BLM 37Km03gIzbA/Ntb+LpBCl37ILYOa2Ep3uJq5wXC5qMLlhbTd5lWfWVHRh69Lbx4ylcQ== X-Gm-Gg: AZuq6aJ7mEGb8kTSdDI98z7dDq1jDrPbduSZ8SX6VAQVtMnCRU9tHK1c7JygF8v8Ytx K2WNVNe8uZqvGMTVDbcNQd+sM/lcrf0ePSo/ungEOYZK8wpZxQmyg8Dl3JiHiUV+QhE9eNpMa0+ flRTJc9U/nlQLxABRHotoIUfMGTrzqRiyoCbCCB6xwHwl6oIraMldydptWAELZqau4aTThE63b/ BSmiyDmhXf8K7HIvISIYl2F8H5UtQPT6OS1tVCSvHjo014Jl4+yASxiSTmsCbNhvxNuUpX3DLaG c2P9Cb2zvdxq+ZJwbj8PaWi5alkeaLtDkWphiz+gEe68y7vTz+nCn6UYf8k+Dqcev4ZdwZzTIbx mM/RvZw0mtsYyWr1EL9/VBO1dnda0Y02pqg16WYYH X-Received: by 2002:a5d:5889:0:b0:431:c60:c5ed with SMTP id ffacd0b85a97d-435699787bbmr26949495f8f.13.1768988763089; Wed, 21 Jan 2026 01:46:03 -0800 (PST) X-Received: by 2002:a5d:5889:0:b0:431:c60:c5ed with SMTP id ffacd0b85a97d-435699787bbmr26949445f8f.13.1768988762620; Wed, 21 Jan 2026 01:46:02 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.129.40]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356997eb1fsm35447176f8f.35.2026.01.21.01.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 01:46:01 -0800 (PST) Date: Wed, 21 Jan 2026 10:46:00 +0100 From: Juri Lelli To: Yuri Andriaccio Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: Re: [RFC PATCH v4 13/28] sched/rt: Update task event callbacks for HCBS scheduling Message-ID: References: <20251201124205.11169-1-yurand2000@gmail.com> <20251201124205.11169-14-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: <20251201124205.11169-14-yurand2000@gmail.com> Hello, On 01/12/25 13:41, Yuri Andriaccio wrote: > Update wakeup_preempt_rt, switched_{from/to}_rt and prio_changed_rt with > rt-cgroup's specific preemption rules: > > - In wakeup_preempt_rt(), whenever a task wakes up, it must be checked if > it is served by a deadline server or it lives on the global runqueue. > Preemption rules (as documented in the function), change based on the > current task and woken task runqueue: > - If both tasks are FIFO/RR tasks on the global runqueue, or the same > cgroup, run as normal. > - If woken is inside a cgroup, but curr is a FIFO task on the global > runqueue, always preempt. If curr is a DEADLINE task, check if the dl > server preempts curr. > - If both tasks are FIFO/RR tasks in served but different groups, check > whether the woken server preempts the current server. > - In switched_from_rt(), perform a pull only on the global runqueue, and > do nothing if the task is inside a group. This will change when > migrations will be added. > - In switched_to_rt(), queue a push only on the global runqueue, while > perform a priority check when the task switching is inside a group. > This will change also when migrations will be added. > - In prio_changed_rt(), queue a pull only on the global runqueue, if the > task is not queued. If the task is queued, run preemption checks only > if both the prio changed task and curr are in the same cgroup. > > Update sched_rt_can_attach() to check if a task can be attached to a given > cgroup. For now the check only consists in checking if the group has > non-zero bandwidth. Remove the tsk argument from sched_rt_can_attach, as > it is unused. > > Change cpu_cgroup_can_attach() to check if the attachee is a FIFO/RR > task before attaching it to a cgroup. > > Update __sched_setscheduler() to perform checks when trying to switch > to FIFO/RR for a task inside a cgroup, as the group needs to have > runtime allocated. > > Update task_is_throttled_rt() for SCHED_CORE, returning the is_throttled > value of the server if present, while global rt-tasks are never throttled. > > Co-developed-by: Alessio Balsini > Signed-off-by: Alessio Balsini > Co-developed-by: Andrea Parri > Signed-off-by: Andrea Parri > Co-developed-by: luca abeni > Signed-off-by: luca abeni > Signed-off-by: Yuri Andriaccio > --- ... > @@ -1777,16 +1841,25 @@ prio_changed_rt(struct rq *rq, struct task_struct *p, int oldprio) > * If our priority decreases while running, we > * may need to pull tasks to this runqueue. > */ > - if (oldprio < p->prio) > - rt_queue_pull_task(rt_rq_of_se(&p->rt)); > + if (!IS_ENABLED(CONFIG_RT_GROUP_SCHED) && oldprio < p->prio) > + rt_queue_pull_task(rt_rq); Does this mean priority decreases never trigger pulls when CONFIG_RT_ SCHED_GROUP is enabled, even for global runqueue? Thanks, Juri