Message ID | 20231115113341.13261-3-CruzZhao@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2474119vqg; Wed, 15 Nov 2023 03:34:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIJe7yFN2bEVZz8ESEnTeDpq772LOHu1z6dzZUrQpqODMRxAoVLW6+YELsr2grzcWdlSxP X-Received: by 2002:a05:6808:13c7:b0:3a3:e638:78d2 with SMTP id d7-20020a05680813c700b003a3e63878d2mr14874483oiw.12.1700048081018; Wed, 15 Nov 2023 03:34:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700048080; cv=none; d=google.com; s=arc-20160816; b=h2JIuS+kN0YU7Xhuymc45UsOYA9xySSp9dFqulHCL8/x1I1JI28h/WWGCROCB+yz7u aVAXL2OLSzgPp2COtIdDzEgT9ioi00mPHGg/y4GmStSQxXgvxIQS27r+LPzk7iABRIWy OsudymyOjGipqSV9hc56jZ0jGGsjcJQI2bNyA4nET8EUxj3cDL/gcBg0UyUqLOQHS80b 84FUNkF2pGHK4bs0/CgTDTHcje7UhYAVgOUTRiHd4Lqiyhb8y95nbnGrWafEF+Lu4/Ix SXMoXpLNYv9lN5eouFv5u5oq18adFm0kFfLOF4oxSeBsaM8sH47UaEe2bQN5uiPcfvRk +gIQ== 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; bh=A1KlAhQNPumT0YG8taAGyNgkIK9PUlK6jEwnMeYE2aA=; fh=QlmRtWuTYJDhaxF0GCu0nvK7RUqeTMNKD6hMg0kv7eo=; b=onzq3dHDNQMC14o3xv1E9Sa5xeKP4GOIuWDRLXSZaZdQ73uUCZaq6hAyetQteQXrN6 Zkwa/9MDc/qDmQ/Au8lZJoxYTV4GLOwQaFFGdAhAF9CCSK46/uXJzkB38rKQ35Usb7MZ jQQEW/7hjIx+fR3nA89cq3XGIiIThnQsxtg5ynnLeSQWvIz7mN187R77sk0/lgKi+W23 /LWDVK1QRKdiGfFYJiuC7vsSj9VyHAxzLNVCmmm4Avg9pi1wOyP9XC6i8FH4KEetS/41 0eb1tZPuZiRiUHRmOhkBOv1RGgmvvDh6HT0pgTFZ+GiYt457mQ/tkFgAUpvT0i6mKSeN yYug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l189-20020a6388c6000000b005b8eaeabf49si10152488pgd.178.2023.11.15.03.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 03:34:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2040F801C19D; Wed, 15 Nov 2023 03:34:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234948AbjKOLeC (ORCPT <rfc822;heyuhang3455@gmail.com> + 28 others); Wed, 15 Nov 2023 06:34:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234680AbjKOLd6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Nov 2023 06:33:58 -0500 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCB9AE9 for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 03:33:54 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R611e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=cruzzhao@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VwSxxNQ_1700048031; Received: from localhost.localdomain(mailfrom:CruzZhao@linux.alibaba.com fp:SMTPD_---0VwSxxNQ_1700048031) by smtp.aliyun-inc.com; Wed, 15 Nov 2023 19:33:52 +0800 From: Cruz Zhao <CruzZhao@linux.alibaba.com> 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, joel@joelfernandes.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/4] sched/core: introduce core to struct cfs_rq Date: Wed, 15 Nov 2023 19:33:39 +0800 Message-Id: <20231115113341.13261-3-CruzZhao@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231115113341.13261-1-CruzZhao@linux.alibaba.com> References: <20231115113341.13261-1-CruzZhao@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 03:34:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782629616638335882 X-GMAIL-MSGID: 1782629616638335882 |
Series |
sched/core: fix cfs_prio_less
|
|
Commit Message
cruzzhao
Nov. 15, 2023, 11:33 a.m. UTC
Introduce core to struct cfs_rq, indicates the corresponding cfs_rq of
rq->core.
Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com>
---
kernel/sched/core.c | 4 ++++
kernel/sched/fair.c | 11 +++++++++++
kernel/sched/sched.h | 1 +
3 files changed, 16 insertions(+)
Comments
Hi Cruz,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.7-rc1 next-20231115]
[cannot apply to tip/sched/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Cruz-Zhao/sched-core-introduce-core_id-to-struct-rq/20231115-193559
base: linus/master
patch link: https://lore.kernel.org/r/20231115113341.13261-3-CruzZhao%40linux.alibaba.com
patch subject: [PATCH 2/4] sched/core: introduce core to struct cfs_rq
config: x86_64-buildonly-randconfig-003-20231116 (https://download.01.org/0day-ci/archive/20231116/202311160433.4Jcpw1My-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231116/202311160433.4Jcpw1My-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311160433.4Jcpw1My-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/sched/fair.c:12423:6: warning: no previous prototype for 'sched_core_init_cfs_rq' [-Wmissing-prototypes]
12423 | void sched_core_init_cfs_rq(struct task_group *tg, struct cfs_rq *cfs_rq)
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/sched_core_init_cfs_rq +12423 kernel/sched/fair.c
12422
12423 void sched_core_init_cfs_rq(struct task_group *tg, struct cfs_rq *cfs_rq)
12424 {
12425 #ifdef CONFIG_FAIR_GROUP_SCHED
12426 struct rq *rq = rq_of(cfs_rq);
12427 int core_id = rq->core_id;
12428
12429 cfs_rq->core = tg->cfs_rq[core_id];
12430 #endif
12431 }
12432
Hi Cruz,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc1 next-20231115]
[cannot apply to tip/sched/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Cruz-Zhao/sched-core-introduce-core_id-to-struct-rq/20231115-193559
base: linus/master
patch link: https://lore.kernel.org/r/20231115113341.13261-3-CruzZhao%40linux.alibaba.com
patch subject: [PATCH 2/4] sched/core: introduce core to struct cfs_rq
config: x86_64-buildonly-randconfig-004-20231116 (https://download.01.org/0day-ci/archive/20231116/202311160408.5eq3Ye68-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231116/202311160408.5eq3Ye68-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311160408.5eq3Ye68-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/sched/fair.c: In function 'alloc_fair_sched_group':
>> kernel/sched/fair.c:12728:17: error: implicit declaration of function 'sched_core_init_cfs_rq'; did you mean 'sched_core_idle_cpu'? [-Werror=implicit-function-declaration]
12728 | sched_core_init_cfs_rq(tg, cfs_rq);
| ^~~~~~~~~~~~~~~~~~~~~~
| sched_core_idle_cpu
cc1: some warnings being treated as errors
vim +12728 kernel/sched/fair.c
12697
12698 int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
12699 {
12700 struct sched_entity *se;
12701 struct cfs_rq *cfs_rq;
12702 int i;
12703
12704 tg->cfs_rq = kcalloc(nr_cpu_ids, sizeof(cfs_rq), GFP_KERNEL);
12705 if (!tg->cfs_rq)
12706 goto err;
12707 tg->se = kcalloc(nr_cpu_ids, sizeof(se), GFP_KERNEL);
12708 if (!tg->se)
12709 goto err;
12710
12711 tg->shares = NICE_0_LOAD;
12712
12713 init_cfs_bandwidth(tg_cfs_bandwidth(tg), tg_cfs_bandwidth(parent));
12714
12715 for_each_possible_cpu(i) {
12716 cfs_rq = kzalloc_node(sizeof(struct cfs_rq),
12717 GFP_KERNEL, cpu_to_node(i));
12718 if (!cfs_rq)
12719 goto err;
12720
12721 se = kzalloc_node(sizeof(struct sched_entity_stats),
12722 GFP_KERNEL, cpu_to_node(i));
12723 if (!se)
12724 goto err_free_rq;
12725
12726 init_cfs_rq(cfs_rq);
12727 init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]);
12728 sched_core_init_cfs_rq(tg, cfs_rq);
12729 init_entity_runnable_average(se);
12730 }
12731
12732 return 1;
12733
12734 err_free_rq:
12735 kfree(cfs_rq);
12736 err:
12737 return 0;
12738 }
12739
Hi Cruz,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.7-rc1 next-20231117]
[cannot apply to tip/sched/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Cruz-Zhao/sched-core-introduce-core_id-to-struct-rq/20231115-193559
base: linus/master
patch link: https://lore.kernel.org/r/20231115113341.13261-3-CruzZhao%40linux.alibaba.com
patch subject: [PATCH 2/4] sched/core: introduce core to struct cfs_rq
config: x86_64-randconfig-123-20231118 (https://download.01.org/0day-ci/archive/20231118/202311181807.OhNGAYXK-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311181807.OhNGAYXK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311181807.OhNGAYXK-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:1178:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity const *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:1178:34: sparse: expected struct sched_entity const *se
kernel/sched/fair.c:1178:34: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:2949:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu * @@
kernel/sched/fair.c:2949:13: sparse: expected struct task_struct *tsk
kernel/sched/fair.c:2949:13: sparse: got struct task_struct [noderef] __rcu *
kernel/sched/fair.c:12185:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12185:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12185:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:7801:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:7801:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:7801:20: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8006:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8006:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:8006:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8105:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8105:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8105:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8385:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8385:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8385:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:9376:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] __rcu *child @@
kernel/sched/fair.c:9376:40: sparse: expected struct sched_domain *child
kernel/sched/fair.c:9376:40: sparse: got struct sched_domain [noderef] __rcu *child
kernel/sched/fair.c:10013:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:10013:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:10013:22: sparse: struct task_struct *
kernel/sched/fair.c:11445:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:11445:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:11445:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:11102:44: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *sd_parent @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:11102:44: sparse: expected struct sched_domain *sd_parent
kernel/sched/fair.c:11102:44: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:11541:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:11541:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:11541:9: sparse: got struct sched_domain [noderef] __rcu *parent
>> kernel/sched/fair.c:12423:6: sparse: sparse: symbol 'sched_core_init_cfs_rq' was not declared. Should it be static?
kernel/sched/fair.c:6418:35: sparse: sparse: marked inline, but without a definition
kernel/sched/fair.c: note: in included file:
kernel/sched/sched.h:2283:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2283:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2283:9: sparse: struct task_struct *
kernel/sched/sched.h:2119:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2119:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2119:25: sparse: struct task_struct *
kernel/sched/sched.h:2119:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2119:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2119:25: sparse: struct task_struct *
vim +/sched_core_init_cfs_rq +12423 kernel/sched/fair.c
12422
12423 void sched_core_init_cfs_rq(struct task_group *tg, struct cfs_rq *cfs_rq)
12424 {
12425 #ifdef CONFIG_FAIR_GROUP_SCHED
12426 struct rq *rq = rq_of(cfs_rq);
12427 int core_id = rq->core_id;
12428
12429 cfs_rq->core = tg->cfs_rq[core_id];
12430 #endif
12431 }
12432
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7a685fae73c4..647a12af9172 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6432,6 +6432,7 @@ static void sched_core_cpu_starting(unsigned int cpu) if (t == cpu) { rq->core = core_rq; rq->core_id = core_id; + rq->cfs.core = &core_rq->cfs; } WARN_ON_ONCE(rq->core != core_rq); @@ -6488,6 +6489,7 @@ static void sched_core_cpu_deactivate(unsigned int cpu) rq = cpu_rq(t); rq->core = core_rq; rq->core_id = core_id; + rq->cfs.core = &core_rq->cfs; } } @@ -6498,6 +6500,7 @@ static inline void sched_core_cpu_dying(unsigned int cpu) if (rq->core != rq) { rq->core = rq; rq->core_id = cpu; + rq->cfs.core = &rq->cfs; } } @@ -10016,6 +10019,7 @@ void __init sched_init(void) #ifdef CONFIG_SCHED_CORE rq->core = rq; rq->core_id = i; + rq->cfs.core = &rq->cfs; rq->core_pick = NULL; rq->core_enabled = 0; rq->core_tree = RB_ROOT; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2048138ce54b..61cbaa3cc385 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12420,6 +12420,16 @@ bool cfs_prio_less(const struct task_struct *a, const struct task_struct *b, return delta > 0; } +void sched_core_init_cfs_rq(struct task_group *tg, struct cfs_rq *cfs_rq) +{ +#ifdef CONFIG_FAIR_GROUP_SCHED + struct rq *rq = rq_of(cfs_rq); + int core_id = rq->core_id; + + cfs_rq->core = tg->cfs_rq[core_id]; +#endif +} + static int task_is_throttled_fair(struct task_struct *p, int cpu) { struct cfs_rq *cfs_rq; @@ -12715,6 +12725,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) init_cfs_rq(cfs_rq); init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]); + sched_core_init_cfs_rq(tg, cfs_rq); init_entity_runnable_average(se); } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 1b62165fc840..62fca54223a1 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -547,6 +547,7 @@ struct cfs_rq { #ifdef CONFIG_SCHED_CORE unsigned int forceidle_seq; u64 min_vruntime_fi; + struct cfs_rq *core; #endif #ifndef CONFIG_64BIT