Message ID | 20230527173727.1669047-1-linmiaohe@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp233520vqr; Sat, 27 May 2023 02:53:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jSkYqjcHgD/MHURNA/SHOxlTGpqCtIymjt7cj5lMBpCb6jAuk1aISGqByZt2cCB8VlN3U X-Received: by 2002:a17:902:c793:b0:1a9:433e:41e7 with SMTP id w19-20020a170902c79300b001a9433e41e7mr4229003pla.43.1685181188751; Sat, 27 May 2023 02:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685181188; cv=none; d=google.com; s=arc-20160816; b=CeO6BGFeE92kaOLjMiYeRy6pKiGf0+ZLvIahw3EaR/o00Syb6Y4iHrPjwuBNZbWgnZ GlhK2oM77ZXcDCjllA6EHp0F254O8OG/HrXI0gCkQUzkKVXKPiDtLKo4ZBjump8fhDi/ M+U4aQony0NIkc/EK/9mpXpnNNcu477/IlGxeNCTQf3xVa4u5OTD2LQITjsXbcOtX4Ow lodnxg3BNSGJoEsDKtOaCvGFy7BGTZglHcEcxyUoH+IrxSbFqEvnTziJpBNkiFoU2iNp n2t0IrvIzzRRM3NduZ2Upj/U3KT5ZcnKqW3FQ2klF5jCDFEXemLTgoifaT7XAu0dXYdS xYzw== 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 :message-id:date:subject:cc:to:from; bh=Zxj5uZ9goc/I5eGddUrxW27RZntDL0e+42sD82CjjsA=; b=yz8fwJTdRA87QTrNE+oozEu9iIyhess9BLlSXkVQOiG8/vxlsM9obJV+YE/fJhE94M TQt4uvBViq3HEtq1Ku85exTUoizUZePwABQs1OzhbnQ7MwTiuzeDqXJQ3pXQn7NkhufJ lMakhXPPz2g32V85KkEMYtkhjLGZYQa3Db3zG3OQg+VqWXFvrdIDrs41lQhNmNs/s8Nb 26XF85V/l715j+fr5LUvQPjcWDJrg6IZWJQ2xjF4vXMfyL2PynpZy7la/J884JYQJG6K s5QjX8F+hJVW3X6LCQxKDAxvCe+tCr/uRMFZOwakRgzNngiAEsKS6QVRDG4/EkjH3rSa kLfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x185-20020a6386c2000000b004c259db61fdsi3118952pgd.561.2023.05.27.02.52.56; Sat, 27 May 2023 02:53:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbjE0JqS (ORCPT <rfc822;zhanglyra.2023@gmail.com> + 99 others); Sat, 27 May 2023 05:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbjE0JqR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 27 May 2023 05:46:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017F3E3 for <linux-kernel@vger.kernel.org>; Sat, 27 May 2023 02:46:12 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QSxdD6Fs4z18Lk9; Sat, 27 May 2023 17:41:36 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 27 May 2023 17:46:09 +0800 From: Miaohe Lin <linmiaohe@huawei.com> To: <mingo@redhat.com>, <peterz@infradead.org>, <juri.lelli@redhat.com>, <vincent.guittot@linaro.org> CC: <dietmar.eggemann@arm.com>, <rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>, <bristot@redhat.com>, <vschneid@redhat.com>, <linux-kernel@vger.kernel.org>, <linmiaohe@huawei.com> Subject: [PATCH] sched/fair: remove unneeded header files Date: Sun, 28 May 2023 01:37:27 +0800 Message-ID: <20230527173727.1669047-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767040550165960299?= X-GMAIL-MSGID: =?utf-8?q?1767040550165960299?= |
Series |
sched/fair: remove unneeded header files
|
|
Commit Message
Miaohe Lin
May 27, 2023, 5:37 p.m. UTC
There're some useless header files in fair.c. Remove them.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
kernel/sched/fair.c | 12 ------------
1 file changed, 12 deletions(-)
Comments
Hi Miaohe, kernel test robot noticed the following build errors: [auto build test ERROR on tip/sched/core] [also build test ERROR on linus/master v6.4-rc3 next-20230525] [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/Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 base: tip/sched/core patch link: https://lore.kernel.org/r/20230527173727.1669047-1-linmiaohe%40huawei.com patch subject: [PATCH] sched/fair: remove unneeded header files config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20230527/202305271940.9iu2wqRK-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): mkdir -p ~/bin wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/653731fdd11d1ecb757fe4b90484ef4a777fb584 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 git checkout 653731fdd11d1ecb757fe4b90484ef4a777fb584 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross W=1 O=build_dir ARCH=loongarch olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202305271940.9iu2wqRK-lkp@intel.com/ All errors (new ones prefixed by >>): kernel/sched/fair.c: In function 'should_numa_migrate_memory': >> kernel/sched/fair.c:1585:14: error: implicit declaration of function 'node_is_toptier' [-Werror=implicit-function-declaration] 1585 | !node_is_toptier(src_nid)) { | ^~~~~~~~~~~~~~~ kernel/sched/fair.c: In function 'task_numa_work': >> kernel/sched/fair.c:3014:22: error: implicit declaration of function 'vma_migratable' [-Werror=implicit-function-declaration] 3014 | if (!vma_migratable(vma) || !vma_policy_mof(vma) || | ^~~~~~~~~~~~~~ >> kernel/sched/fair.c:3014:46: error: implicit declaration of function 'vma_policy_mof' [-Werror=implicit-function-declaration] 3014 | if (!vma_migratable(vma) || !vma_policy_mof(vma) || | ^~~~~~~~~~~~~~ >> kernel/sched/fair.c:3015:25: error: implicit declaration of function 'is_vm_hugetlb_page' [-Werror=implicit-function-declaration] 3015 | is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { | ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/node_is_toptier +1585 kernel/sched/fair.c c959924b0dc53b Huang Ying 2022-07-13 1572 10f39042711ba2 Rik van Riel 2014-01-27 1573 bool should_numa_migrate_memory(struct task_struct *p, struct page * page, 10f39042711ba2 Rik van Riel 2014-01-27 1574 int src_nid, int dst_cpu) 10f39042711ba2 Rik van Riel 2014-01-27 1575 { cb361d8cdef699 Jann Horn 2019-07-16 1576 struct numa_group *ng = deref_curr_numa_group(p); 10f39042711ba2 Rik van Riel 2014-01-27 1577 int dst_nid = cpu_to_node(dst_cpu); 10f39042711ba2 Rik van Riel 2014-01-27 1578 int last_cpupid, this_cpupid; 10f39042711ba2 Rik van Riel 2014-01-27 1579 33024536bafd91 Huang Ying 2022-07-13 1580 /* 33024536bafd91 Huang Ying 2022-07-13 1581 * The pages in slow memory node should be migrated according 33024536bafd91 Huang Ying 2022-07-13 1582 * to hot/cold instead of private/shared. 33024536bafd91 Huang Ying 2022-07-13 1583 */ 33024536bafd91 Huang Ying 2022-07-13 1584 if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && 33024536bafd91 Huang Ying 2022-07-13 @1585 !node_is_toptier(src_nid)) { 33024536bafd91 Huang Ying 2022-07-13 1586 struct pglist_data *pgdat; c959924b0dc53b Huang Ying 2022-07-13 1587 unsigned long rate_limit; c959924b0dc53b Huang Ying 2022-07-13 1588 unsigned int latency, th, def_th; 33024536bafd91 Huang Ying 2022-07-13 1589 33024536bafd91 Huang Ying 2022-07-13 1590 pgdat = NODE_DATA(dst_nid); c959924b0dc53b Huang Ying 2022-07-13 1591 if (pgdat_free_space_enough(pgdat)) { c959924b0dc53b Huang Ying 2022-07-13 1592 /* workload changed, reset hot threshold */ c959924b0dc53b Huang Ying 2022-07-13 1593 pgdat->nbp_threshold = 0; 33024536bafd91 Huang Ying 2022-07-13 1594 return true; c959924b0dc53b Huang Ying 2022-07-13 1595 } 33024536bafd91 Huang Ying 2022-07-13 1596 c959924b0dc53b Huang Ying 2022-07-13 1597 def_th = sysctl_numa_balancing_hot_threshold; c959924b0dc53b Huang Ying 2022-07-13 1598 rate_limit = sysctl_numa_balancing_promote_rate_limit << \ c959924b0dc53b Huang Ying 2022-07-13 1599 (20 - PAGE_SHIFT); c959924b0dc53b Huang Ying 2022-07-13 1600 numa_promotion_adjust_threshold(pgdat, rate_limit, def_th); c959924b0dc53b Huang Ying 2022-07-13 1601 c959924b0dc53b Huang Ying 2022-07-13 1602 th = pgdat->nbp_threshold ? : def_th; 33024536bafd91 Huang Ying 2022-07-13 1603 latency = numa_hint_fault_latency(page); 33024536bafd91 Huang Ying 2022-07-13 1604 if (latency >= th) 33024536bafd91 Huang Ying 2022-07-13 1605 return false; 33024536bafd91 Huang Ying 2022-07-13 1606 c6833e10008f97 Huang Ying 2022-07-13 1607 return !numa_promotion_rate_limit(pgdat, rate_limit, c6833e10008f97 Huang Ying 2022-07-13 1608 thp_nr_pages(page)); 33024536bafd91 Huang Ying 2022-07-13 1609 } 33024536bafd91 Huang Ying 2022-07-13 1610 10f39042711ba2 Rik van Riel 2014-01-27 1611 this_cpupid = cpu_pid_to_cpupid(dst_cpu, current->pid); 37355bdc5a1298 Mel Gorman 2018-10-01 1612 last_cpupid = page_cpupid_xchg_last(page, this_cpupid); 37355bdc5a1298 Mel Gorman 2018-10-01 1613 33024536bafd91 Huang Ying 2022-07-13 1614 if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) && 33024536bafd91 Huang Ying 2022-07-13 1615 !node_is_toptier(src_nid) && !cpupid_valid(last_cpupid)) 33024536bafd91 Huang Ying 2022-07-13 1616 return false; 33024536bafd91 Huang Ying 2022-07-13 1617 37355bdc5a1298 Mel Gorman 2018-10-01 1618 /* 37355bdc5a1298 Mel Gorman 2018-10-01 1619 * Allow first faults or private faults to migrate immediately early in 37355bdc5a1298 Mel Gorman 2018-10-01 1620 * the lifetime of a task. The magic number 4 is based on waiting for 37355bdc5a1298 Mel Gorman 2018-10-01 1621 * two full passes of the "multi-stage node selection" test that is 37355bdc5a1298 Mel Gorman 2018-10-01 1622 * executed below. 37355bdc5a1298 Mel Gorman 2018-10-01 1623 */ 98fa15f34cb379 Anshuman Khandual 2019-03-05 1624 if ((p->numa_preferred_nid == NUMA_NO_NODE || p->numa_scan_seq <= 4) && 37355bdc5a1298 Mel Gorman 2018-10-01 1625 (cpupid_pid_unset(last_cpupid) || cpupid_match_pid(p, last_cpupid))) 37355bdc5a1298 Mel Gorman 2018-10-01 1626 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1627 10f39042711ba2 Rik van Riel 2014-01-27 1628 /* 10f39042711ba2 Rik van Riel 2014-01-27 1629 * Multi-stage node selection is used in conjunction with a periodic 10f39042711ba2 Rik van Riel 2014-01-27 1630 * migration fault to build a temporal task<->page relation. By using 10f39042711ba2 Rik van Riel 2014-01-27 1631 * a two-stage filter we remove short/unlikely relations. 10f39042711ba2 Rik van Riel 2014-01-27 1632 * 10f39042711ba2 Rik van Riel 2014-01-27 1633 * Using P(p) ~ n_p / n_t as per frequentist probability, we can equate 10f39042711ba2 Rik van Riel 2014-01-27 1634 * a task's usage of a particular page (n_p) per total usage of this 10f39042711ba2 Rik van Riel 2014-01-27 1635 * page (n_t) (in a given time-span) to a probability. 10f39042711ba2 Rik van Riel 2014-01-27 1636 * 10f39042711ba2 Rik van Riel 2014-01-27 1637 * Our periodic faults will sample this probability and getting the 10f39042711ba2 Rik van Riel 2014-01-27 1638 * same result twice in a row, given these samples are fully 10f39042711ba2 Rik van Riel 2014-01-27 1639 * independent, is then given by P(n)^2, provided our sample period 10f39042711ba2 Rik van Riel 2014-01-27 1640 * is sufficiently short compared to the usage pattern. 10f39042711ba2 Rik van Riel 2014-01-27 1641 * 10f39042711ba2 Rik van Riel 2014-01-27 1642 * This quadric squishes small probabilities, making it less likely we 10f39042711ba2 Rik van Riel 2014-01-27 1643 * act on an unlikely task<->page relation. 10f39042711ba2 Rik van Riel 2014-01-27 1644 */ 10f39042711ba2 Rik van Riel 2014-01-27 1645 if (!cpupid_pid_unset(last_cpupid) && 10f39042711ba2 Rik van Riel 2014-01-27 1646 cpupid_to_nid(last_cpupid) != dst_nid) 10f39042711ba2 Rik van Riel 2014-01-27 1647 return false; 10f39042711ba2 Rik van Riel 2014-01-27 1648 10f39042711ba2 Rik van Riel 2014-01-27 1649 /* Always allow migrate on private faults */ 10f39042711ba2 Rik van Riel 2014-01-27 1650 if (cpupid_match_pid(p, last_cpupid)) 10f39042711ba2 Rik van Riel 2014-01-27 1651 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1652 10f39042711ba2 Rik van Riel 2014-01-27 1653 /* A shared fault, but p->numa_group has not been set up yet. */ 10f39042711ba2 Rik van Riel 2014-01-27 1654 if (!ng) 10f39042711ba2 Rik van Riel 2014-01-27 1655 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1656 10f39042711ba2 Rik van Riel 2014-01-27 1657 /* 4142c3ebb685bb Rik van Riel 2016-01-25 1658 * Destination node is much more heavily used than the source 4142c3ebb685bb Rik van Riel 2016-01-25 1659 * node? Allow migration. 10f39042711ba2 Rik van Riel 2014-01-27 1660 */ 4142c3ebb685bb Rik van Riel 2016-01-25 1661 if (group_faults_cpu(ng, dst_nid) > group_faults_cpu(ng, src_nid) * 4142c3ebb685bb Rik van Riel 2016-01-25 1662 ACTIVE_NODE_FRACTION) 10f39042711ba2 Rik van Riel 2014-01-27 1663 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1664 10f39042711ba2 Rik van Riel 2014-01-27 1665 /* 4142c3ebb685bb Rik van Riel 2016-01-25 1666 * Distribute memory according to CPU & memory use on each node, 4142c3ebb685bb Rik van Riel 2016-01-25 1667 * with 3/4 hysteresis to avoid unnecessary memory migrations: 4142c3ebb685bb Rik van Riel 2016-01-25 1668 * 4142c3ebb685bb Rik van Riel 2016-01-25 1669 * faults_cpu(dst) 3 faults_cpu(src) 4142c3ebb685bb Rik van Riel 2016-01-25 1670 * --------------- * - > --------------- 4142c3ebb685bb Rik van Riel 2016-01-25 1671 * faults_mem(dst) 4 faults_mem(src) 10f39042711ba2 Rik van Riel 2014-01-27 1672 */ 4142c3ebb685bb Rik van Riel 2016-01-25 1673 return group_faults_cpu(ng, dst_nid) * group_faults(p, src_nid) * 3 > 4142c3ebb685bb Rik van Riel 2016-01-25 1674 group_faults_cpu(ng, src_nid) * group_faults(p, dst_nid) * 4; 10f39042711ba2 Rik van Riel 2014-01-27 1675 } 10f39042711ba2 Rik van Riel 2014-01-27 1676
Hi Miaohe, kernel test robot noticed the following build errors: [auto build test ERROR on tip/sched/core] [also build test ERROR on linus/master v6.4-rc3 next-20230525] [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/Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 base: tip/sched/core patch link: https://lore.kernel.org/r/20230527173727.1669047-1-linmiaohe%40huawei.com patch subject: [PATCH] sched/fair: remove unneeded header files config: x86_64-randconfig-a012-20230528 (https://download.01.org/0day-ci/archive/20230528/202305280847.ss7JHZEe-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): mkdir -p ~/bin wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/653731fdd11d1ecb757fe4b90484ef4a777fb584 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 git checkout 653731fdd11d1ecb757fe4b90484ef4a777fb584 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202305280847.ss7JHZEe-lkp@intel.com/ All errors (new ones prefixed by >>): >> kernel/sched/fair.c:1585:7: error: implicit declaration of function 'node_is_toptier' is invalid in C99 [-Werror,-Wimplicit-function-declaration] !node_is_toptier(src_nid)) { ^ kernel/sched/fair.c:2844:7: error: implicit declaration of function 'node_is_toptier' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!node_is_toptier(mem_node) && ^ >> kernel/sched/fair.c:3014:8: error: implicit declaration of function 'vma_migratable' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!vma_migratable(vma) || !vma_policy_mof(vma) || ^ >> kernel/sched/fair.c:3014:32: error: implicit declaration of function 'vma_policy_mof' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!vma_migratable(vma) || !vma_policy_mof(vma) || ^ >> kernel/sched/fair.c:3015:4: error: implicit declaration of function 'is_vm_hugetlb_page' is invalid in C99 [-Werror,-Wimplicit-function-declaration] is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { ^ kernel/sched/fair.c:6159:6: warning: no previous prototype for function 'init_cfs_bandwidth' [-Wmissing-prototypes] void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} ^ kernel/sched/fair.c:6159:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} ^ static kernel/sched/fair.c:11973:6: warning: no previous prototype for function 'task_vruntime_update' [-Wmissing-prototypes] void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi) ^ kernel/sched/fair.c:11973:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi) ^ static kernel/sched/fair.c:12595:6: warning: no previous prototype for function 'free_fair_sched_group' [-Wmissing-prototypes] void free_fair_sched_group(struct task_group *tg) { } ^ kernel/sched/fair.c:12595:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void free_fair_sched_group(struct task_group *tg) { } ^ static kernel/sched/fair.c:12597:5: warning: no previous prototype for function 'alloc_fair_sched_group' [-Wmissing-prototypes] int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) ^ kernel/sched/fair.c:12597:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) ^ static kernel/sched/fair.c:12602:6: warning: no previous prototype for function 'online_fair_sched_group' [-Wmissing-prototypes] void online_fair_sched_group(struct task_group *tg) { } ^ kernel/sched/fair.c:12602:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void online_fair_sched_group(struct task_group *tg) { } ^ static kernel/sched/fair.c:12604:6: warning: no previous prototype for function 'unregister_fair_sched_group' [-Wmissing-prototypes] void unregister_fair_sched_group(struct task_group *tg) { } ^ kernel/sched/fair.c:12604:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void unregister_fair_sched_group(struct task_group *tg) { } ^ static 6 warnings and 5 errors generated. vim +/node_is_toptier +1585 kernel/sched/fair.c c959924b0dc53b Huang Ying 2022-07-13 1572 10f39042711ba2 Rik van Riel 2014-01-27 1573 bool should_numa_migrate_memory(struct task_struct *p, struct page * page, 10f39042711ba2 Rik van Riel 2014-01-27 1574 int src_nid, int dst_cpu) 10f39042711ba2 Rik van Riel 2014-01-27 1575 { cb361d8cdef699 Jann Horn 2019-07-16 1576 struct numa_group *ng = deref_curr_numa_group(p); 10f39042711ba2 Rik van Riel 2014-01-27 1577 int dst_nid = cpu_to_node(dst_cpu); 10f39042711ba2 Rik van Riel 2014-01-27 1578 int last_cpupid, this_cpupid; 10f39042711ba2 Rik van Riel 2014-01-27 1579 33024536bafd91 Huang Ying 2022-07-13 1580 /* 33024536bafd91 Huang Ying 2022-07-13 1581 * The pages in slow memory node should be migrated according 33024536bafd91 Huang Ying 2022-07-13 1582 * to hot/cold instead of private/shared. 33024536bafd91 Huang Ying 2022-07-13 1583 */ 33024536bafd91 Huang Ying 2022-07-13 1584 if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && 33024536bafd91 Huang Ying 2022-07-13 @1585 !node_is_toptier(src_nid)) { 33024536bafd91 Huang Ying 2022-07-13 1586 struct pglist_data *pgdat; c959924b0dc53b Huang Ying 2022-07-13 1587 unsigned long rate_limit; c959924b0dc53b Huang Ying 2022-07-13 1588 unsigned int latency, th, def_th; 33024536bafd91 Huang Ying 2022-07-13 1589 33024536bafd91 Huang Ying 2022-07-13 1590 pgdat = NODE_DATA(dst_nid); c959924b0dc53b Huang Ying 2022-07-13 1591 if (pgdat_free_space_enough(pgdat)) { c959924b0dc53b Huang Ying 2022-07-13 1592 /* workload changed, reset hot threshold */ c959924b0dc53b Huang Ying 2022-07-13 1593 pgdat->nbp_threshold = 0; 33024536bafd91 Huang Ying 2022-07-13 1594 return true; c959924b0dc53b Huang Ying 2022-07-13 1595 } 33024536bafd91 Huang Ying 2022-07-13 1596 c959924b0dc53b Huang Ying 2022-07-13 1597 def_th = sysctl_numa_balancing_hot_threshold; c959924b0dc53b Huang Ying 2022-07-13 1598 rate_limit = sysctl_numa_balancing_promote_rate_limit << \ c959924b0dc53b Huang Ying 2022-07-13 1599 (20 - PAGE_SHIFT); c959924b0dc53b Huang Ying 2022-07-13 1600 numa_promotion_adjust_threshold(pgdat, rate_limit, def_th); c959924b0dc53b Huang Ying 2022-07-13 1601 c959924b0dc53b Huang Ying 2022-07-13 1602 th = pgdat->nbp_threshold ? : def_th; 33024536bafd91 Huang Ying 2022-07-13 1603 latency = numa_hint_fault_latency(page); 33024536bafd91 Huang Ying 2022-07-13 1604 if (latency >= th) 33024536bafd91 Huang Ying 2022-07-13 1605 return false; 33024536bafd91 Huang Ying 2022-07-13 1606 c6833e10008f97 Huang Ying 2022-07-13 1607 return !numa_promotion_rate_limit(pgdat, rate_limit, c6833e10008f97 Huang Ying 2022-07-13 1608 thp_nr_pages(page)); 33024536bafd91 Huang Ying 2022-07-13 1609 } 33024536bafd91 Huang Ying 2022-07-13 1610 10f39042711ba2 Rik van Riel 2014-01-27 1611 this_cpupid = cpu_pid_to_cpupid(dst_cpu, current->pid); 37355bdc5a1298 Mel Gorman 2018-10-01 1612 last_cpupid = page_cpupid_xchg_last(page, this_cpupid); 37355bdc5a1298 Mel Gorman 2018-10-01 1613 33024536bafd91 Huang Ying 2022-07-13 1614 if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) && 33024536bafd91 Huang Ying 2022-07-13 1615 !node_is_toptier(src_nid) && !cpupid_valid(last_cpupid)) 33024536bafd91 Huang Ying 2022-07-13 1616 return false; 33024536bafd91 Huang Ying 2022-07-13 1617 37355bdc5a1298 Mel Gorman 2018-10-01 1618 /* 37355bdc5a1298 Mel Gorman 2018-10-01 1619 * Allow first faults or private faults to migrate immediately early in 37355bdc5a1298 Mel Gorman 2018-10-01 1620 * the lifetime of a task. The magic number 4 is based on waiting for 37355bdc5a1298 Mel Gorman 2018-10-01 1621 * two full passes of the "multi-stage node selection" test that is 37355bdc5a1298 Mel Gorman 2018-10-01 1622 * executed below. 37355bdc5a1298 Mel Gorman 2018-10-01 1623 */ 98fa15f34cb379 Anshuman Khandual 2019-03-05 1624 if ((p->numa_preferred_nid == NUMA_NO_NODE || p->numa_scan_seq <= 4) && 37355bdc5a1298 Mel Gorman 2018-10-01 1625 (cpupid_pid_unset(last_cpupid) || cpupid_match_pid(p, last_cpupid))) 37355bdc5a1298 Mel Gorman 2018-10-01 1626 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1627 10f39042711ba2 Rik van Riel 2014-01-27 1628 /* 10f39042711ba2 Rik van Riel 2014-01-27 1629 * Multi-stage node selection is used in conjunction with a periodic 10f39042711ba2 Rik van Riel 2014-01-27 1630 * migration fault to build a temporal task<->page relation. By using 10f39042711ba2 Rik van Riel 2014-01-27 1631 * a two-stage filter we remove short/unlikely relations. 10f39042711ba2 Rik van Riel 2014-01-27 1632 * 10f39042711ba2 Rik van Riel 2014-01-27 1633 * Using P(p) ~ n_p / n_t as per frequentist probability, we can equate 10f39042711ba2 Rik van Riel 2014-01-27 1634 * a task's usage of a particular page (n_p) per total usage of this 10f39042711ba2 Rik van Riel 2014-01-27 1635 * page (n_t) (in a given time-span) to a probability. 10f39042711ba2 Rik van Riel 2014-01-27 1636 * 10f39042711ba2 Rik van Riel 2014-01-27 1637 * Our periodic faults will sample this probability and getting the 10f39042711ba2 Rik van Riel 2014-01-27 1638 * same result twice in a row, given these samples are fully 10f39042711ba2 Rik van Riel 2014-01-27 1639 * independent, is then given by P(n)^2, provided our sample period 10f39042711ba2 Rik van Riel 2014-01-27 1640 * is sufficiently short compared to the usage pattern. 10f39042711ba2 Rik van Riel 2014-01-27 1641 * 10f39042711ba2 Rik van Riel 2014-01-27 1642 * This quadric squishes small probabilities, making it less likely we 10f39042711ba2 Rik van Riel 2014-01-27 1643 * act on an unlikely task<->page relation. 10f39042711ba2 Rik van Riel 2014-01-27 1644 */ 10f39042711ba2 Rik van Riel 2014-01-27 1645 if (!cpupid_pid_unset(last_cpupid) && 10f39042711ba2 Rik van Riel 2014-01-27 1646 cpupid_to_nid(last_cpupid) != dst_nid) 10f39042711ba2 Rik van Riel 2014-01-27 1647 return false; 10f39042711ba2 Rik van Riel 2014-01-27 1648 10f39042711ba2 Rik van Riel 2014-01-27 1649 /* Always allow migrate on private faults */ 10f39042711ba2 Rik van Riel 2014-01-27 1650 if (cpupid_match_pid(p, last_cpupid)) 10f39042711ba2 Rik van Riel 2014-01-27 1651 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1652 10f39042711ba2 Rik van Riel 2014-01-27 1653 /* A shared fault, but p->numa_group has not been set up yet. */ 10f39042711ba2 Rik van Riel 2014-01-27 1654 if (!ng) 10f39042711ba2 Rik van Riel 2014-01-27 1655 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1656 10f39042711ba2 Rik van Riel 2014-01-27 1657 /* 4142c3ebb685bb Rik van Riel 2016-01-25 1658 * Destination node is much more heavily used than the source 4142c3ebb685bb Rik van Riel 2016-01-25 1659 * node? Allow migration. 10f39042711ba2 Rik van Riel 2014-01-27 1660 */ 4142c3ebb685bb Rik van Riel 2016-01-25 1661 if (group_faults_cpu(ng, dst_nid) > group_faults_cpu(ng, src_nid) * 4142c3ebb685bb Rik van Riel 2016-01-25 1662 ACTIVE_NODE_FRACTION) 10f39042711ba2 Rik van Riel 2014-01-27 1663 return true; 10f39042711ba2 Rik van Riel 2014-01-27 1664 10f39042711ba2 Rik van Riel 2014-01-27 1665 /* 4142c3ebb685bb Rik van Riel 2016-01-25 1666 * Distribute memory according to CPU & memory use on each node, 4142c3ebb685bb Rik van Riel 2016-01-25 1667 * with 3/4 hysteresis to avoid unnecessary memory migrations: 4142c3ebb685bb Rik van Riel 2016-01-25 1668 * 4142c3ebb685bb Rik van Riel 2016-01-25 1669 * faults_cpu(dst) 3 faults_cpu(src) 4142c3ebb685bb Rik van Riel 2016-01-25 1670 * --------------- * - > --------------- 4142c3ebb685bb Rik van Riel 2016-01-25 1671 * faults_mem(dst) 4 faults_mem(src) 10f39042711ba2 Rik van Riel 2014-01-27 1672 */ 4142c3ebb685bb Rik van Riel 2016-01-25 1673 return group_faults_cpu(ng, dst_nid) * group_faults(p, src_nid) * 3 > 4142c3ebb685bb Rik van Riel 2016-01-25 1674 group_faults_cpu(ng, src_nid) * group_faults(p, dst_nid) * 4; 10f39042711ba2 Rik van Riel 2014-01-27 1675 } 10f39042711ba2 Rik van Riel 2014-01-27 1676
On 2023/5/28 8:29, kernel test robot wrote: > Hi Miaohe, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on tip/sched/core] > [also build test ERROR on linus/master v6.4-rc3 next-20230525] > [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/Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 > base: tip/sched/core > patch link: https://lore.kernel.org/r/20230527173727.1669047-1-linmiaohe%40huawei.com > patch subject: [PATCH] sched/fair: remove unneeded header files > config: x86_64-randconfig-a012-20230528 (https://download.01.org/0day-ci/archive/20230528/202305280847.ss7JHZEe-lkp@intel.com/config) > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): > mkdir -p ~/bin > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/653731fdd11d1ecb757fe4b90484ef4a777fb584 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Miaohe-Lin/sched-fair-remove-unneeded-header-files/20230527-174628 > git checkout 653731fdd11d1ecb757fe4b90484ef4a777fb584 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202305280847.ss7JHZEe-lkp@intel.com/ > > All errors (new ones prefixed by >>): > >>> kernel/sched/fair.c:1585:7: error: implicit declaration of function 'node_is_toptier' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > !node_is_toptier(src_nid)) { > ^ > kernel/sched/fair.c:2844:7: error: implicit declaration of function 'node_is_toptier' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > if (!node_is_toptier(mem_node) && > ^ >>> kernel/sched/fair.c:3014:8: error: implicit declaration of function 'vma_migratable' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > if (!vma_migratable(vma) || !vma_policy_mof(vma) || > ^ >>> kernel/sched/fair.c:3014:32: error: implicit declaration of function 'vma_policy_mof' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > if (!vma_migratable(vma) || !vma_policy_mof(vma) || > ^ >>> kernel/sched/fair.c:3015:4: error: implicit declaration of function 'is_vm_hugetlb_page' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { > ^ > kernel/sched/fair.c:6159:6: warning: no previous prototype for function 'init_cfs_bandwidth' [-Wmissing-prototypes] > void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} > ^ > kernel/sched/fair.c:6159:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {} > ^ > static > kernel/sched/fair.c:11973:6: warning: no previous prototype for function 'task_vruntime_update' [-Wmissing-prototypes] > void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi) > ^ > kernel/sched/fair.c:11973:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi) > ^ > static > kernel/sched/fair.c:12595:6: warning: no previous prototype for function 'free_fair_sched_group' [-Wmissing-prototypes] > void free_fair_sched_group(struct task_group *tg) { } > ^ > kernel/sched/fair.c:12595:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void free_fair_sched_group(struct task_group *tg) { } > ^ > static > kernel/sched/fair.c:12597:5: warning: no previous prototype for function 'alloc_fair_sched_group' [-Wmissing-prototypes] > int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) > ^ > kernel/sched/fair.c:12597:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) > ^ > static > kernel/sched/fair.c:12602:6: warning: no previous prototype for function 'online_fair_sched_group' [-Wmissing-prototypes] > void online_fair_sched_group(struct task_group *tg) { } > ^ > kernel/sched/fair.c:12602:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void online_fair_sched_group(struct task_group *tg) { } > ^ > static > kernel/sched/fair.c:12604:6: warning: no previous prototype for function 'unregister_fair_sched_group' [-Wmissing-prototypes] > void unregister_fair_sched_group(struct task_group *tg) { } > ^ > kernel/sched/fair.c:12604:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void unregister_fair_sched_group(struct task_group *tg) { } > ^ > static > 6 warnings and 5 errors generated. Will fix all of these in v2. Thanks for reporting.
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 373ff5f55884..acbf1ac9da06 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -21,16 +21,10 @@ * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra */ #include <linux/energy_model.h> -#include <linux/mmap_lock.h> -#include <linux/hugetlb_inline.h> #include <linux/jiffies.h> -#include <linux/mm_api.h> -#include <linux/highmem.h> #include <linux/spinlock_api.h> #include <linux/cpumask_api.h> -#include <linux/lockdep_api.h> #include <linux/softirq.h> -#include <linux/refcount_api.h> #include <linux/topology.h> #include <linux/sched/clock.h> #include <linux/sched/cond_resched.h> @@ -40,18 +34,12 @@ #include <linux/cpuidle.h> #include <linux/interrupt.h> -#include <linux/memory-tiers.h> -#include <linux/mempolicy.h> -#include <linux/mutex_api.h> -#include <linux/profile.h> #include <linux/psi.h> #include <linux/ratelimit.h> #include <linux/task_work.h> #include <asm/switch_to.h> -#include <linux/sched/cond_resched.h> - #include "sched.h" #include "stats.h" #include "autogroup.h"