From patchwork Mon Oct 9 12:22:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 150032 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1828894vqo; Mon, 9 Oct 2023 05:23:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwTEPIgvXah59ZyiR6OLLo3VuzCvPCtg/KhllgXoHha7LfDMJOGnyGeZEM9bXxRRdcTSzv X-Received: by 2002:a17:902:ced1:b0:1c3:b0c7:38bf with SMTP id d17-20020a170902ced100b001c3b0c738bfmr16707333plg.12.1696854215516; Mon, 09 Oct 2023 05:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696854215; cv=none; d=google.com; s=arc-20160816; b=yu2Y6GkEoBPcX4MNKPAXNH1nbPem1g2KeAmFQk56qN2AUOT0MMlvi0VUiMS7eDCe2b VtOYJ5Fcp8UMKi8wFz/NnR45Vm2tFzGE/tY4lpz8oA6VN1cZnyMjab9t9Uf/MG6S9k7A +JVx5kzMmopLopF+oHyKTDcXL6XZyPjcTEZSGqed3d4KfWRHQlR5wGG/vJG2zjmIYA6b N8W0of3zjCdWR4+6OK3kwF2jcICAsHpYch7tsFteOhrXUXS0vTjSYILjckkYCaxsoOMu 0qPadfYKVBKh6MrqsRAcsh9c1uSB69NnKkrQtYOtksleOyCom6UBmW2452fFuhE1nYeW j+Gg== 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.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id p30-20020a63741e000000b0056f8fdb4430si9546020pgc.893.2023.10.09.05.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; 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.31 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 morse.vger.email (Postfix) with ESMTP id 4A1CD80203F4; Mon, 9 Oct 2023 05:23:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376284AbjJIMX2 (ORCPT + 18 others); Mon, 9 Oct 2023 08:23:28 -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 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 05:23:33 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779280605673773576 X-GMAIL-MSGID: 1779280605673773576 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;