From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 669421D52B for ; Sat, 24 Aug 2024 00:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724457626; cv=none; b=nKcuEsYH0cZDNNm37L9GGVdWajDlQdlWXbiBdkE3ZKsl1ij9KL5TJSg4fKxPfPwCJOjS5y5uZiGGy6U2aTK+6Tse8xMMEpy2McjcLeUGqWFytIh6X5dkwXrZ1F2I3VdUELaY2ds/l8XUr6f4mf4/e066u6zB+m+3CQTxM3Y/ssQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724457626; c=relaxed/simple; bh=CBlzlCej0jlDEn2XXcD3WNh08kLlrh+iXs5vQ8oBStk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=toyVjSGL+DHF2qqrmqa4RoUpWmjHitzxiIXGW6TYLKfCU/Z4rVTkJhv8yXHpK8Dzp2YlQBD/dLcPWwk5BB44x81VKA3PCMHqwUiRYHUHs6Y1hCHzatRxbOiUTPIHJBpmtRwSStX11Ctlc8sqrHtaDZNsqIDk/axxr+WKMDGVooE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GBF1P9Eu; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GBF1P9Eu" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-71440a7cd08so1915850b3a.2 for ; Fri, 23 Aug 2024 17:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724457625; x=1725062425; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1ca0bECA5aRr3r9kHtnZQuHEvw2Ot4ILpPTiRBu+Z1Q=; b=GBF1P9EuTOpyWDE5cKqORrvUUgQFQGil7uLVcn0oPl422K3TofMXc8BM2+gjUIRm+l AeFxXAX7Cqyv0CWQsXnbBgS0b2moFxK07WTW2yj4Kh+ho4AEvRPQg6DIZ8D2z7qtC2u6 8Xwo+w9WVYQahXCpew/Zxj4YO8lNj9c6Gvvy46EzarSItCD34LHP++2QYRXfW3aRY1b5 bZTHIVB9+lGo1rZyTMfdjNBQksgUAnTy0EVV2X30AcMjXJWjrHo/oxG5FZO0jvbb39mS bfJCxuHZ2eGraKGbopvfCsemq7ZcgpkR2VK07QjOCNTt58nEyZhIQhwbZ75BcXbn26h/ e0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724457625; x=1725062425; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1ca0bECA5aRr3r9kHtnZQuHEvw2Ot4ILpPTiRBu+Z1Q=; b=TtZXFlbT8C4Z6TR89cWyj89vd1BNk12T7Yf/2yaazGhu4G2FQMC41vfvQb1caXpeqz o7w0Y9L6ozLlY7t632UNxpU0ceOR3NoqqxAqxjqiR3bwKdl9WfYLxJp3Ix1cm8rwKZ4v DCOFMjuM2pBR2ULDH8/kd3rCEjOMreGIHZPn5TF2wsElD8XJCw4OtwsLoPs+5HLVfKJl JJvlFfoc/EmjZI7DyfLXcePeTigxl8qc8SA/8zpKwkePI7P8T4uBI5aP71teh9eWoIH0 vqDKNAK2AppIKG61f6/QXNddJOKU21g5qrXN3or5A18lKwXuozSu4ykZ/kfVXuHajl6B UXUQ== X-Forwarded-Encrypted: i=1; AJvYcCWO40qcFk57xRFIlNCdnMCuj3YLeYo0p+CNZp5y71VZXh0PWh0cAYXPG0lfNuT6LBxc44sjZSw+RBvXzd4=@vger.kernel.org X-Gm-Message-State: AOJu0YxvQ6ffr/hhS4/x4AGF5usb31INwc1f/+UHXrs8BoryC4yb1CBf ziCIzcerY2LJ/eSeSit+ess1TbDYGqrs5EMmU/QpMp8LgB5EH0UfPLsb3KfiG48H7rn1eJFB376 IUA== X-Google-Smtp-Source: AGHT+IFjH1L+yx6ePew+AVPSI6ETQhn78QMIuKkHsHXFR08QFYT6Z4rKQmWThVz1lyeaqhvB+H2v7V4R2l4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:8b93:b0:714:37ed:dcb3 with SMTP id d2e1a72fcca58-714458baf14mr14478b3a.4.1724457624368; Fri, 23 Aug 2024 17:00:24 -0700 (PDT) Date: Fri, 23 Aug 2024 17:00:23 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240821112737.3649937-1-liuyongqiang13@huawei.com> Message-ID: Subject: Re: [PATCH -next] KVM: SVM: Remove unnecessary GFP_KERNEL_ACCOUNT in svm_set_nested_state() From: Sean Christopherson To: Kai Huang Cc: Yongqiang Liu , 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 Content-Type: text/plain; charset="us-ascii" 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.