Skip to content

Commit 1148bfc

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86/mmu: Move lpage_disallowed_link further "down" in kvm_mmu_page
Move "lpage_disallowed_link" out of the first 64 bytes, i.e. out of the first cache line, of kvm_mmu_page so that "spt" and to a lesser extent "gfns" land in the first cache line. "lpage_disallowed_link" is accessed relatively infrequently compared to "spt", which is accessed any time KVM is walking and/or manipulating the shadow page tables. No functional change intended. Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ca41c34 commit 1148bfc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/kvm/mmu/mmu_internal.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ extern bool dbg;
3131
#define IS_VALID_PAE_ROOT(x) (!!(x))
3232

3333
struct kvm_mmu_page {
34+
/*
35+
* Note, "link" through "spt" fit in a single 64 byte cache line on
36+
* 64-bit kernels, keep it that way unless there's a reason not to.
37+
*/
3438
struct list_head link;
3539
struct hlist_node hash_link;
36-
struct list_head lpage_disallowed_link;
3740

3841
bool tdp_mmu_page;
3942
bool unsync;
@@ -59,6 +62,7 @@ struct kvm_mmu_page {
5962
struct kvm_rmap_head parent_ptes; /* rmap pointers to parent sptes */
6063
DECLARE_BITMAP(unsync_child_bitmap, 512);
6164

65+
struct list_head lpage_disallowed_link;
6266
#ifdef CONFIG_X86_32
6367
/*
6468
* Used out of the mmu-lock to avoid reading spte values while an

0 commit comments

Comments
 (0)