mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
arm64: mm: Implement arch_wants_old_prefaulted_pte()
On CPUs with hardware AF/DBM, initialising prefaulted PTEs as 'old' improves vmscan behaviour and does not appear to introduce any overhead elsewhere. Implement arch_wants_old_prefaulted_pte() to return 'true' if we detect hardware access flag support at runtime. This can be extended in future based on MIDR matching if necessary. Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
46bdb4277f
commit
0388f9c743
1 changed files with 11 additions and 1 deletions
|
@ -980,7 +980,17 @@ static inline bool arch_faults_on_old_pte(void)
|
||||||
|
|
||||||
return !cpu_has_hw_af();
|
return !cpu_has_hw_af();
|
||||||
}
|
}
|
||||||
#define arch_faults_on_old_pte arch_faults_on_old_pte
|
#define arch_faults_on_old_pte arch_faults_on_old_pte
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Experimentally, it's cheap to set the access flag in hardware and we
|
||||||
|
* benefit from prefaulting mappings as 'old' to start with.
|
||||||
|
*/
|
||||||
|
static inline bool arch_wants_old_prefaulted_pte(void)
|
||||||
|
{
|
||||||
|
return !arch_faults_on_old_pte();
|
||||||
|
}
|
||||||
|
#define arch_wants_old_prefaulted_pte arch_wants_old_prefaulted_pte
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue