[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bugfix PATCH for-4.15] xen: credit2: fix per-entity load tracking when continuing running


  • To: Dario Faggioli <dfaggioli@xxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Mon, 7 Jun 2021 11:44:47 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bX+EwXKI2YExnugVtuinHTKeSOeX8gHOq0wQrNOVTGs=; b=QIgcyXNXK6BXswusBQIIuOET6LH70zgPvQn/ftZzr5s0I67RxS9QjNeSAB5rs+gvHP4hW7NdbpAwxA5YecO2c+DqqCj+LvUalmQN6jriKI6Ncnta7gog4T8FGFA4BfhVwHqrLSlSS7Ldc8nR5xWS5hmmwqGLhcKTcQCRsl7w+3Sv6JRrj/Xx7NkDcWTTJd7KenjXXeSpHt0yw4iVErGLWr6z910M4gj2R1i1nNYFr2TWd098nk5LvHpzVbUsv4ZgqxmRUJNqCe7rAy9fq18p+L/X+MOq8nTZp5Dt0dHE05ahfIa0StwqUEc2WbODpBDbOF7CpQalUtKbwk+QeEFbrw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CRtb8aNlXu8LRcg0Wl+2Mfsgu+Q1WLYqECGST6VV34oknB/vCxWGWRpmKiuOAeG8o709FDzIo0eFSxRmRMClQu7iFzKLa5QsWi7+TgrYA7QZiaY3odMmwiHwGZncrBv5mdPfl55R7QJlyrl1bdu8ctHG9tZnM+bPVDBjNo40iam9qqH6Hkbp8hmh8Lp/h/dP6GnVFNNOygkymIc+M/r8kBa7Q8jftHcuOog3UCof8YraBYKFAlEWYYjdlFJTTx4LEEXZr9+ku3Ka/rLljPm+RNMVCcHtXxLSbhZoW/l4WMM63OTdA+FUkg+3TtlHujKzRGkcB6xSghKygmKy00/M9A==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Mon, 07 Jun 2021 11:44:58 +0000
  • Ironport-hdrordr: A9a23:ev37Paje4JtY9NPsXCyAA5wrLHBQXh4ji2hC6mlwRA09TyX5ra 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
  • Ironport-sdr: R2MvXMKq9US595xz8s0SMRwO4NcGsXvgS3ixhMM2M5f/VEZEj+9r8WsFOA6yDcP7t4r3SiHeex /B2WU0DkFAsEn/HAYBkiXupRF1rd2D/WvfpXXv/rgv72n4bEUNyQeZIhjes0zIaRNHmyJF1BBe gPlmXmL+IdoAPj/cOISp9wKj/rIH5/OMVK37Gf4OHylEXInb4ibXHcJS5Zai2yDq4/e75ktimJ AWu4uRwvflBsQTT+1wQuFuaQWEPZ7KD72g2L9eO+tk56/H7iO6chevOTUePEKjMiKEfj+CDzSc vs0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXHLluQ+xtLrrTJUqwj2ZWRPlE/6sI65QA
  • Thread-topic: [Bugfix PATCH for-4.15] xen: credit2: fix per-entity load tracking when continuing running


> On Mar 19, 2021, at 12:14 PM, Dario Faggioli <dfaggioli@xxxxxxxx> wrote:
> 
> If we schedule, and the current vCPU continues to run, its statistical
> load is not properly updated, resulting in something like this, even if
> all the 8 vCPUs are 100% busy:
> 
> (XEN) Runqueue 0:
> (XEN) [...]
> (XEN)   aveload            = 2097152 (~800%)
> (XEN) [...]
> (XEN)   Domain: 0 w 256 c 0 v 8
> (XEN)     1: [0.0] flags=2 cpu=4 credit=9996885 [w=256] load=35 (~0%)
> (XEN)     2: [0.1] flags=2 cpu=2 credit=9993725 [w=256] load=796 (~0%)
> (XEN)     3: [0.2] flags=2 cpu=1 credit=9995885 [w=256] load=883 (~0%)
> (XEN)     4: [0.3] flags=2 cpu=5 credit=9998833 [w=256] load=487 (~0%)
> (XEN)     5: [0.4] flags=2 cpu=6 credit=9998942 [w=256] load=1595 (~0%)
> (XEN)     6: [0.5] flags=2 cpu=0 credit=9994669 [w=256] load=22 (~0%)
> (XEN)     7: [0.6] flags=2 cpu=7 credit=9997706 [w=256] load=0 (~0%)
> (XEN)     8: [0.7] flags=2 cpu=3 credit=9992440 [w=256] load=0 (~0%)
> 
> As we can see, the average load of the runqueue as a whole is, instead,
> computed properly.
> 
> This issue would, in theory, potentially affect Credit2 load balancing
> logic. In practice, however, the problem only manifests (at least with
> these characteristics) when there is only 1 runqueue active in the
> cpupool, which also means there is no need to do any load-balancing.
> 
> Hence its real impact is pretty much limited to wrong per-vCPU load
> percentages, when looking at the output of the 'r' debug-key.
> 
> With this patch, the load is updated and displayed correctly:
> 
> (XEN) Runqueue 0:
> (XEN) [...]
> (XEN)   aveload            = 2097152 (~800%)
> (XEN) [...]
> (XEN) Domain info:
> (XEN)   Domain: 0 w 256 c 0 v 8
> (XEN)     1: [0.0] flags=2 cpu=4 credit=9995584 [w=256] load=262144 (~100%)
> (XEN)     2: [0.1] flags=2 cpu=6 credit=9992992 [w=256] load=262144 (~100%)
> (XEN)     3: [0.2] flags=2 cpu=3 credit=9998918 [w=256] load=262118 (~99%)
> (XEN)     4: [0.3] flags=2 cpu=5 credit=9996867 [w=256] load=262144 (~100%)
> (XEN)     5: [0.4] flags=2 cpu=1 credit=9998912 [w=256] load=262144 (~100%)
> (XEN)     6: [0.5] flags=2 cpu=2 credit=9997842 [w=256] load=262144 (~100%)
> (XEN)     7: [0.6] flags=2 cpu=7 credit=9994623 [w=256] load=262144 (~100%)
> (XEN)     8: [0.7] flags=2 cpu=0 credit=9991815 [w=256] load=262144 (~100%)
> 
> Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>
> ---
> Cc: George Dunlap <george.dunlap@xxxxxxxxxx>
> Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>
> ---
> Despite the limited effect, it's a bug. So:
> - it should be backported;
> - I think it should be included in 4.15. The risk is pretty low, for
>  the same reasons already explained when describing its limited impact.
> ---
> xen/common/sched/credit2.c |    2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index eb5e5a78c5..b3b5de94cf 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -3646,6 +3646,8 @@ static void csched2_schedule(
>             runq_remove(snext);
>             __set_bit(__CSFLAG_scheduled, &snext->flags);
>         }
> +        else
> +            update_load(ops, rqd, snext, 0, now);

I feel like there must be a better way to do this than just bruteforce remember 
everywhere we could possibly need to update the load.  But at any rate:

Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.