]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: flush tlb in pcpu_reclaim_populated()
authorDennis Zhou <dennis@kernel.org>
Sat, 3 Jul 2021 03:49:57 +0000 (03:49 +0000)
committerDennis Zhou <dennis@kernel.org>
Sun, 4 Jul 2021 18:30:17 +0000 (18:30 +0000)
commit4987b644d0ed86927e041c79ab2915c651811b52
tree17da89981870f2d114e673fe57beeb80bc35a252
parenta95bcf6fce8686bd59d560ac0cf41c20bd62b9a9
percpu: flush tlb in pcpu_reclaim_populated()

Prior to "percpu: implement partial chunk depopulation",
pcpu_depopulate_chunk() was called only on the destruction path. This
meant the virtual address range was on its way back to vmalloc which
will handle flushing the tlbs for us.

However, with pcpu_reclaim_populated(), we are now calling
pcpu_depopulate_chunk() during the active lifecycle of a chunk.
Therefore, we need to flush the tlb as well otherwise we can end up
accessing the wrong page through an invalid tlb mapping as reported in
[1].

[1] https://lore.kernel.org/lkml/20210702191140.GA3166599@roeck-us.net/

Fixes: de56b951889e ("percpu: implement partial chunk depopulation")
Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
mm/percpu-km.c
mm/percpu-vm.c
mm/percpu.c