Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1819855rdb; Mon, 9 Oct 2023 04:13:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFDYTYCEFkSCovEtSs/womy0fQj7rHJx7KalMuD7JLQcRA8MWQVcpPNj0WF/gU20SxOiMc X-Received: by 2002:a17:902:dacb:b0:1c9:9e2c:5268 with SMTP id q11-20020a170902dacb00b001c99e2c5268mr2215368plx.25.1696850025292; Mon, 09 Oct 2023 04:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696850025; cv=none; d=google.com; s=arc-20160816; b=VEVmq5N1cOeIEpVAzJPkTKUYOA4YIk9dvZbTVZ+EgzcEN3tBLw1OQcHtPuvsubm7NB jP1f8vwzxkhSH3O/d5V+o7HngOHJRvb7DxUUlaTOw5wti1BI8RgKsrHcOpIYPR1LX8ZK QlxlVjdLqZApKIF6/2AsXC1r8c5ScCpAuxNTUY8ewqeuSFxlyNQYvDGF2f7frhu8D9B+ xOFmHF6lN7dria0i8EsWH289DKbKUQdsSDedMvW5z7joj1FdXQofT0id5uXaZ3+Nb/aj 1M0C05CGYbvuw7+FX7VwCXt6y4mT2CK0eeuu3PuUX2IzBJ6F/4euVUCdoTx+TE31sOSk rY9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=6bujvWT1GknYcY3g+1JFcsWNbwZNp5LaRrzpNwllk3A=; fh=yuUYAWVNHOtNOVXfHbDzOfyhHEjVkUA0VR4N/COjqQA=; b=DhcgZgM696vLwmy04uykh8aYZtiKbYdJeJ1kiEuwcbzxM+OB/RsEkbKZ7+C/I9DekN XGMMxEPa8DGZK0l4rOz0z5KWaEoJXe0JKxmhd7bHzFkAb/6JnXoSN6Jh3/cto/moQy9v CXX6Gj7/NlATNcqBdN3UeZK7awDCyVAfDnVI83PFYanADYYGQLUBpohBqX2T8z6tU/Xf qoon9LmKFN12o4vrsndK0f/TifzZQc9SS86dV3kiUoaVw5a+P26P8giybsYVP4MWjmVf EvYvAHheL9FqW2y8VC0y/2n+OTlMBKcmfKEHsl6Vr7maHog9PDVFWo1Gg4q9k8gsoyvH ZU1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wLkUIYxm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n17-20020a170902e55100b001c0a165a219si9979988plf.134.2023.10.09.04.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 04:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wLkUIYxm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A63D98053662; Mon, 9 Oct 2023 04:13:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346186AbjJILNc (ORCPT + 99 others); Mon, 9 Oct 2023 07:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346139AbjJILNb (ORCPT ); Mon, 9 Oct 2023 07:13:31 -0400 Received: from out-202.mta0.migadu.com (out-202.mta0.migadu.com [91.218.175.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C44B94 for ; Mon, 9 Oct 2023 04:13:30 -0700 (PDT) Message-ID: <5a3342ef-f14f-173c-630f-6b474bded257@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696850008; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6bujvWT1GknYcY3g+1JFcsWNbwZNp5LaRrzpNwllk3A=; b=wLkUIYxmmn6cmeSEYoCHAKeBvBQK14NDRGt9x2Qs/LQkAGw12ppUiQDu4TIdxvqjvl92Yw bQdY16/YjA9VxyQeH3tXV42nghOY5yuae7RD/CAEjrOV1A+oWhkpEx2mDTBocPO4NjAHkq tPWvUVo4OVfaO9xKrpZyytyWdqklQXE= Date: Mon, 9 Oct 2023 19:13:18 +0800 MIME-Version: 1.0 Subject: Re: [PATCH 2/2] sched/rt: Move sched_rt_entity::back to under the CONFIG_RT_GROUP_SCHED block Content-Language: en-US To: Ingo Molnar Cc: 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, linux-kernel@vger.kernel.org References: <20231005162317.3343678-1-yajun.deng@linux.dev> <20231005162317.3343678-3-yajun.deng@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 04:13:41 -0700 (PDT) X-Spam-Level: ** On 2023/10/9 18:16, Ingo Molnar wrote: > * Yajun Deng wrote: > >> The member back in struct sched_rt_entity only related to RT_GROUP_SCHED, >> So move sched_rt_entity::back to under the CONFIG_RT_GROUP_SCHED block. It >> will save a few bytes. >> >> Also, init child when parent isn't NULL in init_tg_rt_entry(). >> >> Signed-off-by: Yajun Deng >> --- >> include/linux/sched.h | 2 +- >> kernel/sched/rt.c | 18 +++++++++--------- >> 2 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/include/linux/sched.h b/include/linux/sched.h >> index 292c31697248..d0fe56603e60 100644 >> --- a/include/linux/sched.h >> +++ b/include/linux/sched.h >> @@ -597,8 +597,8 @@ struct sched_rt_entity { >> unsigned short on_rq; >> unsigned short on_list; >> >> - struct sched_rt_entity *back; >> #ifdef CONFIG_RT_GROUP_SCHED >> + struct sched_rt_entity *back; >> struct sched_rt_entity *parent; >> /* rq on which this entity is (to be) queued: */ >> struct rt_rq *rt_rq; > Title claims this change - the rest of the changes should be in a separate > patch: Okay. I will send v2. >> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c >> index 642edbd24ffb..7b3105b875f1 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; >> @@ -1441,23 +1443,21 @@ static void __dequeue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flag >> */ >> static void dequeue_rt_stack(struct sched_rt_entity *rt_se, unsigned int flags) >> { >> - struct sched_rt_entity *back = NULL; >> + struct sched_rt_entity *root = NULL; >> unsigned int rt_nr_running; >> >> - for_each_sched_rt_entity(rt_se) { >> - rt_se->back = back; >> - back = rt_se; >> - } >> + for_each_sched_rt_entity(rt_se) >> + root = rt_se; >> >> - rt_nr_running = rt_rq_of_se(back)->rt_nr_running; >> + rt_nr_running = rt_rq_of_se(root)->rt_nr_running; >> >> - rt_se = back; >> + rt_se = root; >> for_each_sched_rt_entity_back(rt_se) { >> if (on_rt_rq(rt_se)) >> __dequeue_rt_entity(rt_se, flags); >> } >> >> - dequeue_top_rt_rq(rt_rq_of_se(back), rt_nr_running); >> + dequeue_top_rt_rq(rt_rq_of_se(root), rt_nr_running); >> } >> >> static void enqueue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flags) >> -- >> 2.25.1 > Thanks, > > Ingo