From: kernel test robot <lkp@intel.com>
To: Ingo Molnar <mingo@kernel.org>, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
Peter Zijlstra <peterz@infradead.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Valentin Schneider <vschneid@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 3/5] sched: Split out kernel/sched/numa_balancing.c from kernel/sched/fair.c
Date: Mon, 8 Apr 2024 02:49:02 +0800 [thread overview]
Message-ID: <202404080242.0PsxhOlk-lkp@intel.com> (raw)
In-Reply-To: <20240407084319.1462211-4-mingo@kernel.org>
Hi Ingo,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/sched/core]
[also build test WARNING on next-20240405]
[cannot apply to linux/master linus/master peterz-queue/sched/core v6.9-rc2]
[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/Ingo-Molnar/sched-Split-out-kernel-sched-syscalls-c-from-kernel-sched-core-c/20240407-164646
base: tip/sched/core
patch link: https://lore.kernel.org/r/20240407084319.1462211-4-mingo%40kernel.org
patch subject: [PATCH 3/5] sched: Split out kernel/sched/numa_balancing.c from kernel/sched/fair.c
config: x86_64-randconfig-121-20240408 (https://download.01.org/0day-ci/archive/20240408/202404080242.0PsxhOlk-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240408/202404080242.0PsxhOlk-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/202404080242.0PsxhOlk-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> kernel/sched/numa_balancing.c:1654:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu * @@
kernel/sched/numa_balancing.c:1654:13: sparse: expected struct task_struct *tsk
kernel/sched/numa_balancing.c:1654:13: sparse: got struct task_struct [noderef] __rcu *
kernel/sched/numa_balancing.c: note: in included file (through include/linux/mmzone.h, include/linux/memory-tiers.h):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
kernel/sched/numa_balancing.c:1600:9: sparse: sparse: context imbalance in 'task_numa_placement' - different lock contexts for basic block
vim +1654 kernel/sched/numa_balancing.c
1619
1620 static void task_numa_group(struct task_struct *p, int cpupid, int flags,
1621 int *priv)
1622 {
1623 struct numa_group *grp, *my_grp;
1624 struct task_struct *tsk;
1625 bool join = false;
1626 int cpu = cpupid_to_cpu(cpupid);
1627 int i;
1628
1629 if (unlikely(!deref_curr_numa_group(p))) {
1630 unsigned int size = sizeof(struct numa_group) +
1631 NR_NUMA_HINT_FAULT_STATS *
1632 nr_node_ids * sizeof(unsigned long);
1633
1634 grp = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
1635 if (!grp)
1636 return;
1637
1638 refcount_set(&grp->refcount, 1);
1639 grp->active_nodes = 1;
1640 grp->max_faults_cpu = 0;
1641 spin_lock_init(&grp->lock);
1642 grp->gid = p->pid;
1643
1644 for (i = 0; i < NR_NUMA_HINT_FAULT_STATS * nr_node_ids; i++)
1645 grp->faults[i] = p->numa_faults[i];
1646
1647 grp->total_faults = p->total_numa_faults;
1648
1649 grp->nr_tasks++;
1650 rcu_assign_pointer(p->numa_group, grp);
1651 }
1652
1653 rcu_read_lock();
> 1654 tsk = READ_ONCE(cpu_rq(cpu)->curr);
1655
1656 if (!cpupid_match_pid(tsk, cpupid))
1657 goto no_join;
1658
1659 grp = rcu_dereference(tsk->numa_group);
1660 if (!grp)
1661 goto no_join;
1662
1663 my_grp = deref_curr_numa_group(p);
1664 if (grp == my_grp)
1665 goto no_join;
1666
1667 /*
1668 * Only join the other group if its bigger; if we're the bigger group,
1669 * the other task will join us.
1670 */
1671 if (my_grp->nr_tasks > grp->nr_tasks)
1672 goto no_join;
1673
1674 /*
1675 * Tie-break on the grp address.
1676 */
1677 if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp)
1678 goto no_join;
1679
1680 /* Always join threads in the same process. */
1681 if (tsk->mm == current->mm)
1682 join = true;
1683
1684 /* Simple filter to avoid false positives due to PID collisions */
1685 if (flags & TNF_SHARED)
1686 join = true;
1687
1688 /* Update priv based on whether false sharing was detected */
1689 *priv = !join;
1690
1691 if (join && !get_numa_group(grp))
1692 goto no_join;
1693
1694 rcu_read_unlock();
1695
1696 if (!join)
1697 return;
1698
1699 WARN_ON_ONCE(irqs_disabled());
1700 double_lock_irq(&my_grp->lock, &grp->lock);
1701
1702 for (i = 0; i < NR_NUMA_HINT_FAULT_STATS * nr_node_ids; i++) {
1703 my_grp->faults[i] -= p->numa_faults[i];
1704 grp->faults[i] += p->numa_faults[i];
1705 }
1706 my_grp->total_faults -= p->total_numa_faults;
1707 grp->total_faults += p->total_numa_faults;
1708
1709 my_grp->nr_tasks--;
1710 grp->nr_tasks++;
1711
1712 spin_unlock(&my_grp->lock);
1713 spin_unlock_irq(&grp->lock);
1714
1715 rcu_assign_pointer(p->numa_group, grp);
1716
1717 put_numa_group(my_grp);
1718 return;
1719
1720 no_join:
1721 rcu_read_unlock();
1722 return;
1723 }
1724
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-04-07 18:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 8:43 [PATCH 0/5] sched: Split out kernel/sched/fair_balance.c, numa_balancing.c and syscalls.c, plus other updates Ingo Molnar
2024-04-07 8:43 ` [PATCH 1/5] sched: Split out kernel/sched/syscalls.c from kernel/sched/core.c Ingo Molnar
2024-04-07 19:09 ` kernel test robot
2024-05-27 12:05 ` [tip: sched/core] sched/syscalls: " tip-bot2 for Ingo Molnar
2024-04-07 8:43 ` [PATCH 2/5] sched: Split out kernel/sched/fair_balance.c from kernel/sched/fair.c Ingo Molnar
2024-04-07 10:04 ` kernel test robot
2024-04-07 10:15 ` kernel test robot
2024-04-07 20:21 ` kernel test robot
2024-04-07 8:43 ` [PATCH 3/5] sched: Split out kernel/sched/numa_balancing.c " Ingo Molnar
2024-04-07 18:49 ` kernel test robot [this message]
2024-04-07 8:43 ` [PATCH 4/5] sched/fair: Remove NEXT_BUDDY Ingo Molnar
2024-04-07 8:43 ` [PATCH 5/5] sched/fair: Rename set_next_buddy() to set_next_pick() Ingo Molnar
2024-04-08 9:16 ` Peter Zijlstra
2024-04-09 8:32 ` Ingo Molnar
2024-04-09 9:27 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404080242.0PsxhOlk-lkp@intel.com \
--to=lkp@intel.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=sshegde@linux.ibm.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.