Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2689709rdb; Wed, 4 Oct 2023 08:36:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+MpAol/vOUQjBroQVE2KxsGdJt3ZWIsetzaA4ZxL/0e1e3PJpPjqcb+8L1nd4xEwFt+q1 X-Received: by 2002:a17:902:d352:b0:1c8:77f2:7d20 with SMTP id l18-20020a170902d35200b001c877f27d20mr1583082plk.31.1696433759817; Wed, 04 Oct 2023 08:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696433759; cv=none; d=google.com; s=arc-20160816; b=W0tW5TQp73Pvix5deNhUIZS7UAsVrkRKdLrUnxQ17XFL2yu6u6ITJRJflLsIBbthP2 X35xYX9V+YJuVDLSJ6/RpHRyOhfeJ+v5rZDC5H5RK4DX5edq/nbBF5xn+oSVLgTsWF3y d/02jgi6ztTFtg/ECZG+toLlto9lkoREpi6uWpuTCPxuzO9QPmyR6RwOyXQDTyXKfYHi +4532W4VN3lICIwJI97U6oZ8OEESVL9rCCDX8RFTt1Exdrd7ZS1OtQp/NKEnf8rTAWyC Jh+Tqw+78TnEzXxbB6jcrnOOFjuqKK2cXBWI/j5wGh92BQMk/SeX0KAL6/FWUNqmud10 fQRg== 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=4sRnG2yg4I61J1F96z6/qMAsZlsk2UA4qVDxZItMXbI=; fh=F8NfR8VPTwDbWjfETXiLar0ihNWLfSaK02PPrzfayVE=; b=us31Vx97oYXsQa5fUdW5q7xGcyfyjNWD2kDDGFVDuCX+p9nz846YonAHiKTrJFC5XQ kX1Knd0kAMVy7bRikQb7D7+k7v5zO/xu115ol1M8pbyKwDZ1ElawvxK0wlaKiCnuDmNc oCoFHiE0diVRzKnc9PWZpK6m3mTeUeEvI4N7eyqrBaXWNHw8uSesAkiwgIyp3zG4iReU 8euTnGL+S8Dn3mRHMdaj/mYgFlndrAgiYgS0bcBMYEDOdLVCkY3l+/UxMswfc0u2Tl05 /Wt6sU4tMX9lfWUTGKPsHL/Iwobj7W5LkTsdvMcIqGxC2SRftlkg/5Jcf7Rn6aqOrLeB Lcdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ajupj+mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a6-20020a170902ecc600b001c3a05b0b58si4225658plh.500.2023.10.04.08.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 08:35:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ajupj+mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 72205802785D; Wed, 4 Oct 2023 08:35:57 -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 S233672AbjJDPfo (ORCPT + 99 others); Wed, 4 Oct 2023 11:35:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbjJDPfm (ORCPT ); Wed, 4 Oct 2023 11:35:42 -0400 Received: from out-203.mta1.migadu.com (out-203.mta1.migadu.com [IPv6:2001:41d0:203:375::cb]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF83FCE for ; Wed, 4 Oct 2023 08:35:38 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696433736; 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=4sRnG2yg4I61J1F96z6/qMAsZlsk2UA4qVDxZItMXbI=; b=ajupj+mSkKwsdquRS64v2Myg5+yUBTjoB4o2b0tk8+3jf60EDCB3kwQPr4RrwoPLMGCKrh kkuxKyEXa0rFrleqFP7GvunVjH0SlbWIYA+jYrdmXfGe/u1DS3m9JHqGZdg4yjxVCJyRI5 /ZwGctS4isFv8tDGs5lUojdozRWCUIA= Date: Wed, 4 Oct 2023 23:35:26 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v4] sched/rt: move back to RT_GROUP_SCHED and rename it child Content-Language: en-US To: Peter Zijlstra Cc: Ingo Molnar , mingo@redhat.com, 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, kernel test robot References: <20230803050317.2240948-1-yajun.deng@linux.dev> <93aa2ee6-3ee4-0129-7160-d3684ba67f56@linux.dev> <20231003163719.GG1539@noisy.programming.kicks-ass.net> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: <20231003163719.GG1539@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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]); Wed, 04 Oct 2023 08:35:57 -0700 (PDT) On 2023/10/4 00:37, Peter Zijlstra wrote: > On Tue, Oct 03, 2023 at 10:55:50PM +0800, Yajun Deng wrote: > >> @Peter, I think I split up this patch into 2 separate patches: >> >>          sched/rt: Introduce for_each_sched_rt_entity_back() & use it > Why ?? Having that macro makes no sense what so ever. You can't use it, > unless you set up the back pointers first. It is not a self contained > piece of functionality. The 2nd patch rely on this patch. It will be used in dequeue_rt_stack. We need to add a macro first, because the 'back' will be not exist after the 2nd patch when disable CONFIG_RT_GROUP_SCHED. diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 88fc98601413..0b6b4a715d6e 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -520,6 +520,9 @@ static inline struct task_group *next_task_group(struct task_group *tg)  #define for_each_sched_rt_entity(rt_se) \      for (; rt_se; rt_se = rt_se->parent) +#define for_each_sched_rt_back(rt_se) \ +    for (; rt_se; rt_se = rt_se->back) +  static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)  {      return rt_se->my_q; @@ -625,6 +628,9 @@ typedef struct rt_rq *rt_rq_iter_t;  #define for_each_sched_rt_entity(rt_se) \      for (; rt_se; rt_se = NULL) +#define for_each_sched_rt_entity_back(rt_se) \ +    for_each_sched_rt_entity(rt_se) +  static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)  {      return NULL; @@ -1445,7 +1451,8 @@ static void dequeue_rt_stack(struct sched_rt_entity *rt_se, unsigned int flags)      rt_nr_running = rt_rq_of_se(back)->rt_nr_running; -    for (rt_se = back; rt_se; rt_se = rt_se->back) { +    rt_se = back; +    for_each_sched_rt_entity_back(rt_se) {          if (on_rt_rq(rt_se))              __dequeue_rt_entity(rt_se, flags);      } > >>         sched/rt: Move sched_rt_entity::back to under the >> CONFIG_RT_GROUP_SCHED block > This one sure.