Thread (14 messages) read the whole thread 14 messages, 4 authors, 2022-07-23

Re: [PATCH v2 2/4] mm: rmap: Allow platforms without mm_cpumask to defer TLB flush

From: Kefeng Wang <hidden>
Date: 2022-07-11 13:35:15
Also in: linux-doc, linux-mips, linux-mm, linux-riscv, linux-s390, linuxppc-dev, lkml

Hi Barry,

On 2022/7/11 11:46, Barry Song wrote:
From: Barry Song <redacted>

Platforms like ARM64 have hareware TLB shootdown broadcast. They
don't maintain mm_cpumask but just send tlbi and related sync
instructions for TLB flush. task's mm_cpumask is normally empty
in this case. We also allow deferred TLB flush on this kind of
platforms.

Signed-off-by: Barry Song <redacted>>
---
...
quoted hunk ↗ jump to hunk
diff --git a/mm/Kconfig b/mm/Kconfig
index 169e64192e48..7bf54f57ca01 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -951,6 +951,9 @@ config ARCH_HAS_CURRENT_STACK_POINTER
  	  register alias named "current_stack_pointer", this config can be
  	  selected.
  
+config ARCH_HAS_MM_CPUMASK
+	bool
+
  config ARCH_HAS_VM_GET_PAGE_PROT
  	bool
  
diff --git a/mm/rmap.c b/mm/rmap.c
index 5bcb334cd6f2..13d4f9a1d4f1 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -692,6 +692,10 @@ static bool should_defer_flush(struct mm_struct *mm, enum ttu_flags flags)
  	if (!(flags & TTU_BATCH_FLUSH))
  		return false;
  
+#ifndef CONFIG_ARCH_HAS_MM_CPUMASK
+	return true;
+#endif
+
Here is another option to enable arch's tlbbatch defer

[1] 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20171101101735.2318-2-khandual@linux.vnet.ibm.com/
  	/* If remote CPUs need to be flushed then defer batch the flush */
  	if (cpumask_any_but(mm_cpumask(mm), get_cpu()) < nr_cpu_ids)
  		should_defer = true;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help