Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

bjoto
Copy link

@bjoto bjoto commented Nov 10, 2023

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

@bjoto
Copy link
Author

bjoto commented Nov 10, 2023

Upstream branch: 457926b
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=800200
version: 1

@bjoto
Copy link
Author

bjoto commented Nov 11, 2023

Upstream branch: 3ca112b
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=800200
version: 1

@bjoto
Copy link
Author

bjoto commented Dec 6, 2023

Upstream branch: b85ea95
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=800200
version: 1

@bjoto
Copy link
Author

bjoto commented Dec 12, 2023

Upstream branch: b85ea95
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=809417
version: 2

@bjoto
Copy link
Author

bjoto commented Dec 12, 2023

Upstream branch: 6c31291
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=809417
version: 2

@bjoto
Copy link
Author

bjoto commented Dec 12, 2023

Upstream branch: f352a28
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=809417
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 5, 2024

Upstream branch: f352a28
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=809417
version: 2

@bjoto
Copy link
Author

bjoto commented Jan 5, 2024

Upstream branch: 5a2cf77
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=809417
version: 2

Alexandre Ghiti added 2 commits January 5, 2024 22:06
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>
@bjoto bjoto closed this Jan 8, 2024
@bjoto bjoto deleted the series/800200=>for-next branch January 10, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant