kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Mathias Krause <minipli@grsecurity.net>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 3/5] KVM: Shrink struct kvm_mmu_memory_cache
Date: Mon, 13 Feb 2023 17:08:09 +0000	[thread overview]
Message-ID: <Y+puefrgtqf430fs@google.com> (raw)
In-Reply-To: <20230213163351.30704-4-minipli@grsecurity.net>

On Mon, Feb 13, 2023, Mathias Krause wrote:
> 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>
> ---
>  include/linux/kvm_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
> index 76de36e56cdf..8e4f8fa31457 100644
> --- a/include/linux/kvm_types.h
> +++ b/include/linux/kvm_types.h
> @@ -92,10 +92,10 @@ struct gfn_to_pfn_cache {
>   */
>  struct kvm_mmu_memory_cache {
>  	int nobjs;
> +	int capacity;
>  	gfp_t gfp_zero;
>  	gfp_t gfp_custom;
>  	struct kmem_cache *kmem_cache;
> -	int capacity;
>  	void **objects;

If we touch this, I vote to do a more aggressive cleanup and place nobjs next
to objects, e.g.

struct kvm_mmu_memory_cache {
	gfp_t gfp_zero;
	gfp_t gfp_custom;
	struct kmem_cache *kmem_cache;
	int capacity;
	int nobjs;
	void **objects;
};

  reply	other threads:[~2023-02-13 17:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 16:33 [PATCH 0/5] KVM: Put struct kvm_vcpu on a diet Mathias Krause
2023-02-13 16:33 ` [PATCH 1/5] KVM: x86: Shrink struct kvm_pmu Mathias Krause
2023-02-13 16:33 ` [PATCH 2/5] KVM: x86: Shrink struct kvm_queued_exception Mathias Krause
2023-02-18 14:55   ` Tom Lendacky
2023-02-13 16:33 ` [PATCH 3/5] KVM: Shrink struct kvm_mmu_memory_cache Mathias Krause
2023-02-13 17:08   ` Sean Christopherson [this message]
2023-02-14 12:20     ` Mathias Krause
2023-02-13 16:33 ` [PATCH 4/5] KVM: x86: Shrink struct kvm_vcpu_arch Mathias Krause
2023-02-13 16:33 ` [PATCH 5/5] KVM: Shrink struct kvm_vcpu Mathias Krause
2023-02-13 17:05 ` [PATCH 0/5] KVM: Put struct kvm_vcpu on a diet Sean Christopherson
2023-02-14 12:19   ` Mathias Krause
2023-02-16 17:32     ` Sean Christopherson
2023-02-17 16:07       ` Mathias Krause
2023-02-17 16:35         ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+puefrgtqf430fs@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minipli@grsecurity.net \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).