mirror of
https://github.com/torvalds/linux.git
synced 2024-12-18 00:53:40 +00:00
ARCv2: mm: THP: flush_pmd_tlb_range make SMP safe
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
This commit is contained in:
parent
722fe8fd36
commit
c7119d56d2
@ -17,6 +17,8 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
|
|||||||
void local_flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
void local_flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
||||||
void local_flush_tlb_range(struct vm_area_struct *vma,
|
void local_flush_tlb_range(struct vm_area_struct *vma,
|
||||||
unsigned long start, unsigned long end);
|
unsigned long start, unsigned long end);
|
||||||
|
void local_flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||||
|
unsigned long end);
|
||||||
|
|
||||||
#ifndef CONFIG_SMP
|
#ifndef CONFIG_SMP
|
||||||
#define flush_tlb_range(vma, s, e) local_flush_tlb_range(vma, s, e)
|
#define flush_tlb_range(vma, s, e) local_flush_tlb_range(vma, s, e)
|
||||||
@ -24,6 +26,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma,
|
|||||||
#define flush_tlb_kernel_range(s, e) local_flush_tlb_kernel_range(s, e)
|
#define flush_tlb_kernel_range(s, e) local_flush_tlb_kernel_range(s, e)
|
||||||
#define flush_tlb_all() local_flush_tlb_all()
|
#define flush_tlb_all() local_flush_tlb_all()
|
||||||
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
|
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
|
||||||
|
#define flush_pmd_tlb_range(vma, s, e) local_flush_pmd_tlb_range(vma, s, e)
|
||||||
#else
|
#else
|
||||||
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||||
unsigned long end);
|
unsigned long end);
|
||||||
@ -31,5 +34,7 @@ extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
|
|||||||
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
||||||
extern void flush_tlb_all(void);
|
extern void flush_tlb_all(void);
|
||||||
extern void flush_tlb_mm(struct mm_struct *mm);
|
extern void flush_tlb_mm(struct mm_struct *mm);
|
||||||
|
extern void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
|
||||||
|
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
#endif
|
#endif
|
||||||
|
@ -421,6 +421,15 @@ static inline void ipi_flush_tlb_range(void *arg)
|
|||||||
local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
|
local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||||
|
static inline void ipi_flush_pmd_tlb_range(void *arg)
|
||||||
|
{
|
||||||
|
struct tlb_args *ta = arg;
|
||||||
|
|
||||||
|
local_flush_pmd_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void ipi_flush_tlb_kernel_range(void *arg)
|
static inline void ipi_flush_tlb_kernel_range(void *arg)
|
||||||
{
|
{
|
||||||
struct tlb_args *ta = (struct tlb_args *)arg;
|
struct tlb_args *ta = (struct tlb_args *)arg;
|
||||||
@ -461,6 +470,20 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
|||||||
on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range, &ta, 1);
|
on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range, &ta, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||||
|
void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||||
|
unsigned long end)
|
||||||
|
{
|
||||||
|
struct tlb_args ta = {
|
||||||
|
.ta_vma = vma,
|
||||||
|
.ta_start = start,
|
||||||
|
.ta_end = end
|
||||||
|
};
|
||||||
|
|
||||||
|
on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_pmd_tlb_range, &ta, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
||||||
{
|
{
|
||||||
struct tlb_args ta = {
|
struct tlb_args ta = {
|
||||||
@ -659,7 +682,7 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp)
|
|||||||
return pgtable;
|
return pgtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
void local_flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
|
||||||
unsigned long end)
|
unsigned long end)
|
||||||
{
|
{
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
|
Loading…
Reference in New Issue
Block a user