New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv: Enable percpu page first chunk allocator #235
Conversation
Upstream branch: 457926b |
Upstream branch: 3ca112b |
dd45946
to
0b29297
Compare
Upstream branch: b85ea95 |
0b29297
to
0d65580
Compare
Upstream branch: b85ea95 |
0d65580
to
7a255e0
Compare
Upstream branch: 6c31291 |
7a255e0
to
0e53e8e
Compare
Upstream branch: f352a28 |
0e53e8e
to
be1b3ff
Compare
Upstream branch: f352a28 |
be1b3ff
to
71ea85d
Compare
Upstream branch: 5a2cf77 |
The pcpu setup when using the page allocator sets up a new vmalloc mapping very early in the boot process, so early that it cannot use the flush_cache_vmap() function which may depend on structures not yet initialized (for example in riscv, we currently send an IPI to flush other cpus TLB). But on some architectures, we must call flush_cache_vmap(): for example, in riscv, some uarchs can cache invalid TLB entries so we need to flush the new established mapping to avoid taking an exception. So fix this by introducing a new function flush_cache_vmap_early() which is called right after setting the new page table entry and before accessing this new mapping. This new function implements a local flush tlb on riscv and is no-op for other architectures (same as today). Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
As explained in commit 6ea529a ("percpu: make embedding first chunk allocator check vmalloc space size"), the embedding first chunk allocator needs the vmalloc space to be larger than the maximum distance between units which are grouped into NUMA nodes. On a very sparse NUMA configurations and a small vmalloc area (for example, it is 64GB in sv39), the allocation of dynamic percpu data in the vmalloc area could fail. So provide the pcpu page allocator as a fallback in case we fall into such a sparse configuration (which happened in arm64 as shown by commit 09cea61 ("arm64: support page mapping percpu first chunk allocator")). Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
71ea85d
to
621c581
Compare
Pull request for series with
subject: riscv: Enable percpu page first chunk allocator
version: 1
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=800200