Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1387940ybi; Fri, 12 Jul 2019 15:10:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqymBrSRXWWoil2N/1CCgeX/f2t1bgDZ57Zj35UZvr+SW5BqcLZvTSdF2vJEpKeco92M8FhL X-Received: by 2002:a63:3046:: with SMTP id w67mr13857453pgw.37.1562969446826; Fri, 12 Jul 2019 15:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562969446; cv=none; d=google.com; s=arc-20160816; b=fppJkbCtuLtTi+TorVCk6BTHxPbg0sYIb2n3ON0CdTCMu84C9FLTaCP+Ec2Wp1QtPt xCvZIHFoFS4HHv3nCkGzRbNGqxSJ9iU8yHzqtT+NoksNKnp//XLxVLg7wNAj3VaBG2Cx b6szQF7RTW9oqyqWhAvoDb7Vmb4GUW3+M9pQNxws+UeB+Wt1paYTzTrSPZLnbk0RghQh 736B8UkVHPatQeVNxnypkhNcJKT8ly94w+6uMgDrObx8qxFM1n/G4oXxRLXc+CzkEjKD jjDPJR11tY+8J9GOCj8V3RvOcg5jTCLupFo//CmOpHAzdkR87X2w2faXgTf+jrQlxAb+ gBSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=zuU348vMM9aXraE4ccy+eAHv0CShi7BKwdNOAqDmvDI=; b=E5bU9SugV4urziuklxEtqX9Cj7bOE25sIe+/HoU1+38rrSF1JbDMD7mL3MAcdMc7sf hjpUamVW5sHGmExxnphqkJXsbZg3A/PlHJjT9rjEpVRJgIgRCrw5OyKYXcTmcTfSGOVX /niOeyE4M+FX9ocjdJUOOa/E4jbHLr2YXtzIW1XnTTgffQlsBrZFIJ+Rew8SU6YtaHTP /vIiLbOCOkDxlV8W/FmTo91fqY9wU4MxUbNJFxnviE0joz5nB8UKpP7ifn4WPhZ8rovm OCbblUuKMco5e4i1iPm+BRd70OVHuUVJqaXMM2zWK8D7PmFXLf5YAkdQF3teNk962xBu Yfdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NFurjCS4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id q19si9348520pgj.42.2019.07.12.15.10.31; Fri, 12 Jul 2019 15:10:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NFurjCS4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727807AbfGLWKB (ORCPT + 99 others); Fri, 12 Jul 2019 18:10:01 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34675 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbfGLWKA (ORCPT ); Fri, 12 Jul 2019 18:10:00 -0400 Received: by mail-pf1-f194.google.com with SMTP id b13so4891669pfo.1 for ; Fri, 12 Jul 2019 15:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zuU348vMM9aXraE4ccy+eAHv0CShi7BKwdNOAqDmvDI=; b=NFurjCS4ooi0Fvo+RA6fYOmAV3aI9uoCXtAdcbExWzcIftI8DfV9JB8MhRl69Nkd12 WJlgvG6DaRBT85EjBYvmNsJOMUBjLpOwKA8/MF6ehv7mq7G2SQDEX+RScKErCld4Oh9n lx5EEDhrlZvfID2u1YwWjPNskhw8Msgc1X2OpGnLqrmXlt123SbRgZQKprlIhWhxHowA TFO95zYgyxnLNE1dsmf/IhAx9WFRQHstemWHiXAeZf3/oQbfFufly73Y48mzb1yXanjg PtQD6sHac7/JTOtjepbHEuZ7hG6AzXCbirlxWuFgsUgBTQe5LnVv2jdiqCqZ0ALh3FsT nm3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zuU348vMM9aXraE4ccy+eAHv0CShi7BKwdNOAqDmvDI=; b=YTgqQx42OYTMchr19sVhZJS1bYMlEGc5bCRuc0GpOtMVTpjYIH2SjxgayFGDFet9DZ oVZDRjFM5HzXnolOc1r0DcCEQsxDC70TahO9ClghOEKqgyu4h4dkpfZY7oN+Uk9I+jlo 2ZOpvQkvvcRgQ96aTKMpnC53KjwvpRd6b7sbayzKUK7kXEbsolYAIQ71gxpfdTC0LkHR rgaSc9Oew4cFo2BXZSVyzCeBMi6aGzIr+tkMiyXd/8/qajO5MB0BknnjqownWDOcESYT fZcecVdxpYoWqgt6JxwrJDwwc/lBNWtShLEb+ngbTkZxEqBPSMkc6SP+ArvKD88JdYAJ 53mw== X-Gm-Message-State: APjAAAXXwAXfvP5Du1oNmUpIGKUVa9V/5DrH7q2WuurMfhTBiO8oZacw KGJCe/mLcMlvYx0iwJsNkcDlbg== X-Received: by 2002:a63:231c:: with SMTP id j28mr13362263pgj.430.1562969399631; Fri, 12 Jul 2019 15:09:59 -0700 (PDT) Received: from bsegall-linux.svl.corp.google.com.localhost ([2620:15c:2cd:202:39d7:98b3:2536:e93f]) by smtp.gmail.com with ESMTPSA id f7sm9398759pfd.43.2019.07.12.15.09.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 15:09:58 -0700 (PDT) From: bsegall@google.com To: Dave Chiluk Cc: Peter Zijlstra , Pqhil Auld , Peter Oskolkov , Ingo Molnar , cgroups@vger.kernel.org, Linux Kernel Mailing List , Brendan Gregg , Kyle Anderson , Gabriel Munos , John Hammond , Cong Wang , Jonathan Corbet , linux-doc@vger.kernel.org, Paul Turner Subject: Re: [PATCH v5 1/1] sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices References: <1558121424-2914-1-git-send-email-chiluk+linux@indeed.com> <1561664970-1555-1-git-send-email-chiluk+linux@indeed.com> <1561664970-1555-2-git-send-email-chiluk+linux@indeed.com> <20190711095102.GX3402@hirez.programming.kicks-ass.net> Date: Fri, 12 Jul 2019 15:09:57 -0700 In-Reply-To: (Dave Chiluk's message of "Thu, 11 Jul 2019 18:48:24 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Chiluk writes: > So I spent some more time testing this new patch as is *(interrupts disabled). I know I probably should have fixed the patch, but it's hard to get time on big test hardware sometimes, and I was already well along my way with testing. > > In regards to the quota usage overage I was seeing earlier: I have a theory as to what might be happening here, and I'm pretty sure it's related to the IRQs being disabled during the rq->lock walk. I think that the main fast thread was able to use an excess amount > of quota because the timer interrupt meant to stop it wasn't being handled timely due to the interrupts being disabled. On my 8 core machine this resulted in a what looked like simply improved usage of the quota, but when I ran the test on an 80 core machine I > saw a massive overage of cpu usage when running fibtest. Specifically when running fibtest for 5 seconds with 50ms quota/100ms period expecting ~2500ms of quota usage; I got 3731 ms of cpu usage which was an unexpected overage of 1231ms. Is that a > reasonable theory? I think I've figured out what's going on here (and a related issue that gave me some inconsistency when trying to debug it): other "slow" threads can wake up while the slack timer is in distribute and double-spend some runtime. Since we lsub_positive rather than allow cfs_b->runtime to be negative this double-spending is permanent, and can go on indefinitely. In addition, if things fall out in a slightly different way, all the "slow" threads can wind up getting on cpu and claiming slices of runtime before the "fast" thread, and then it just has to wait another slack period to hope that the ordering winds up better that time. This just depends on things like IPI latency and maybe what order things happened to happen at the start of the period. Ugh. Maybe we /do/ just give up and say that most people don't seem to be using cfs_b in a way that expiration of the leftover 1ms matters.