From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 F16A136E47B for ; Tue, 17 Feb 2026 16:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345266; cv=none; b=MdpPGI/jTDtOWopYgtAcAVSQ9cPA63TcoZMJ545C/YN+lDac0NokcX+lFHsQfDQimVYFsaSgse0Dg8sbiH1pHH+saSBlze9oN7ZZKVvKDdpf+K1dB4DhEab3Y9H7yIUfwHfEdgoxrCUJyC20YEFsP9sOwQkF8fSfY9CzCZKXplc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345266; c=relaxed/simple; bh=eZEe8U40ghU/K15ooJWXSf63PwA1BaHVbEpt8R+8p4M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CZHQjkPKTin6V2+0IYIf9TJp4DtRXBFNju/MFMTOEZzmsHYtYPScIkERodJJUad4Yi5ujZSNQKgNrBnbb+E00LpGFpjRDMaMZifyfOj0Jqgla+82CEhJirqFz+ehaRzp6j75/zpKPPG0A12PLu71sm2Z7u5czTzSfYyrfu0TGLw= 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=qH3n/si0; arc=none smtp.client-ip=209.85.215.202 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="qH3n/si0" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c6df833e1efso15099898a12.2 for ; Tue, 17 Feb 2026 08:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771345264; x=1771950064; 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=iWP/bwIx7Xqh2wLp9dGsn82lhgqSno2S73rZTaTg0ek=; b=qH3n/si0aqjaR6esWyGiE+dxlOFUtqszKsVbHKyIN6pSsas0ZON4kp/DwFfak/KuHz PATtEGP+IsWsxTNec3dBbcOQ/B0LVMgRasJYMO4u+9qSgjZyBbTbZjL6rALA+aDVXkVX ahppLZy+XN32wyjR8CXO2p3Yvw3I4X/amPkCVflQYyia9LseL3Y500+yIXbaGrO+WzoZ H19VNiQalL6az7x0Mruzk39ZFYu4hCibJcdp3R7BzNbxrmvVrIcGMaQNinZ9WhNL7ho2 YGQDhGyINvmagDE4beN3pIGpsiNeST53jP8MX17+QTFTKxhgouHjz6bqErJTOSHQISEh 3qPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771345264; x=1771950064; 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=iWP/bwIx7Xqh2wLp9dGsn82lhgqSno2S73rZTaTg0ek=; b=azdRJeHdOnXEj40nXb0CJWlS9ndHFh+bg0hvQgzXkEAbm0EXXQyDeZczjLK4XHvGBq aBlCpgK40DhQBlpn/pb56Ztkixl5VcAeWFxsbDsMZBEz2FoYdYBEf9YLOz8T6yZAVjPu HBjhWyCvi2owAwuHonve2z/m/pouahZSvhfpF79hJFQRSlf1Bmm2XO8hopXiWEejHW+4 Is77PWMwQgCBfoTHjamSLoEH2xKsBUTTarWDLI1XiMYt1AdEiM4ujzNK9TAHW5/xtlv1 nYotDzEcal6VvrjtT8O5ZW2GR6u2KU/MOl7wHsgVqwd+pn13Flr+IsxAvGieAVVm1a5d Q6/g== X-Forwarded-Encrypted: i=1; AJvYcCVHnQdmz2MzUR4NcmPsgqwu0P5rNYxD5mMHT5YAAd6Zj5nuGFRwLAGjy23c7ll/8RPqJU8=@vger.kernel.org X-Gm-Message-State: AOJu0YyWwvW2R2RL5cTtRlOVPi+Uznmvk3IzbKztx7H3wEAkz3bbtAZ6 cr93/jSI3JIUKPjxh1dYVL0M6YKJwPBX4UX3sLQm34nXexmevLi5AWLy4eLAEeUC5O0jExtL629 yF4bTYQ== X-Received: from pfbfb25.prod.google.com ([2002:a05:6a00:2d99:b0:824:af69:6dae]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:808e:b0:824:93e4:2ddf with SMTP id d2e1a72fcca58-824c5ea253emr16113080b3a.13.1771345264049; Tue, 17 Feb 2026 08:21:04 -0800 (PST) Date: Tue, 17 Feb 2026 08:21:02 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260215140402.24659-1-76824143@qq.com> Message-ID: Subject: Re: [PATCH 3/3] KVM: x86: Use dynamic try count based on vCPU count From: Sean Christopherson To: 76824143@qq.com Cc: pbonzini@redhat.com, kvm@vger.kernel.org, zhanghao Content-Type: text/plain; charset="us-ascii" On Sun, Feb 15, 2026, 76824143@qq.com wrote: > From: zhanghao > > Replace the fixed try count (3) with a dynamic calculation based > on the number of online vCPUs. This allows larger VMs to try more > candidates before giving up, while keeping small VMs efficient. > > Formula: clamp(ilog2(nr_vcpus + 1), 3, 10) > - 4 vCPUs: try = 3 > - 64 vCPUs: try = 6 > - 256 vCPUs: try = 8 Why do larger VMs warrant more attempts though? E.g. what are practical downsides of trying min(nr_vcpus - 1, 8) times?