Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1856724rdb; Mon, 9 Oct 2023 05:23:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzw08MHFhTruKDC9bazRRK9hpsHykWY+oombPihaKBwPnXLC8WmcWuiGtrsWh+ccyChzFV X-Received: by 2002:a17:902:d4c5:b0:1c5:6f4d:d6dd with SMTP id o5-20020a170902d4c500b001c56f4dd6ddmr18674548plg.24.1696854220882; Mon, 09 Oct 2023 05:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696854220; cv=none; d=google.com; s=arc-20160816; b=qUebC53dBUbAH0e2jLwaC35NWRJ93IuU1LI3P6cCuKFSvr2Dt1+ADFrVn3bfIg65Xx KNE4/FdunejLnV15ffe7yegvMsAAzUlWuNfjGiA6ikENmJlFQdtv14YTgBx1YG3qSDu0 eQeqS7fvvs5Sl90K8N5AjjYgB1wgLrWzocRznIJQ51y73my0AARMW/jX+rGh7IM8R1aJ THPnBwn2WwbFcdU30VxW68M0y/NOm6jvxSgekMcgcuEWK0RljHLDkd/XvYyqL20Q8CXi wi7eCTg7L3RveFQq6i5tgVO94Y2r4pOvpFD5EEpGDbpAzSPr8sP96ecu9qd/iuXSJvVp D4Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YTkuKu1fmFP1M034eiGkI3GZ+Be2ZuV6kkNwoobSAUo=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=KAL28COuWKPAYluEXeegzYI9q3U4+bkD3sAinCuTMJX0iwXy3Xj7kjQ35zB+TpEEYw 4WPYR3kAP+9b88kdvlvwNLUKPAUYDlrr8F+mdKvKqm6Lxtjx+rylOVGN3ymZNql3qa5z lODF6pGygdJ27SaUaT1Wzm3WQ3q1VNHcUSDq+MPc3m2XsV4ekwu6RnlTS4bEz78dEJoj DV90oY/u/+emz3XHaARV0F6N0ggBKTflptwdC5okvUe8yi7zCJVTbyaMYfSHTpzpgYcg MXgWq+N8pPfrtKwOYtX46VCbqyTMX+qNVadzFMDozfFrhUwz3ptXbaElW6GWsG5/dC18 DD4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ljkycbSm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t64-20020a638143000000b00565eccbc52fsi9707009pgd.303.2023.10.09.05.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ljkycbSm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 65C9D80BD395; Mon, 9 Oct 2023 05:23:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346549AbjJIMX1 (ORCPT + 99 others); Mon, 9 Oct 2023 08:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346541AbjJIMXY (ORCPT ); Mon, 9 Oct 2023 08:23:24 -0400 Received: from out-206.mta0.migadu.com (out-206.mta0.migadu.com [91.218.175.206]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB02E4 for ; Mon, 9 Oct 2023 05:23:21 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696854199; 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=YTkuKu1fmFP1M034eiGkI3GZ+Be2ZuV6kkNwoobSAUo=; b=ljkycbSmLqUGFWruU2fcp9eRmUqqUsv6xbsMmGj/kikBW3o8UHJ0nwJvd+X5KfoA7JXFUi Rw/aqMblSuY+wXWtnCDmJ1dfy1A0prXXDaqMfgUtD8pvSrx6JRmiz4OOktns3TICPmxN+1 T1L2gPv2+mRV0MLQucM79pD2L5N7dmI= 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 v7 2/3] sched/rt: Init 'back' in init_tg_rt_entry Date: Mon, 9 Oct 2023 20:22:43 +0800 Message-Id: <20231009122244.2394336-3-yajun.deng@linux.dev> In-Reply-To: <20231009122244.2394336-1-yajun.deng@linux.dev> References: <20231009122244.2394336-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 05:23:38 -0700 (PDT) X-Spam-Level: ** The member 'back' 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 member 'back' in init_tg_rt_entry. Signed-off-by: Yajun Deng --- v7: Init 'back' in init_tg_rt_entry. v6: Independent patch. v5: Resend it. v4: Missed rt_se = root in dequeue_rt_stack(). v3: Keep parent is NULL in init_tg_rt_entry(). v2: Add WARN_ON_ONCE in init_tg_rt_entry(). v1: https://lore.kernel.org/all/20230801062714.3424299-1-yajun.deng@linux.dev/ --- kernel/sched/rt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 642edbd24ffb..0d9e83c6fb71 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -233,8 +233,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; @@ -1444,10 +1446,8 @@ 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; -- 2.25.1