Skip to content

Commit

Permalink
KVM: Shrink struct kvm_mmu_memory_cache
Browse files Browse the repository at this point in the history
Move the 'capacity' member around to make use of the padding hole on 64
bit systems instead of introducing yet another one.

This allows us to save 8 bytes per instance for 64 bit builds of which,
e.g., x86's struct kvm_vcpu_arch has a few.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230217193336.15278-3-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
minipli-oss authored and sean-jc committed Mar 23, 2023
1 parent 14aa40a commit f530b53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/kvm_types.h
Expand Up @@ -91,11 +91,11 @@ struct gfn_to_pfn_cache {
* is topped up (__kvm_mmu_topup_memory_cache()).
*/
struct kvm_mmu_memory_cache {
int nobjs;
gfp_t gfp_zero;
gfp_t gfp_custom;
struct kmem_cache *kmem_cache;
int capacity;
int nobjs;
void **objects;
};
#endif
Expand Down

0 comments on commit f530b53

Please sign in to comment.