[oracle-dtrace:v2/5.17-rc2 8/10] fs/eventpoll.c:1224:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
by kernel test robot
tree: https://github.com/oracle/dtrace-linux-kernel v2/5.17-rc2
head: 47946e7b2e2319f39cbb7f8aaa294298c2dec5b4
commit: 16ad67b61ac4f3dd93b3fa6875a011fff7b88500 [8/10] waitfd: new syscall implementing waitpid() over fds
compiler: or1k-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not be real problems)
>> fs/eventpoll.c:1224:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
key = (void *)epi->fixed_event;
^
vim +1224 fs/eventpoll.c
a218cc4914209a Roman Penyaev 2019-03-07 1118
^1da177e4c3f41 Linus Torvalds 2005-04-16 1119 /*
7699acd1341c63 Davide Libenzi 2007-05-10 1120 * This is the callback that is passed to the wait queue wakeup
bf6a41db7726e6 Daniel Baluta 2011-01-30 1121 * mechanism. It is called by the stored file descriptors when they
7699acd1341c63 Davide Libenzi 2007-05-10 1122 * have events to report.
a218cc4914209a Roman Penyaev 2019-03-07 1123 *
a6c67fee9cf095 Randy Dunlap 2021-03-01 1124 * This callback takes a read lock in order not to contend with concurrent
a6c67fee9cf095 Randy Dunlap 2021-03-01 1125 * events from another file descriptor, thus all modifications to ->rdllist
a218cc4914209a Roman Penyaev 2019-03-07 1126 * or ->ovflist are lockless. Read lock is paired with the write lock from
a218cc4914209a Roman Penyaev 2019-03-07 1127 * ep_scan_ready_list(), which stops all list modifications and guarantees
a218cc4914209a Roman Penyaev 2019-03-07 1128 * that lists state is seen correctly.
a218cc4914209a Roman Penyaev 2019-03-07 1129 *
a218cc4914209a Roman Penyaev 2019-03-07 1130 * Another thing worth to mention is that ep_poll_callback() can be called
a218cc4914209a Roman Penyaev 2019-03-07 1131 * concurrently for the same @epi from different CPUs if poll table was inited
a218cc4914209a Roman Penyaev 2019-03-07 1132 * with several wait queues entries. Plural wakeup from different CPUs of a
a218cc4914209a Roman Penyaev 2019-03-07 1133 * single wait queue is serialized by wq.lock, but the case when multiple wait
a218cc4914209a Roman Penyaev 2019-03-07 1134 * queues are used should be detected accordingly. This is detected using
a218cc4914209a Roman Penyaev 2019-03-07 1135 * cmpxchg() operation.
^1da177e4c3f41 Linus Torvalds 2005-04-16 1136 */
ac6424b981bce1 Ingo Molnar 2017-06-20 1137 static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1138 {
7699acd1341c63 Davide Libenzi 2007-05-10 1139 int pwake = 0;
7699acd1341c63 Davide Libenzi 2007-05-10 1140 struct epitem *epi = ep_item_from_wait(wait);
7699acd1341c63 Davide Libenzi 2007-05-10 1141 struct eventpoll *ep = epi->ep;
3ad6f93e98d6df Al Viro 2017-07-03 1142 __poll_t pollflags = key_to_poll(key);
a218cc4914209a Roman Penyaev 2019-03-07 1143 unsigned long flags;
df0108c5da561c Jason Baron 2016-01-20 1144 int ewake = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1145
a218cc4914209a Roman Penyaev 2019-03-07 1146 read_lock_irqsave(&ep->lock, flags);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1147
bf3b9f6372c45b Sridhar Samudrala 2017-03-24 1148 ep_set_busy_poll_napi_id(epi);
bf3b9f6372c45b Sridhar Samudrala 2017-03-24 1149
^1da177e4c3f41 Linus Torvalds 2005-04-16 1150 /*
7699acd1341c63 Davide Libenzi 2007-05-10 1151 * If the event mask does not contain any poll(2) event, we consider the
7699acd1341c63 Davide Libenzi 2007-05-10 1152 * descriptor to be disabled. This condition is likely the effect of the
7699acd1341c63 Davide Libenzi 2007-05-10 1153 * EPOLLONESHOT bit that disables the descriptor when an event is received,
7699acd1341c63 Davide Libenzi 2007-05-10 1154 * until the next EPOLL_CTL_MOD will be issued.
^1da177e4c3f41 Linus Torvalds 2005-04-16 1155 */
7699acd1341c63 Davide Libenzi 2007-05-10 1156 if (!(epi->event.events & ~EP_PRIVATE_BITS))
d47de16c722196 Davide Libenzi 2007-05-15 1157 goto out_unlock;
d47de16c722196 Davide Libenzi 2007-05-15 1158
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1159 /*
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1160 * Check the events coming with the callback. At this stage, not
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1161 * every device reports the events in the "key" parameter of the
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1162 * callback. We need to be able to handle both cases here, hence the
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1163 * test for "key" != NULL before the event match test.
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1164 */
3ad6f93e98d6df Al Viro 2017-07-03 1165 if (pollflags && !(pollflags & epi->event.events))
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1166 goto out_unlock;
2dfa4eeab0fc7e Davide Libenzi 2009-03-31 1167
d47de16c722196 Davide Libenzi 2007-05-15 1168 /*
bf6a41db7726e6 Daniel Baluta 2011-01-30 1169 * If we are transferring events to userspace, we can hold no locks
d47de16c722196 Davide Libenzi 2007-05-15 1170 * (because we're accessing user memory, and because of linux f_op->poll()
bf6a41db7726e6 Daniel Baluta 2011-01-30 1171 * semantics). All the events that happen during that period of time are
d47de16c722196 Davide Libenzi 2007-05-15 1172 * chained in ep->ovflist and requeued later on.
d47de16c722196 Davide Libenzi 2007-05-15 1173 */
c5a282e9635e9c Davidlohr Bueso 2019-01-03 1174 if (READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR) {
0c54a6a44bf3d4 Khazhismel Kumykov 2020-05-07 1175 if (chain_epi_lockless(epi))
c3e320b61581ef Roman Penyaev 2019-03-07 1176 ep_pm_stay_awake_rcu(epi);
0c54a6a44bf3d4 Khazhismel Kumykov 2020-05-07 1177 } else if (!ep_is_linked(epi)) {
0c54a6a44bf3d4 Khazhismel Kumykov 2020-05-07 1178 /* In the usual case, add event to ready list. */
0c54a6a44bf3d4 Khazhismel Kumykov 2020-05-07 1179 if (list_add_tail_lockless(&epi->rdllink, &ep->rdllist))
eea1d585917c53 Eric Wong 2013-04-30 1180 ep_pm_stay_awake_rcu(epi);
4d7e30d98939a0 Arve Hjønnevåg 2012-05-01 1181 }
7699acd1341c63 Davide Libenzi 2007-05-10 1182
7699acd1341c63 Davide Libenzi 2007-05-10 1183 /*
7699acd1341c63 Davide Libenzi 2007-05-10 1184 * Wake up ( if active ) both the eventpoll wait list and the ->poll()
7699acd1341c63 Davide Libenzi 2007-05-10 1185 * wait list.
7699acd1341c63 Davide Libenzi 2007-05-10 1186 */
df0108c5da561c Jason Baron 2016-01-20 1187 if (waitqueue_active(&ep->wq)) {
b6a515c8a0f6c2 Jason Baron 2016-02-05 1188 if ((epi->event.events & EPOLLEXCLUSIVE) &&
3ad6f93e98d6df Al Viro 2017-07-03 1189 !(pollflags & POLLFREE)) {
3ad6f93e98d6df Al Viro 2017-07-03 1190 switch (pollflags & EPOLLINOUT_BITS) {
a9a08845e9acbd Linus Torvalds 2018-02-11 1191 case EPOLLIN:
a9a08845e9acbd Linus Torvalds 2018-02-11 1192 if (epi->event.events & EPOLLIN)
b6a515c8a0f6c2 Jason Baron 2016-02-05 1193 ewake = 1;
b6a515c8a0f6c2 Jason Baron 2016-02-05 1194 break;
a9a08845e9acbd Linus Torvalds 2018-02-11 1195 case EPOLLOUT:
a9a08845e9acbd Linus Torvalds 2018-02-11 1196 if (epi->event.events & EPOLLOUT)
b6a515c8a0f6c2 Jason Baron 2016-02-05 1197 ewake = 1;
b6a515c8a0f6c2 Jason Baron 2016-02-05 1198 break;
b6a515c8a0f6c2 Jason Baron 2016-02-05 1199 case 0:
df0108c5da561c Jason Baron 2016-01-20 1200 ewake = 1;
b6a515c8a0f6c2 Jason Baron 2016-02-05 1201 break;
b6a515c8a0f6c2 Jason Baron 2016-02-05 1202 }
b6a515c8a0f6c2 Jason Baron 2016-02-05 1203 }
a218cc4914209a Roman Penyaev 2019-03-07 1204 wake_up(&ep->wq);
df0108c5da561c Jason Baron 2016-01-20 1205 }
7699acd1341c63 Davide Libenzi 2007-05-10 1206 if (waitqueue_active(&ep->poll_wait))
7699acd1341c63 Davide Libenzi 2007-05-10 1207 pwake++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1208
d47de16c722196 Davide Libenzi 2007-05-15 1209 out_unlock:
a218cc4914209a Roman Penyaev 2019-03-07 1210 read_unlock_irqrestore(&ep->lock, flags);
7699acd1341c63 Davide Libenzi 2007-05-10 1211
7699acd1341c63 Davide Libenzi 2007-05-10 1212 /* We have to call this outside the lock */
7699acd1341c63 Davide Libenzi 2007-05-10 1213 if (pwake)
efcdd350d1f8a9 Jason Baron 2020-04-06 1214 ep_poll_safewake(ep, epi);
7699acd1341c63 Davide Libenzi 2007-05-10 1215
138e4ad67afd5c Oleg Nesterov 2017-09-01 1216 if (!(epi->event.events & EPOLLEXCLUSIVE))
138e4ad67afd5c Oleg Nesterov 2017-09-01 1217 ewake = 1;
138e4ad67afd5c Oleg Nesterov 2017-09-01 1218
16ad67b61ac4f3 Nick Alcock 2018-11-14 1219 /*
16ad67b61ac4f3 Nick Alcock 2018-11-14 1220 * If this fd type has a hardwired event which should override the key
16ad67b61ac4f3 Nick Alcock 2018-11-14 1221 * (e.g. if it is waiting on a non-file waitqueue), jam it in here.
16ad67b61ac4f3 Nick Alcock 2018-11-14 1222 */
16ad67b61ac4f3 Nick Alcock 2018-11-14 1223 if (epi->fixed_event)
16ad67b61ac4f3 Nick Alcock 2018-11-14 @1224 key = (void *)epi->fixed_event;
16ad67b61ac4f3 Nick Alcock 2018-11-14 1225
3ad6f93e98d6df Al Viro 2017-07-03 1226 if (pollflags & POLLFREE) {
138e4ad67afd5c Oleg Nesterov 2017-09-01 1227 /*
138e4ad67afd5c Oleg Nesterov 2017-09-01 1228 * If we race with ep_remove_wait_queue() it can miss
138e4ad67afd5c Oleg Nesterov 2017-09-01 1229 * ->whead = NULL and do another remove_wait_queue() after
138e4ad67afd5c Oleg Nesterov 2017-09-01 1230 * us, so we can't use __remove_wait_queue().
138e4ad67afd5c Oleg Nesterov 2017-09-01 1231 */
138e4ad67afd5c Oleg Nesterov 2017-09-01 1232 list_del_init(&wait->entry);
138e4ad67afd5c Oleg Nesterov 2017-09-01 1233 /*
138e4ad67afd5c Oleg Nesterov 2017-09-01 1234 * ->whead != NULL protects us from the race with ep_free()
138e4ad67afd5c Oleg Nesterov 2017-09-01 1235 * or ep_remove(), ep_remove_wait_queue() takes whead->lock
138e4ad67afd5c Oleg Nesterov 2017-09-01 1236 * held by the caller. Once we nullify it, nothing protects
138e4ad67afd5c Oleg Nesterov 2017-09-01 1237 * ep/epi or even wait.
138e4ad67afd5c Oleg Nesterov 2017-09-01 1238 */
138e4ad67afd5c Oleg Nesterov 2017-09-01 1239 smp_store_release(&ep_pwq_from_wait(wait)->whead, NULL);
138e4ad67afd5c Oleg Nesterov 2017-09-01 1240 }
df0108c5da561c Jason Baron 2016-01-20 1241
138e4ad67afd5c Oleg Nesterov 2017-09-01 1242 return ewake;
7699acd1341c63 Davide Libenzi 2007-05-10 1243 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1244
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [RFC PATCH -V2] NUMA balancing: fix NUMA topology for systems with CPU-less nodes
by Dan Carpenter
Hi Huang,
url: https://github.com/0day-ci/linux/commits/Huang-Ying/NUMA-balancing-fix-NU...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git c8eaf6ac76f40f6c59fc7d056e2e08c4a57ea9c7
config: arm64-randconfig-m031-20220209 (https://download.01.org/0day-ci/archive/20220209/202202092339.FFRMVjDx-lk...)
compiler: aarch64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/sched/topology.c:1866 sched_init_numa() warn: possible memory leak of 'masks'
vim +/masks +1866 kernel/sched/topology.c
ed82092e5093338 Huang Ying 2022-02-08 1786 void sched_init_numa(int offline_node)
f2cb13609d5397c Ingo Molnar 2017-02-01 1787 {
f2cb13609d5397c Ingo Molnar 2017-02-01 1788 struct sched_domain_topology_level *tl;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1789 unsigned long *distance_map;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1790 int nr_levels = 0;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1791 int i, j;
ed82092e5093338 Huang Ying 2022-02-08 1792 int *distances;
ed82092e5093338 Huang Ying 2022-02-08 1793 struct cpumask ***masks;
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1794
f2cb13609d5397c Ingo Molnar 2017-02-01 1795 /*
f2cb13609d5397c Ingo Molnar 2017-02-01 1796 * O(nr_nodes^2) deduplicating selection sort -- in order to find the
f2cb13609d5397c Ingo Molnar 2017-02-01 1797 * unique distances in the node_distance() table.
f2cb13609d5397c Ingo Molnar 2017-02-01 1798 */
620a6dc40754dc2 Valentin Schneider 2021-01-22 1799 distance_map = bitmap_alloc(NR_DISTANCE_VALUES, GFP_KERNEL);
620a6dc40754dc2 Valentin Schneider 2021-01-22 1800 if (!distance_map)
620a6dc40754dc2 Valentin Schneider 2021-01-22 1801 return;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1802
620a6dc40754dc2 Valentin Schneider 2021-01-22 1803 bitmap_zero(distance_map, NR_DISTANCE_VALUES);
ed82092e5093338 Huang Ying 2022-02-08 1804 for_each_cpu_node_but(i, offline_node) {
ed82092e5093338 Huang Ying 2022-02-08 1805 for_each_cpu_node_but(j, offline_node) {
620a6dc40754dc2 Valentin Schneider 2021-01-22 1806 int distance = node_distance(i, j);
f2cb13609d5397c Ingo Molnar 2017-02-01 1807
620a6dc40754dc2 Valentin Schneider 2021-01-22 1808 if (distance < LOCAL_DISTANCE || distance >= NR_DISTANCE_VALUES) {
620a6dc40754dc2 Valentin Schneider 2021-01-22 1809 sched_numa_warn("Invalid distance value range");
ed82092e5093338 Huang Ying 2022-02-08 1810 bitmap_free(distance_map);
620a6dc40754dc2 Valentin Schneider 2021-01-22 1811 return;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1812 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1813
620a6dc40754dc2 Valentin Schneider 2021-01-22 1814 bitmap_set(distance_map, distance, 1);
620a6dc40754dc2 Valentin Schneider 2021-01-22 1815 }
620a6dc40754dc2 Valentin Schneider 2021-01-22 1816 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1817 /*
620a6dc40754dc2 Valentin Schneider 2021-01-22 1818 * We can now figure out how many unique distance values there are and
620a6dc40754dc2 Valentin Schneider 2021-01-22 1819 * allocate memory accordingly.
f2cb13609d5397c Ingo Molnar 2017-02-01 1820 */
620a6dc40754dc2 Valentin Schneider 2021-01-22 1821 nr_levels = bitmap_weight(distance_map, NR_DISTANCE_VALUES);
f2cb13609d5397c Ingo Molnar 2017-02-01 1822
ed82092e5093338 Huang Ying 2022-02-08 1823 distances = kcalloc(nr_levels, sizeof(int), GFP_KERNEL);
ed82092e5093338 Huang Ying 2022-02-08 1824 if (!distances) {
620a6dc40754dc2 Valentin Schneider 2021-01-22 1825 bitmap_free(distance_map);
Some error paths have cleanup
620a6dc40754dc2 Valentin Schneider 2021-01-22 1826 return;
f2cb13609d5397c Ingo Molnar 2017-02-01 1827 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1828
620a6dc40754dc2 Valentin Schneider 2021-01-22 1829 for (i = 0, j = 0; i < nr_levels; i++, j++) {
620a6dc40754dc2 Valentin Schneider 2021-01-22 1830 j = find_next_bit(distance_map, NR_DISTANCE_VALUES, j);
ed82092e5093338 Huang Ying 2022-02-08 1831 distances[i] = j;
f2cb13609d5397c Ingo Molnar 2017-02-01 1832 }
ed82092e5093338 Huang Ying 2022-02-08 1833 rcu_assign_pointer(sched_domains_numa_distance, distances);
f2cb13609d5397c Ingo Molnar 2017-02-01 1834
620a6dc40754dc2 Valentin Schneider 2021-01-22 1835 bitmap_free(distance_map);
620a6dc40754dc2 Valentin Schneider 2021-01-22 1836
f2cb13609d5397c Ingo Molnar 2017-02-01 1837 /*
620a6dc40754dc2 Valentin Schneider 2021-01-22 1838 * 'nr_levels' contains the number of unique distances
f2cb13609d5397c Ingo Molnar 2017-02-01 1839 *
f2cb13609d5397c Ingo Molnar 2017-02-01 1840 * The sched_domains_numa_distance[] array includes the actual distance
f2cb13609d5397c Ingo Molnar 2017-02-01 1841 * numbers.
f2cb13609d5397c Ingo Molnar 2017-02-01 1842 */
f2cb13609d5397c Ingo Molnar 2017-02-01 1843
f2cb13609d5397c Ingo Molnar 2017-02-01 1844 /*
f2cb13609d5397c Ingo Molnar 2017-02-01 1845 * Here, we should temporarily reset sched_domains_numa_levels to 0.
f2cb13609d5397c Ingo Molnar 2017-02-01 1846 * If it fails to allocate memory for array sched_domains_numa_masks[][],
620a6dc40754dc2 Valentin Schneider 2021-01-22 1847 * the array will contain less then 'nr_levels' members. This could be
f2cb13609d5397c Ingo Molnar 2017-02-01 1848 * dangerous when we use it to iterate array sched_domains_numa_masks[][]
f2cb13609d5397c Ingo Molnar 2017-02-01 1849 * in other functions.
f2cb13609d5397c Ingo Molnar 2017-02-01 1850 *
620a6dc40754dc2 Valentin Schneider 2021-01-22 1851 * We reset it to 'nr_levels' at the end of this function.
f2cb13609d5397c Ingo Molnar 2017-02-01 1852 */
f2cb13609d5397c Ingo Molnar 2017-02-01 1853 sched_domains_numa_levels = 0;
f2cb13609d5397c Ingo Molnar 2017-02-01 1854
ed82092e5093338 Huang Ying 2022-02-08 1855 masks = kzalloc(sizeof(void *) * nr_levels, GFP_KERNEL);
ed82092e5093338 Huang Ying 2022-02-08 1856 if (!masks)
f2cb13609d5397c Ingo Molnar 2017-02-01 1857 return;
f2cb13609d5397c Ingo Molnar 2017-02-01 1858
f2cb13609d5397c Ingo Molnar 2017-02-01 1859 /*
f2cb13609d5397c Ingo Molnar 2017-02-01 1860 * Now for each level, construct a mask per node which contains all
f2cb13609d5397c Ingo Molnar 2017-02-01 1861 * CPUs of nodes that are that many hops away from us.
f2cb13609d5397c Ingo Molnar 2017-02-01 1862 */
620a6dc40754dc2 Valentin Schneider 2021-01-22 1863 for (i = 0; i < nr_levels; i++) {
ed82092e5093338 Huang Ying 2022-02-08 1864 masks[i] = kzalloc(nr_node_ids * sizeof(void *), GFP_KERNEL);
ed82092e5093338 Huang Ying 2022-02-08 1865 if (!masks[i])
f2cb13609d5397c Ingo Molnar 2017-02-01 @1866 return;
But some don't.
f2cb13609d5397c Ingo Molnar 2017-02-01 1867
ed82092e5093338 Huang Ying 2022-02-08 1868 for_each_cpu_node_but(j, offline_node) {
f2cb13609d5397c Ingo Molnar 2017-02-01 1869 struct cpumask *mask = kzalloc(cpumask_size(), GFP_KERNEL);
620a6dc40754dc2 Valentin Schneider 2021-01-22 1870 int k;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1871
f2cb13609d5397c Ingo Molnar 2017-02-01 1872 if (!mask)
f2cb13609d5397c Ingo Molnar 2017-02-01 1873 return;
f2cb13609d5397c Ingo Molnar 2017-02-01 1874
ed82092e5093338 Huang Ying 2022-02-08 1875 masks[i][j] = mask;
0083242c93759dd Valentin Schneider 2021-08-18 1876
ed82092e5093338 Huang Ying 2022-02-08 1877 for_each_cpu_node_but(k, offline_node) {
620a6dc40754dc2 Valentin Schneider 2021-01-22 1878 if (sched_debug() && (node_distance(j, k) != node_distance(k, j)))
620a6dc40754dc2 Valentin Schneider 2021-01-22 1879 sched_numa_warn("Node-distance not symmetric");
620a6dc40754dc2 Valentin Schneider 2021-01-22 1880
f2cb13609d5397c Ingo Molnar 2017-02-01 1881 if (node_distance(j, k) > sched_domains_numa_distance[i])
f2cb13609d5397c Ingo Molnar 2017-02-01 1882 continue;
f2cb13609d5397c Ingo Molnar 2017-02-01 1883
f2cb13609d5397c Ingo Molnar 2017-02-01 1884 cpumask_or(mask, mask, cpumask_of_node(k));
f2cb13609d5397c Ingo Molnar 2017-02-01 1885 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1886 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1887 }
ed82092e5093338 Huang Ying 2022-02-08 1888 rcu_assign_pointer(sched_domains_numa_masks, masks);
f2cb13609d5397c Ingo Molnar 2017-02-01 1889
f2cb13609d5397c Ingo Molnar 2017-02-01 1890 /* Compute default topology size */
f2cb13609d5397c Ingo Molnar 2017-02-01 1891 for (i = 0; sched_domain_topology[i].mask; i++);
f2cb13609d5397c Ingo Molnar 2017-02-01 1892
71e5f6644fb2f33 Dietmar Eggemann 2021-02-01 1893 tl = kzalloc((i + nr_levels + 1) *
f2cb13609d5397c Ingo Molnar 2017-02-01 1894 sizeof(struct sched_domain_topology_level), GFP_KERNEL);
f2cb13609d5397c Ingo Molnar 2017-02-01 1895 if (!tl)
f2cb13609d5397c Ingo Molnar 2017-02-01 1896 return;
f2cb13609d5397c Ingo Molnar 2017-02-01 1897
f2cb13609d5397c Ingo Molnar 2017-02-01 1898 /*
f2cb13609d5397c Ingo Molnar 2017-02-01 1899 * Copy the default topology bits..
f2cb13609d5397c Ingo Molnar 2017-02-01 1900 */
f2cb13609d5397c Ingo Molnar 2017-02-01 1901 for (i = 0; sched_domain_topology[i].mask; i++)
f2cb13609d5397c Ingo Molnar 2017-02-01 1902 tl[i] = sched_domain_topology[i];
f2cb13609d5397c Ingo Molnar 2017-02-01 1903
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1904 /*
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1905 * Add the NUMA identity distance, aka single NODE.
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1906 */
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1907 tl[i++] = (struct sched_domain_topology_level){
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1908 .mask = sd_numa_mask,
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1909 .numa_level = 0,
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1910 SD_INIT_NAME(NODE)
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1911 };
051f3ca02e46432 Suravee Suthikulpanit 2017-09-07 1912
f2cb13609d5397c Ingo Molnar 2017-02-01 1913 /*
f2cb13609d5397c Ingo Molnar 2017-02-01 1914 * .. and append 'j' levels of NUMA goodness.
f2cb13609d5397c Ingo Molnar 2017-02-01 1915 */
620a6dc40754dc2 Valentin Schneider 2021-01-22 1916 for (j = 1; j < nr_levels; i++, j++) {
f2cb13609d5397c Ingo Molnar 2017-02-01 1917 tl[i] = (struct sched_domain_topology_level){
f2cb13609d5397c Ingo Molnar 2017-02-01 1918 .mask = sd_numa_mask,
f2cb13609d5397c Ingo Molnar 2017-02-01 1919 .sd_flags = cpu_numa_flags,
f2cb13609d5397c Ingo Molnar 2017-02-01 1920 .flags = SDTL_OVERLAP,
f2cb13609d5397c Ingo Molnar 2017-02-01 1921 .numa_level = j,
f2cb13609d5397c Ingo Molnar 2017-02-01 1922 SD_INIT_NAME(NUMA)
f2cb13609d5397c Ingo Molnar 2017-02-01 1923 };
f2cb13609d5397c Ingo Molnar 2017-02-01 1924 }
f2cb13609d5397c Ingo Molnar 2017-02-01 1925
ed82092e5093338 Huang Ying 2022-02-08 1926 sched_domain_topology_saved = sched_domain_topology;
f2cb13609d5397c Ingo Molnar 2017-02-01 1927 sched_domain_topology = tl;
f2cb13609d5397c Ingo Molnar 2017-02-01 1928
620a6dc40754dc2 Valentin Schneider 2021-01-22 1929 sched_domains_numa_levels = nr_levels;
620a6dc40754dc2 Valentin Schneider 2021-01-22 1930 sched_max_numa_distance = sched_domains_numa_distance[nr_levels - 1];
f2cb13609d5397c Ingo Molnar 2017-02-01 1931
ed82092e5093338 Huang Ying 2022-02-08 1932 init_numa_topology_type(offline_node);
0083242c93759dd Valentin Schneider 2021-08-18 1933 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.15 441/907] drivers/crypto/xilinx/zynqmp-sha.c:120:9: error: implicit declaration of function 'caches_clean_inval_user_pou'
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head: 423a108a01e05e84b59a4c4885c16bf3cd8c90c7
commit: e2696a07cb200c0ca6be673ba2bc9f3e01384dc6 [441/907] crypto: zynqmp-sha: Adopted SHA3 support for ZynqMP Soc
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220210/202202101547.aXR0aUzu-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/Xilinx/linux-xlnx/commit/e2696a07cb200c0ca6be673ba2bc9...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15
git checkout e2696a07cb200c0ca6be673ba2bc9f3e01384dc6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the xilinx-xlnx/xlnx_rebase_v5.15 HEAD 423a108a01e05e84b59a4c4885c16bf3cd8c90c7 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
drivers/crypto/xilinx/zynqmp-sha.c: In function 'zynqmp_sha_update':
>> drivers/crypto/xilinx/zynqmp-sha.c:120:9: error: implicit declaration of function 'caches_clean_inval_user_pou' [-Werror=implicit-function-declaration]
120 | caches_clean_inval_user_pou((unsigned long)kbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/crypto/xilinx/zynqmp-sha.c:23:
At top level:
include/linux/firmware/xlnx-zynqmp.h:1227:12: warning: 'zynqmp_pm_fpga_get_feature_list' defined but not used [-Wunused-function]
1227 | static int zynqmp_pm_fpga_get_feature_list(u32 *value)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/xlnx-zynqmp.h:1222:12: warning: 'zynqmp_pm_fpga_get_version' defined but not used [-Wunused-function]
1222 | static int zynqmp_pm_fpga_get_version(u32 *value)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/xlnx-zynqmp.h:1173:12: warning: 'zynqmp_pm_sec_mask_write_reg' defined but not used [-Wunused-function]
1173 | static int zynqmp_pm_sec_mask_write_reg(const u32 node_id, const u32 offset,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/xlnx-zynqmp.h:1168:12: warning: 'zynqmp_pm_sec_read_reg' defined but not used [-Wunused-function]
1168 | static int zynqmp_pm_sec_read_reg(u32 node_id, u32 offset, u32 *ret_value)
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/caches_clean_inval_user_pou +120 drivers/crypto/xilinx/zynqmp-sha.c
102
103 static int zynqmp_sha_update(struct ahash_request *req)
104 {
105 struct zynqmp_sha_ctx *tctx = crypto_tfm_ctx(req->base.tfm);
106 struct zynqmp_sha_dev *dd = tctx->dd;
107 char *kbuf;
108 size_t dma_size = req->nbytes;
109 dma_addr_t dma_addr;
110 int ret;
111
112 if (!req->nbytes)
113 return 0;
114
115 kbuf = dma_alloc_coherent(dd->dev, dma_size, &dma_addr, GFP_KERNEL);
116 if (!kbuf)
117 return -ENOMEM;
118
119 scatterwalk_map_and_copy(kbuf, req->src, 0, req->nbytes, 0);
> 120 caches_clean_inval_user_pou((unsigned long)kbuf,
121 (unsigned long)kbuf + dma_size);
122 ret = zynqmp_pm_sha_hash(dma_addr, req->nbytes, ZYNQMP_SHA3_UPDATE);
123 if (ret) {
124 mutex_unlock(&zynqmp_sha.hw_engine_mutex);
125 goto end;
126 }
127
128 dma_free_coherent(dd->dev, dma_size, kbuf, dma_addr);
129
130 end:
131 return ret;
132 }
133
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week