Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp940582lqj; Mon, 3 Jun 2024 05:52:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxJLkaBwTVZc2RVoBqY8pn3/Y5kJgfPeruNajwKNIcBruJ1iZuY8lfiNy3DHurTA6FNBDoutBHpbRAXm9gyl75TAWX5skkpQg4T0RGbg== X-Google-Smtp-Source: AGHT+IFD1YqHnR0Ps3H0axsGXbNVlV57KSkZsGxdlrmHP/lj683fhWPwJazLYBW6WLFE91/abjin X-Received: by 2002:a17:90b:4f41:b0:2c2:4129:91a6 with SMTP id 98e67ed59e1d1-2c241299e94mr1598981a91.42.1717419162541; Mon, 03 Jun 2024 05:52:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717419162; cv=pass; d=google.com; s=arc-20160816; b=Jm7xpB0Q0e73rG923CI51Ti/cevoC5v2Mb5g9H79Po+NZsAhUe1iQNzRT/8iqV5cbM /vdJp6Z7KvX/9kahFwqG+wP998mOclb46WwlsLuM0g7Yo3LVBGxQ271fy/lziG+H6uOI 2DGX73VjLMAeBwv2r3PUnF/oCvsYYVNcyjYH1161A9c6aSUoIfHKVjRiSbCzuQ6JgmO3 lfenD94pac1yEr/NsMmrQL/qFI5oQ5b9ywdfMq5POKDOV1hGQkX9gMppT07C03b7AShd VVtOz+r9Aw3QpztnqmywXwxvX3xAyG+2/75Ao+WY1MYWemlTcFKx9u2Dravf9ZIY0wVl 9M2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xgeKLP+6Ei7WwWWp/yRMV4AawW29LI/t4aEV6fabFvU=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=0eUgc5uipMzInAgTcj3euTFgJHu22jhelVOd8ABVamnJHdkzPKHqhCAQ56VBqwLV5G vzuD7NiDtpx68LfBH2bum1skwi+1B8R24inzXcujjSrF0GDviLxullUWVjBQ18ctBWwX 5magxKtS3V/kHlEkaQ4WQ/503c1yXwYV6Murasmv3X6vaxuclP5Q9Q/KuNvVdjy1+6rC 94oQmCGrkjAzbaAJInWLZLi3sQ6j6dHjhAhBSgrGSHPovdqWMaegyW7WGUK8tTNYCkA3 AEko0eKeQIkZZ1Z6tIQ3iwcvc6rWrWHP3l2WVkmOHuYDDl/mSd1bbISDBkGM/fFiyhsZ iDYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=N1g197vK; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-199133-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2410637fesi1221624a91.14.2024.06.03.05.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 05:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199133-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=N1g197vK; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-199133-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 43595281EC4 for ; Mon, 3 Jun 2024 12:50:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD26112C484; Mon, 3 Jun 2024 12:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="N1g197vK" Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 48987839EA for ; Mon, 3 Jun 2024 12:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717419041; cv=none; b=UXpbQZQNiYo90mRjmap9tJ3Bguftk6cg8Ubi/96ChbCMeYeRZrWf/FYFkQKdqGdtvyw/ec3qkqeCMeWxqKWYNPCWdw6b6oARhLC0ylWu3kgWUd6YYFX9If5SpFMaQBIanO9re108xI8FAv4z+RD5TdR5u09jLPAvmd9dM0uYpyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717419041; c=relaxed/simple; bh=Xx8hZI8ETFFARLK8cGsQFhmUvgpM/d78SWxzC56NTOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GJvgJ5RvLfHlS5Er9hkQm4XwxCLmue8v8LbYLKH7HSUD+z/T/l7nxM7tBxFQeRf/axhd8oWy7XfSeOLWkaZnB2hYEZwZnQgthr8f9xGHZecyvepSsKY4APzHZRQlMjayADOA2xj71iCcbH+1rG3Z/jcKgKZwv9r/eZpwE7hrEV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=N1g197vK; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: mingo@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717419037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xgeKLP+6Ei7WwWWp/yRMV4AawW29LI/t4aEV6fabFvU=; b=N1g197vK3VTZ2J7/8XHk2GOHHCzRQQoMMbmV7UqK4R/ECCSq9+K3dwmpmaymCVDYfaSKyG extP3RgXsUWSsHD3FZZ6pjfFK8shp1fOV/iyLW0g0mX2qF6cUfPLJ1MEnxKue6vnBT3RoO 6HsBBNuggdKUgkK24jIKOKn/n68TAXA= X-Envelope-To: peterz@infradead.org X-Envelope-To: juri.lelli@redhat.com X-Envelope-To: vincent.guittot@linaro.org X-Envelope-To: dietmar.eggemann@arm.com X-Envelope-To: rostedt@goodmis.org X-Envelope-To: bsegall@google.com X-Envelope-To: mgorman@suse.de X-Envelope-To: bristot@redhat.com X-Envelope-To: vschneid@redhat.com X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: yajun.deng@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH 1/2] sched/rt: Use 'back' only if CONFIG_RT_GROUP_SCHED is enabled Date: Mon, 3 Jun 2024 20:50:01 +0800 Message-Id: <20240603125002.3086-2-yajun.deng@linux.dev> In-Reply-To: <20240603125002.3086-1-yajun.deng@linux.dev> References: <20240603125002.3086-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The 'back' member in struct sched_rt_entity only related to CONFIG_RT_GROUP_SCHED, so there is no need to init it in dequeue_rt_stack. Init the 'back' member in init_tg_rt_entry and use it only if CONFIG_RT_GROUP_SCHED is enabled. Signed-off-by: Yajun Deng --- kernel/sched/rt.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 63e49c8ffc4d..44bb9087cfe5 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -232,8 +232,10 @@ void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq, if (!parent) rt_se->rt_rq = &rq->rt; - else + else { rt_se->rt_rq = parent->my_q; + parent->back = rt_se; + } rt_se->my_q = rt_rq; rt_se->parent = parent; @@ -1428,16 +1430,19 @@ static void dequeue_rt_stack(struct sched_rt_entity *rt_se, unsigned int flags) struct sched_rt_entity *back = NULL; unsigned int rt_nr_running; - for_each_sched_rt_entity(rt_se) { - rt_se->back = back; + for_each_sched_rt_entity(rt_se) back = rt_se; - } rt_nr_running = rt_rq_of_se(back)->rt_nr_running; - for (rt_se = back; rt_se; rt_se = rt_se->back) { + for (rt_se = back; rt_se; ) { if (on_rt_rq(rt_se)) __dequeue_rt_entity(rt_se, flags); +#ifdef CONFIG_RT_GROUP_SCHED + rt_se = rt_se->back; +#else + rt_se = NULL; +#endif } dequeue_top_rt_rq(rt_rq_of_se(back), rt_nr_running); -- 2.25.1