diff options
| author | Mathias Krause <minipli@googlemail.com> | 2020-05-21 16:51:41 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 16:40:27 +0200 |
| commit | 7653fbfc21fe095888b1eaf576019f4eac4ef47c (patch) | |
| tree | ccc8278cbb7db81f9efd2b8df38d9dbb4efaa2b1 /lib/cpumask.c | |
| parent | 1c1b4327970c79c1a2d0c3becfc12b9696177c55 (diff) | |
padata: set cpu_index of unused CPUs to -1
[ Upstream commit 1bd845bcb41d5b7f83745e0cb99273eb376f2ec5 ]
The parallel queue per-cpu data structure gets initialized only for CPUs
in the 'pcpu' CPU mask set. This is not sufficient as the reorder timer
may run on a different CPU and might wrongly decide it's the target CPU
for the next reorder item as per-cpu memory gets memset(0) and we might
be waiting for the first CPU in cpumask.pcpu, i.e. cpu_index 0.
Make the '__this_cpu_read(pd->pqueue->cpu_index) == next_queue->cpu_index'
compare in padata_get_next() fail in this case by initializing the
cpu_index member of all per-cpu parallel queues. Use -1 for unused ones.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/cpumask.c')
0 files changed, 0 insertions, 0 deletions
