Skip to content

Conversation

@linux-riscv-bot
Copy link

PR for series 1028324 applied to workflow__riscv__fixes

Name: riscv: mm: Introduce lazy tlb flush
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1028324
Version: 2

This feature avoids unnecessary TLB Flush IPIs. After memory mapping
modifications on certain mm_struct, instead of sending IPIs, this feature
records the TLB Flush information on percpu buffer, defer the TLB Flush
to the moment when target CPUs really load this mm_struct.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
Since each CPU has limited TLB entries, there exist limited active ASIDs
in each CPU's TLB at the same time. Thus we apply a threshold here. When
a mm_struct is loaded, we mark its ASID as active. If the number of
active ASIDs exceeds the threshold, we evict the mm_struct that has not
been used for the longest time, flush its TLB entries, mark its ASID
inactive, and clear current CPU in its mm_cpumask.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
We maintain an array of mm_structs whose ASIDs are active on the current
CPU. To avoid these mm_structs getting released, we grab their mm_count
before loaded them into the array. And drop their mm_count via tasklet
when they are evicted out of the array.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
When both CONFIG_RISCV_LAZY_TLB_FLUSH and CONFIG_MMU_LSYZ_TLB_SHOOTDOWN
is enabled, riscv needs an arch special method to free the mm that needs
to be shot down. Thus we add arch override for  do_shoot_lazy_tlb().

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
When an active_mm is shot down, we switch it to the init_mm, evict it
out of percpu active mm array.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
When memory mapping of a mm is modified, instead of sending IPI to all
CPUs recorded in its mm_cpumask, we check whether each target CPU is
using this mm right now. If not, we just store the TLB Flush information
in target CPU's percpu TLB Flush queue, avoiding the IPI.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
Since the TLB Flush IPI is avoided when the modified mm is not running
on the target CPU, next time when target CPU switches to the modified
mm, it has to check percpu TLB Flush queue and perform TLB FLush for the
midified mm.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
When local_flush_tlb_all_asid() is called, the target mm's TLB entries
are all flushed out, then we can clear current CPU in its mm_cpumask so
that next time the mm's memory mapping is modified, no IPI will be sent
to current CPU.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
Now that we maintain an array of active mms on each CPU, when
local_flush_tlb_all() is called, we can clear current CPU in the
mm_cpumask of all active mms on current CPU.

Signed-off-by: Xu Lu <[email protected]>
Signed-off-by: Linux RISC-V bot <[email protected]>
@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 110.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1100.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1412.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.57 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 77.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
kdoc
Desc: Detects for kdoc errors
Duration: 0.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[RFC,v2,1/9] riscv: Introduce RISCV_LAZY_TLB_FLUSH config"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 109.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2353.79 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 3018.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.70 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.55 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.51 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[RFC,v2,2/9] riscv: mm: Apply a threshold to the number of active ASIDs on each CPU"
kdoc
Desc: Detects for kdoc errors
Duration: 1.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 77.79 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
kdoc
Desc: Detects for kdoc errors
Duration: 1.02 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 7: "[RFC,v2,7/9] riscv: mm: Defer the TLB Flush to switch_mm"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 111.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1167.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1632.79 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
kdoc
Desc: Detects for kdoc errors
Duration: 1.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 8: "[RFC,v2,8/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all_asid()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 109.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2335.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2979.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.36 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[RFC,v2,9/9] riscv: mm: Clear mm_cpumask during local_flush_tlb_all()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants