mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Track whether pages were unmapped from any MM (even ones with a currently empty mm_cpumask) by the reclaim code, to figure out whether or not broadcast TLB flush should be done when reclaim finishes. The reason any MM must be tracked, and not only ones contributing to the tlbbatch cpumask, is that broadcast ASIDs are expected to be kept up to date even on CPUs where the MM is not currently active. This change allows reclaim to avoid doing TLB flushes when only clean page cache pages and/or slab memory were reclaimed, which is fairly common. ( This is a simpler alternative to the code that was in my INVLPGB series before, and it seems to capture most of the benefit due to how common it is to reclaim only page cache. ) Signed-off-by: Rik van Riel <riel@surriel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20250319132520.6b10ad90@fangorn
20 lines
467 B
C
20 lines
467 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ARCH_X86_TLBBATCH_H
|
|
#define _ARCH_X86_TLBBATCH_H
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
struct arch_tlbflush_unmap_batch {
|
|
/*
|
|
* Each bit set is a CPU that potentially has a TLB entry for one of
|
|
* the PFNs being flushed..
|
|
*/
|
|
struct cpumask cpumask;
|
|
/*
|
|
* Set if pages were unmapped from any MM, even one that does not
|
|
* have active CPUs in its cpumask.
|
|
*/
|
|
bool unmapped_pages;
|
|
};
|
|
|
|
#endif /* _ARCH_X86_TLBBATCH_H */
|