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.133.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 921F352F88 for ; Thu, 15 Jan 2026 14:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768487612; cv=none; b=ieiiLTUqsjj/DVf3cO3UkYStfdWPSph1+dotoLUVrVTcW5y3h61vZ9mKK/xuVOpXyn6auk7RAxZNoeYTN0DKaQQv5ccFAC47B2GUVaEAjzhfHmtXWksc4TGsHaEFlmWKYaXKvVgWB0Yn1Il7MyxuAH+FRM9l7zchnTotafY9uNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768487612; c=relaxed/simple; bh=OX3qIQ+sya/1AlTMh5dZYlAi9d5ObmJ43p3DjFw9LrI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pyoi3Xvlk6LTvX+m3nSwB8X+NPuMgDRBmcYyzK80UTlMbYcShik5kg4PBqengOKiKK/pRmU3mBUeeRif2lGs+Sf2rynlyORF6vRKQ1KIgSrDkw6bOJuRz7XuhXZIt4h5dloro8m8RtYumRJZfe07olRPn4cjO4tNDfybCloMOzA= 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=W6fYvaM2; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=gGgybjRE; arc=none smtp.client-ip=170.10.133.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="W6fYvaM2"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="gGgybjRE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768487610; 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=7KyZAQa7nG4ziFCcMCIA2ut4t1h14xuXW+CZ6FE1Rn0=; b=W6fYvaM2H1Iw5R1LuMU2puJt2lXd8HJBc0FhE8U6C5pH2n1nKZqRQ/67W4PeOh97y4jvdt Z2nrr2FjunoRHCTIdvzvbpBJ0siOQP6w2zjNJ8xtdy0zd/U4iikLtV12RcuZX2PyWPBUIh rmtjGBJ5vKXn7glZ1eTStkcoK1pgmhE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-Mt6R5__DOzy3QBdc1J6OyQ-1; Thu, 15 Jan 2026 09:33:29 -0500 X-MC-Unique: Mt6R5__DOzy3QBdc1J6OyQ-1 X-Mimecast-MFC-AGG-ID: Mt6R5__DOzy3QBdc1J6OyQ_1768487608 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-432c05971c6so680205f8f.1 for ; Thu, 15 Jan 2026 06:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1768487608; x=1769092408; 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=7KyZAQa7nG4ziFCcMCIA2ut4t1h14xuXW+CZ6FE1Rn0=; b=gGgybjRETnDb10FlNG4PA2YbV+cAYs8SNeN87VvCoJ1ZtsfsibysyiPeL1FdYXWyOH VINjvSmIZY5yp4knyedKDDwIO16J/zYb9Ldo83lbt5mgYnbxPmAaWrYrXzDODR6daLgI JFKi/ENN4gb+vO8o9B4hU9bnYYbFIr3k99vakdJQgSfyPHYnIQuk8z0h8VBSAbUxFmzs 38vFDwGcnTCtbY4XxB92jKVjgdd9mhupv7Asl4Ly8R7uPUhyWTfY7l0oK6f64RBNllPx JdOCPXFXOCDms3HbXzh8MGd/3rBcFZJ63L+wY8CgD3y0/kUlu141xexv+Hexst1bGdy+ 63Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768487608; x=1769092408; 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=7KyZAQa7nG4ziFCcMCIA2ut4t1h14xuXW+CZ6FE1Rn0=; b=q20OCJ4bI8GDUx9CJggS/OlSaS3AfdohgNjGZeAl4XJKBRUnmJ80ACnJqfbxc10qcO P+qzieWDA0Y6qu4PcTt41ODkUDpcHksk1MONNe91jqKGpb0/caYwwafv18YjNKyTpetU d2LAmDXNpGOifFjSc+iUMG8k/9b/SCApy7jISFBy/IcTc4ztrz3dbuVucHiWhgFpjDkN LF3822bIFICTKxOQxGFeb/I+JdazHdZ8zo1ACDppNlL3GFCzg8KpqktFvGXp3Q8zHYHs EE/3DqXEz1XFHD9SPY/LBMaduwrk9T+3EU0MYcwA3CIleMSw0jk6GrtNnqSoXJHOw8nr +wnA== X-Forwarded-Encrypted: i=1; AJvYcCWb9+iJUw1F4ag6hO4KP2uyGxYu5vSm0LhrwXtEvM8K0deQfDQqXi2lVY66CU2CqTkO+JpLXKTWPFbT41U=@vger.kernel.org X-Gm-Message-State: AOJu0Yxw3a6CIBoFpt7WJ/4SrpDfyPPIBK1izLNEEZx52ogz39dGWTBY ZBDrV/EvhmJWBpLtK14u8lpeRLb9VU0AFIOtxCeeVyDYWPRZ+d3O9flpBSD2mC5B3B/d1srRA7B 3N8Ft8omyAf3NQSkmVpSgV7RbYhSyWqzu3v7hJzO+us8OBgS7nYr2M5EjzXBy6AussA== X-Gm-Gg: AY/fxX5+HPXSii7IPgXcDvn1uwRyMx+OTkhXyV3dedNtxiDALwzyKUYCZrPG96QV+5Z xbu3prGQHeRwZtZ5/xLfgOxn3AvmdH6oj7aPZGQnOQQgNJZ7DPUd3+cphyhYIIf4ahR11RENg/d i6HFvXJS+iAHoPOAS78l0unqV9pzIZAfP9WtCaC0UHohj94UvZHmS2Q8W+crnGtVrDAs3iw6Fk3 FKBpRYsf+g7Jw/IosEdy/1PgZRCHr4eRDFESo4KuMe7WDP7maCLW6XGyAe5CKgqV2pP6WM5tpMk Y/xIFFT9HInzcOQvPYrjZU5DX3ztS6gwdMpyc9OnX5o5CcT5BtGMaEu/GqOZ6ZYRbHmKFsDj9cs Jm03P0fc+BmItERYPNra0IffEQgx2goP/0poK4m+E X-Received: by 2002:a05:6000:258a:b0:430:fae3:c833 with SMTP id ffacd0b85a97d-434d755262bmr4393653f8f.7.1768487607790; Thu, 15 Jan 2026 06:33:27 -0800 (PST) X-Received: by 2002:a05:6000:258a:b0:430:fae3:c833 with SMTP id ffacd0b85a97d-434d755262bmr4393609f8f.7.1768487607369; Thu, 15 Jan 2026 06:33:27 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.129.40]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-434a4cf4140sm6493339f8f.0.2026.01.15.06.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 06:33:26 -0800 (PST) Date: Thu, 15 Jan 2026 15:33:24 +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 03/28] sched/rt: Pass an rt_rq instead of an rq where needed Message-ID: References: <20251201124205.11169-1-yurand2000@gmail.com> <20251201124205.11169-4-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-4-yurand2000@gmail.com> Hello, On 01/12/25 13:41, Yuri Andriaccio wrote: > From: luca abeni > > Make rt.c code access the runqueue through the rt_rq data structure rather > than passing an rq pointer directly. This allows future patches to define > rt_rq data structures which do not refer only to the global runqueue, but > also to local cgroup runqueues (as rt_rq will not be always equal to > &rq->rt). > > Add checks in rt_queue_{push/pull}_tasks to make sure that the given rt_rq > object refers to a global runqueue and not any local one. > > Signed-off-by: luca abeni > Signed-off-by: Yuri Andriaccio > --- > kernel/sched/rt.c | 99 ++++++++++++++++++++++++++--------------------- > 1 file changed, 54 insertions(+), 45 deletions(-) > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > index 7936d43337..b7bf80a571 100644 > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -370,9 +370,9 @@ static inline void rt_clear_overload(struct rq *rq) > cpumask_clear_cpu(rq->cpu, rq->rd->rto_mask); > } > > -static inline int has_pushable_tasks(struct rq *rq) > +static inline int has_pushable_tasks(struct rt_rq *rt_rq) > { > - return !plist_head_empty(&rq->rt.pushable_tasks); > + return !plist_head_empty(&rt_rq->pushable_tasks); > } > > static DEFINE_PER_CPU(struct balance_callback, rt_push_head); > @@ -381,50 +381,54 @@ static DEFINE_PER_CPU(struct balance_callback, rt_pull_head); > static void push_rt_tasks(struct rq *); > static void pull_rt_task(struct rq *); > > -static inline void rt_queue_push_tasks(struct rq *rq) > +static inline void rt_queue_push_tasks(struct rt_rq *rt_rq) > { > - if (!has_pushable_tasks(rq)) > + struct rq *rq = container_of(rt_rq, struct rq, rt); Might be a minor thing, but I just noticed https://elixir.bootlin.com/linux/v6.18-rc6/source/include/linux/container_of.h#L17 so, we might want to use container_of_const() here and below. Not that it makes a difference for these cases, but the indication for new code seems strict. Peter, not sure if you have a preference here? Thanks, Juri