Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp488843ybd; Wed, 26 Jun 2019 01:28:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyn4Gk5xUnFLyFyOR0YX4ekxD7OX3BjgSTZPfl4FI6lT/I73GSM6tOaTVhqva3ACpmm0NH X-Received: by 2002:a63:c60:: with SMTP id 32mr1798381pgm.42.1561537704151; Wed, 26 Jun 2019 01:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561537704; cv=none; d=google.com; s=arc-20160816; b=gdJzm+O5Uy9kIMXJmoLstQkJHP4AxIbdOfZ3KaWSAMKp4hk9+cZLrXm2/lVFE2ctsn MgmmKD1w2octDKRdgxmwJg2uV3ZtGudJyL8IsdM8aG+qEsIALcPeFgFbata9UzoJgZTi nwn6wD2ZNWxHzjKj11QF6CvlAD69gQfDn96mJ5CjBAb142yXIinWVxzQpd0Ze9Hsa4nY CJN+U4vadYULYyG1RCd+Mgrb0Lf/8tPBN8bxrf0zPVv5XW7A0A6xKRr80mmDgJ/BlpcQ sFNjT13tz/Txk2aAG5E3CU3O8S2ynQmNrx+rDFYHryUXvkAIqxua1R5uHIkQqh+lmBoL o04A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=01jKZhy3vm9Yb5iHq7tsBxn6yHDJepB/Rg5zysBmrYI=; b=oUJj7mpv/wT1EM+GjsoTQ/cHLxRH22HimKKutAsIw6yYLM6JSgv2Xed3M3PASajMXY +L0m/l02ZwsuimcIjd1sPEByNcX6bDTHhgCR4uQ1sRRvI26OylXxL2rrkmWrYzobKZ88 fM3i0fdP0tGYLGeHu6UFXwDAqYe7CR9XcuWgSA4pDimHAjrbaz5TkSVftadTG/17ySd3 QwKuwQmP7z5z3LdotX36dOA2u5zsvJYSQqXTte+l8zbsxZjupzylDv+6fJjfoMpC7TzN aLwLBM985bPEoUPx+WNnLkU1Vi5uJfgFBKe6qWWnvmmCZTa9d0zltTqVDiN/ndxJdmux EuCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si2696886ply.399.2019.06.26.01.28.07; Wed, 26 Jun 2019 01:28:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbfFZI0k convert rfc822-to-8bit (ORCPT + 99 others); Wed, 26 Jun 2019 04:26:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:59974 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725379AbfFZI0k (ORCPT ); Wed, 26 Jun 2019 04:26:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4E699AC2D; Wed, 26 Jun 2019 08:26:39 +0000 (UTC) Date: Wed, 26 Jun 2019 10:26:35 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Song Liu Cc: Morten Rasmussen , Kernel Team , "peterz@infradead.org" , "vincent.guittot@linaro.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "cgroups@vger.kernel.org" , linux-kernel Subject: Re: [PATCH 0/7] introduce cpu.headroom knob to cpu controller Message-ID: <20190626082634.GA22035@blackbody.suse.cz> References: <20190408214539.2705660-1-songliubraving@fb.com> <20190410115907.GE19434@e105550-lin.cambridge.arm.com> <20190521134730.GA12346@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Song and I apology for late reply. I understand the motivation for the headroom attribute is to achieve side load throttling before the CPU is fully saturated since your measurements show that something else gets saturated earlier than CPU and causes grow of the observed latency. The second aspect of the headroom knob, i.e. dynamic partitioning of the CPU resource is IMO something which we already have thanks to cpu.weight. As you wrote, plain cpu.weight of workloads didn't work for you, so I think it'd be worth figuring out what is the resource whose saturation affects the overall observed latency and see if a protection/weights on that resource can be set (or implemented). On Tue, May 21, 2019 at 04:27:02PM +0000, Song Liu wrote: > The overall latency (or wall latency) contains: > > (1) cpu time, which is (a) and (d) in the loop above; How do you measure this CPU time? Does it include time spent in the kernel? (Or can there be anything else unaccounted for in the following calculations?) > (2) time waiting for data, which is (b); Is your assumption of this being constant supported by the measurements? The last note is regarding semantics of the headroom knob, I'm not sure it fits well into the weight^allocation^limit^protection model. It seems to me that it's crafted to satisfy the division to one main workload and side workload, however, the concept doesn't generalize well to arbitrary number of siblings (e.g. two cgroups with same headroom, third with less, who is winning?). HTH, Michal