Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp594523pxy; Thu, 22 Apr 2021 09:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyycYBZKMhXQx3Z2/1NwNrekbxtRJQB47yIAd/iSTB7kDeY/sRCugEBHS+N7liicyzN7/T/ X-Received: by 2002:a63:5249:: with SMTP id s9mr4215342pgl.192.1619107217612; Thu, 22 Apr 2021 09:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619107217; cv=none; d=google.com; s=arc-20160816; b=eM0RRQKCNfpbFImx6cQ3VY2aIOThAfRSkdwTMfmOlXnz8/8lMdss7Gz0/YSNl3XMom rq7Sr1qokHChY3hYim/j4tDfmq+E+XSK3UB9eva7YpzQF7kMP8r3QB8ORXoSlubpQ+bi tWQRSXtGLydusT3gGli+3f9h+1TtLqm1wyHY8bBpcEXeZJ3FZk+dO7BZr8lx7bfds5up 3cw64InR32StZ/gFZuBxIZuxi9Ti7HY1QV6a0nE9fh1ofFew1Y8n/MJ29PArxlJ6zmJB mchbJLjPaO5japUvinjm67img0PkmqYLNzEZwtmVps262iJqGsYfYOwhI6kC0e3U+LoD GiLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=44uFSIKvqnC7V+9ZchehMmm34h8scMBiFWmZbyka+5I=; b=E4MC9T2MwAfU9DS5Rjjx+UOfeA0WUwN6PpR9J9BHiYQERaSDirJEI0Z4RAkJjsAZhr mgF7eSZjMIdJMWU1FeOjg03k5bNxDonqB2SSywj7AG/PZUy/xaZtNcFeX1zel2mKEuAW yby790AzBgy3qKIpghEdX1EqRa1NR3ai8m+UIIZBBBRekfDqHAllsszNupgveV6xvyqM Ykq8xQieOpB7cY9FFVaTCX0HeVnsD7jYge6GDLIu5+Z7WA1o5+Ro4FvN0c1LB43Xhs0u UkCQVrW6paADWOmQruEhhAq1UaBPCZ2/ESiIMLsM62/cm5AzzOLgM8wJIciEBQo5sRtF UuSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cMiEjZ1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si3802374pgf.354.2021.04.22.09.00.04; Thu, 22 Apr 2021 09:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cMiEjZ1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236713AbhDVP70 (ORCPT + 99 others); Thu, 22 Apr 2021 11:59:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236459AbhDVP7W (ORCPT ); Thu, 22 Apr 2021 11:59:22 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C52B3C06138B for ; Thu, 22 Apr 2021 08:58:46 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id a12so32004768pfc.7 for ; Thu, 22 Apr 2021 08:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=44uFSIKvqnC7V+9ZchehMmm34h8scMBiFWmZbyka+5I=; b=cMiEjZ1B9JMl8QATUXKRwJxkhvh5LCCEJA1EPShkG5o7xzgME4hzquSiFFSCVuKw2B JwqtwHPEYESxOMlFUI13tzjNMcegmUV0xlrg7yIb5Lufn8Xs7oHPzAVXKxjmZ5dCaIaE WxOPyIfhTTJOjVnJBqbDuuJgKDln1FmrMMl47T1/auyzw7U/kpQP59IyvNwBc9yG9R7t +pHBoVsBV4aBkuFKMOXvL0zjFOIiAWYMizug6eGhWegiGoawjtuixtlUfUmXdU3kyJV9 CWOPOpkD6ro5l8Ipa0biA6w1HVaySW3pP9NchcMgAXZnHRsiz9ZRoH3FA7TtCV514owb /Dgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=44uFSIKvqnC7V+9ZchehMmm34h8scMBiFWmZbyka+5I=; b=MNU4AHqYWd6Wc6yNMKdI8AhoNlmxLq6wZMja4bPiJuTnK32IPrZDrvGK94B/jEh1lC jy8IV4gZksLYZgVamesv4/bZEHHXA+HAXE08b1VdwQbnRo4vLJCUEi3dNYjGxqlyXo67 HpkrBtfHPTpRCe1Hqq88mcuBP7JSLy7yYhjMsLlXUhYsIPkwsW3u/rFcL6wIQmTBjnZ6 X0YblI7SVV84S+29sMlQc6mIAWumJY3fEiYStT5+5D82BollOOi1JzB12aoOMNiNuxxX FY8wJAsQqMCr01cXDznNEITeM5WNwRsOl1V1ApPulsn4KRbEauL9Y2H7hCFNaJw73m4P WY6A== X-Gm-Message-State: AOAM530ZTAf7FH0bI9m0BfpK0LwQT/1Wajicb8/VzFjZ4bZLGRET60sZ +0HQjd/06itwEh3jnQ6WVbpkGg== X-Received: by 2002:a65:45cf:: with SMTP id m15mr4170458pgr.7.1619107126146; Thu, 22 Apr 2021 08:58:46 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id n11sm2818575pff.96.2021.04.22.08.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 08:58:45 -0700 (PDT) Date: Thu, 22 Apr 2021 15:58:41 +0000 From: Sean Christopherson To: Wanpeng Li Cc: Kenta Ishiguro , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , David Hildenbrand , kvm , LKML , Pierre-Louis Aublin , =?utf-8?B?5rKz6YeO5YGl5LqM?= Subject: Re: [RFC PATCH 0/2] Mitigating Excessive Pause-Loop Exiting in VM-Agnostic KVM Message-ID: References: <20210421150831.60133-1-kentaishiguro@sslab.ics.keio.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021, Wanpeng Li wrote: > On Thu, 22 Apr 2021 at 09:45, Sean Christopherson wrote: > > > > On Thu, Apr 22, 2021, Kenta Ishiguro wrote: > > > To solve problems (2) and (3), patch 2 monitors IPI communication between > > > vCPUs and leverages the relationship between vCPUs to select boost > > > candidates. The "[PATCH] KVM: Boost vCPU candidiate in user mode which is > > > delivering interrupt" patch > > > (https://lore.kernel.org/kvm/CANRm+Cy-78UnrkX8nh5WdHut2WW5NU=UL84FRJnUNjsAPK+Uww@mail.gmail.com/T/) > > > seems to be effective for (2) while it only uses the IPI receiver > > > information. > > > > On the IPI side of thing, I like the idea of explicitly tracking the IPIs, > > especially if we can simplify the implementation, e.g. by losing the receiver > > info and making ipi_received a bool. Maybe temporarily table Wanpeng's patch > > while this approach is analyzed? > > Hi all, > > I evaluate my patch Thanks for doing the testing, much appreciated! > (https://lore.kernel.org/kvm/1618542490-14756-1-git-send-email-wanpengli@tencent.com), > Kenta's patch 2 and Sean's suggestion. The testing environment is > pbzip2 in 96 vCPUs VM in over-subscribe scenario (The host machine is > 2 socket, 48 cores, 96 HTs Intel CLX box). Are the vCPUs affined in any way? How many VMs are running? Are there other workloads in the host? Not criticising, just asking so that others can reproduce your setup. > Note: the Kenta's scheduler hacking is not applied. The score of my patch is > the most stable and the best performance. On the other hand, Kenta's approach has the advantage of working for both Intel and AMD. But I'm also not very familiar with AMD's AVIC, so I don't know if it's feasible to implement a performant equivalent in svm_dy_apicv_has_pending_interrupt(). Kenda's patch is also flawed as it doesn't scale to 96 vCPUs; vCPUs 64-95 will never get boosted. > Wanpeng's patch > > The average: vanilla -> boost: 69.124 -> 61.975, 10.3% > > * Wall Clock: 61.695359 seconds > * Wall Clock: 63.343579 seconds > * Wall Clock: 61.567513 seconds > * Wall Clock: 62.144722 seconds > * Wall Clock: 61.091442 seconds > * Wall Clock: 62.085912 seconds > * Wall Clock: 61.311954 seconds > > Kenta' patch > > The average: vanilla -> boost: 69.148 -> 64.567, 6.6% > > * Wall Clock: 66.288113 seconds > * Wall Clock: 61.228642 seconds > * Wall Clock: 62.100524 seconds > * Wall Clock: 68.355473 seconds > * Wall Clock: 64.864608 seconds > > Sean's suggestion: > > The average: vanilla -> boost: 69.148 -> 66.505, 3.8% > > * Wall Clock: 60.583562 seconds > * Wall Clock: 58.533960 seconds > * Wall Clock: 70.103489 seconds > * Wall Clock: 74.279028 seconds > * Wall Clock: 69.024194 seconds