Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3166987imu; Sun, 27 Jan 2019 23:22:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5f3P55RBPNMAO4Dmk/60So22XT6GafzlFBY7iK2+iGQHgu/d1ErisjqbGs9qffML/QOMLS X-Received: by 2002:a17:902:aa82:: with SMTP id d2mr20791058plr.153.1548660123370; Sun, 27 Jan 2019 23:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548660123; cv=none; d=google.com; s=arc-20160816; b=UzGqOg21btTb8k1OfplW1LqIHcEemJza+k5XFuYnrvt9d0JAC3HqddUYiSuHm1x34W MWqZ8ujKNDDDrUq+Z3oIRPdzuTBzjbg7F3TWrYQPMGYjaEIec9M6wk2NT1gQkqEdfYa+ kyzugORkM062FK/r/P25EIwdhJXsxxkE5jsNXv5x7skZm86cQN24GwQrOd7ALRcyp6LX Gb4pirJgqIRKq8lw+gmR0rmRY9muGo15v0xALgHTVR+aTL0MpQEWDktNC/92rtiifYRR rIu0zTNHqIwZLCWSqa2YFf0vXOWBbAePxr1rrsNEnp/6Rg3Q/WBOhG0JT359wJpcKpcA uUAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HX9DrjaX6jIlcMNKOK6cpFkCuRAnrM2CggdxTNRpSqA=; b=DcTx9BWpD+ZPfZf5wJQhPrkzU65maOg3Hd4jSD7+cArrnPDCH0UyLneNM02Yic4+bc UovQ+btCPsUb/WsmO5Grc9WoSwnffTsXjt0cSvChlC3e5B40RWsw2uUCQEKVD3dEvfFI 3DV2TrivrLqHDAlAs84YS+EuF6/en3TnRwygqdnR62AVL4HtUZlMR13EUrHRy9XW50gT WzzdxoZ7F0yYyQ2OGxCzOaeRvrVSg47ANBF0NF48d55Ml+CZD4aI3oxAs1U5gmK7Y0d4 doWkWXpMQVpunbTT/5gISW+N6HHhwYOn9K5bjdhxa0KiPQFnAg7dXr0AZx29/FPyKtIM fHEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MkF4vZ+5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si28463366plk.61.2019.01.27.23.21.48; Sun, 27 Jan 2019 23:22:03 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=MkF4vZ+5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbfA1HVU (ORCPT + 99 others); Mon, 28 Jan 2019 02:21:20 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46961 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbfA1HVU (ORCPT ); Mon, 28 Jan 2019 02:21:20 -0500 Received: by mail-lj1-f193.google.com with SMTP id v15-v6so13244376ljh.13 for ; Sun, 27 Jan 2019 23:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HX9DrjaX6jIlcMNKOK6cpFkCuRAnrM2CggdxTNRpSqA=; b=MkF4vZ+5NAnPAXDOCONNUA0Co9mOXxXPysO0CcNiMaRoKg/O9+PiI3dcL+ohWUUldX gm5t0Blg4glGlu75zgtrhwe5jVZa0e0XZ6HEmtWNWrzx03U1/zVh0uM1wRe1/Pv5DXqz bNvlmUw8p8Ake+sZc3bCfOOMQfrEDpSJFpagJaKOfGWFC2nm718iEXCOOf/bfzR2ebS9 C7cnlWA9zbPQzTyG7rtpwowUqJFiNyj6aukxwIWEHTXsiMMqvaPIaDn/8R4/6LuLHVyg FURZrMoLKzKE3ABa4PVpXaGBkR6upf8PKq/MCU0ImEexBmchxTKLrEsgWiHmoLKBZjtn UokA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HX9DrjaX6jIlcMNKOK6cpFkCuRAnrM2CggdxTNRpSqA=; b=DL1wBIqm5dhRSVB1vS/8Y5j16y48Q+Hou9XJkAXeQuQnMeVjc8223Z/J09cacspTKu 51oRG6kpznumJE5IgqBdGT25/fyCJsus325MVhnpqeYOlJHA3q5WCQ36Is2nhhjMJ7TK xxyg9IJXKRKeNOH4QSHOPN3P1epXk/i7lrzqGk3S+zzNDQNV0ClUhc4gtdp6+JH2rfIx j3F52ZVTy28fNicPgzoX+ufVxJHXg1SNfGrXeIN68awfbwtFRHWzf/kz9KTo0VVJ1eoH QFGHxVpEGmzX+pElBMUOlSQPRvZHBzsHu9KwnKOvuKSgKzxITVeGL0gkZvb9hRWyNywa CUpQ== X-Gm-Message-State: AJcUukeVKjW2AmP2g+TNdBUjBGOjrHTu+U87tQafc3xRrTV0abyC9Aby /QWsrrIiVEz3ZrsEpMbaA12vc5ibKk1oit0RcdQ= X-Received: by 2002:a2e:630a:: with SMTP id x10-v6mr16101004ljb.11.1548660077825; Sun, 27 Jan 2019 23:21:17 -0800 (PST) MIME-Version: 1.0 References: <1548236816-18712-1-git-send-email-ufo19890607@gmail.com> <3680160f-a439-02a3-3d40-56de18096c4b@linux.alibaba.com> <6625b261-d199-6b37-de65-1b576dcbad5b@linux.alibaba.com> In-Reply-To: <6625b261-d199-6b37-de65-1b576dcbad5b@linux.alibaba.com> From: =?UTF-8?B?56a56Iif6ZSu?= Date: Mon, 28 Jan 2019 15:21:06 +0800 Message-ID: Subject: Re: [PATCH] sched/debug: Show intergroup and hierarchy sum wait time of a task group To: =?UTF-8?B?546L6LSH?= Cc: mingo@redhat.com, Peter Zijlstra , Wind Yu , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael > Task competition inside a cgroup won't be considered as cgroup's > competition, please try create another cgroup with dead loop on > each CPU Yes, you are right, but I don't think we just need to account for cgroup's competition, because this factor does not reflect cgroup internal conditions. We still need a proper method to evaluate CPU competition inside a cgroup. > Running tasks doesn't means no competition, only if that cgroup occupied > the CPU exclusively at that moment. I care much about CPU competiton inside a cgroup. I can only read '/proc/$pid/schedstat' thousands of times to get every task's wait_sum time without cgroup hierarchy wait_sum, and it definitely tasks a real long time(40ms for 8000 tasks in a container). > No offense but I'm afraid you misunderstand the problem we try to solve > by wait_sum, if your purpose is to have a way to tell whether there are > sufficient CPU inside a container, please try lxcfs + top, if there are > almost no idle and load is high, then the CPU resource is not sufficient. emmmm... Maybe I didn't make it clear. We need to dynamically adjust the number of CPUs for a container based on the running state of tasks inside the container. If we find tasks' wait_sum are really high, we will add more CPU cores to this container, or else we will decline some CPU to this container. In a word, we want to ensure 'co-scheduling' for high priority containers. >Frankly speaking this sounds like a supplement rather than a missing piece, >although we don't rely on lxcfs and modify the kernel ourselves to support >container environment, I still don't think such kind of solutions should be >in kernel. I don't care if this value is considered as a supplement or a missing piece. I only care about how can I assess the running state inside a container. I think lxcfs is really a good solution to improve the visibility of container resources, but it is not good enough at the moment. /proc/cpuinfo /proc/diskstats /proc/meminfo /proc/stat /proc/swaps /proc/uptime we can read this procfs file inside a container,but this file still cannot reflect real-time information. Please think about the following scenario: a 'rabbit' process will generate 2000 tasks in every 30ms, and these children tasks just run 1~5ms and then exit. How can we detect this thrashing workload without hierarchy wait_sum? Thanks, Yuzhoujian