mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Kai Huang <kai.huang@intel.com>
Cc: Yongqiang Liu <liuyongqiang13@huawei.com>,
	kvm@vger.kernel.org,  linux-kernel@vger.kernel.org,
	zhangxiaoxu5@huawei.com, hpa@zytor.com,  x86@kernel.org,
	dave.hansen@linux.intel.com, bp@alien8.de, mingo@redhat.com,
	 tglx@linutronix.de, pbonzini@redhat.com
Subject: Re: [PATCH -next] KVM: SVM: Remove unnecessary GFP_KERNEL_ACCOUNT in svm_set_nested_state()
Date: Fri, 23 Aug 2024 17:00:23 -0700	[thread overview]
Message-ID: <Zskil6dbwJmL93cO@google.com> (raw)
In-Reply-To: <b3c27ca7-a409-4df5-bb55-3c3314347d7d@intel.com>

On Fri, Aug 23, 2024, Kai Huang wrote:
> 
> 
> On 21/08/2024 11:27 pm, Yongqiang Liu wrote:
> > The fixed size temporary variables vmcb_control_area and vmcb_save_area
> > allocated in svm_set_nested_state() are released when the function exits.
> > Meanwhile, svm_set_nested_state() also have vcpu mutex held to avoid
> > massive concurrency allocation, so we don't need to set GFP_KERNEL_ACCOUNT.
> 
> Hi Sean/Paolo,
> 
> Seems more patches are popping up regarding to whether to use _ACCOUNT for
> temporary memory allocation.  Could we have a definitive guide on this?

If the allocations are temporary, e.g. scoped to exactly one function, not massive
(use best judgment), and can't be used in any kind of novel DDoS attack, e.g. are
limited to one per vCPU or so, then they don't need to be accounted.

At least, that's my take on things.

  reply	other threads:[~2024-08-24  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 11:27 Yongqiang Liu
2024-08-23  0:03 ` Huang, Kai
2024-08-24  0:00   ` Sean Christopherson [this message]
2024-08-24  9:33     ` Huang, Kai
2024-08-23 23:47 ` 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=Zskil6dbwJmL93cO@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyongqiang13@huawei.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zhangxiaoxu5@huawei.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

all inboxes | Powered by JetHome®