Received: by 10.192.165.148 with SMTP id m20csp1171941imm; Thu, 10 May 2018 06:48:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqXLRA9KX3e5zrgeJ9dF2F3R3s96k6DCPU66r+neDuX0ZYiVNFNuK2PfZ9ta0U/g2hoEUNT X-Received: by 2002:a17:902:7402:: with SMTP id g2-v6mr1525479pll.246.1525960112746; Thu, 10 May 2018 06:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525960112; cv=none; d=google.com; s=arc-20160816; b=gE9zDruWOuB8S5d5eLyXOOKFmsLXgWqbH2QhOAG6Ua7epBHv/TUtt9TuPaKsfiR63r kc1DU23zbNQbgPvJfHWcpy5b7jAl0eLDfT2gsMLgfOzlu8DWdlS2r1mGdspZLeSyJsi5 6HnhY82Yu2N0xRcddPc/2EozQQMTue0xNwuwyA29Ir01c6OKuMugz+iF7vhue1Wh3JYX YTSGLgY+HjTnj7io6uyyunzAzTHnrd/tbPGkXcUzBTof5eV1PH7ibMaNF5RcloJOD0Px V1XyQ9dcQQ+3CT9+00ltijxlnNWiukVvRf65cKC7iZ+9z8Mf3F0YY67fZgz74zKVTBvk hkjA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=4lsoxFs+pd53NNgClfE9xRSoYmLqHB2ZQxj5rYKhiv8=; b=EVrOILhWoDRMtAd1VVY+UDNv5nBkGB0JMajmkqJGD3yc1iJChEfh4xPpHJjVf/TDqo uj9yJ3hjGD50j7Ba8mgpTUBccOw8e+Tr0bLrm8l2KicmbCJDutrtib/mAbcn3iGU+D0O xC+oyfufz1J18QKLfCFF9/V3dmAsBfFYem9Xco7g3g+7NirgKEyyhrECQCSrFzjARydV 0onjo0Sey28y+i9ANw2+6ufCTWBVwj66KNcsAz4xyM+ine3yY7egR44AaWz52ucKLwno trw8Y5b5LzyOcg7h0ZmhNhdWAki4TiNqIITUxg5otk1hbONFVxYYDmQAYiIuHKI9AN2G iKlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=wrZSZBBE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33-v6si774714plb.380.2018.05.10.06.48.17; Thu, 10 May 2018 06:48:32 -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=fail header.i=@cmpxchg.org header.s=x header.b=wrZSZBBE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757311AbeEJNrn (ORCPT + 99 others); Thu, 10 May 2018 09:47:43 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:50134 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757098AbeEJNr3 (ORCPT ); Thu, 10 May 2018 09:47:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4lsoxFs+pd53NNgClfE9xRSoYmLqHB2ZQxj5rYKhiv8=; b=wrZSZBBEMaOiXOuIVQ05e0JqDM UnQ7C1cfuQSufhtsUnBybOPCn13XEY5FMymA2PSgpr1tX6JZxOZv7eMbnfOwlG0a09hDMzNkEQcsJ EP8qHnVVTaFj7b/+okh9GiFJt+I1CWbk0r72ExJ3YsaPpctd2+avVnqvQ9jTs1yR+77A=; Date: Thu, 10 May 2018 09:49:21 -0400 From: Johannes Weiner To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, cgroups@vger.kernel.org, Ingo Molnar , Andrew Morton , Tejun Heo , Balbir Singh , Mike Galbraith , Oliver Yang , Shakeel Butt , xxx xxx , Taras Kondratiuk , Daniel Walker , Vinayak Menon , Ruslan Ruslichenko , kernel-team@fb.com Subject: Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO Message-ID: <20180510134921.GC19348@cmpxchg.org> References: <20180507210135.1823-1-hannes@cmpxchg.org> <20180507210135.1823-7-hannes@cmpxchg.org> <20180509095938.GJ12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509095938.GJ12217@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 11:59:38AM +0200, Peter Zijlstra wrote: > On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > > diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h > > new file mode 100644 > > index 000000000000..b22b0ffc729d > > --- /dev/null > > +++ b/include/linux/psi_types.h > > @@ -0,0 +1,84 @@ > > +#ifndef _LINUX_PSI_TYPES_H > > +#define _LINUX_PSI_TYPES_H > > + > > +#include > > + > > +#ifdef CONFIG_PSI > > + > > +/* Tracked task states */ > > +enum psi_task_count { > > + NR_RUNNING, > > + NR_IOWAIT, > > + NR_MEMSTALL, > > + NR_PSI_TASK_COUNTS, > > +}; > > + > > +/* Task state bitmasks */ > > +#define TSK_RUNNING (1 << NR_RUNNING) > > +#define TSK_IOWAIT (1 << NR_IOWAIT) > > +#define TSK_MEMSTALL (1 << NR_MEMSTALL) > > + > > +/* Resources that workloads could be stalled on */ > > +enum psi_res { > > + PSI_CPU, > > + PSI_MEM, > > + PSI_IO, > > + NR_PSI_RESOURCES, > > +}; > > + > > +/* Pressure states for a group of tasks */ > > +enum psi_state { > > + PSI_NONE, /* No stalled tasks */ > > + PSI_SOME, /* Stalled tasks & working tasks */ > > + PSI_FULL, /* Stalled tasks & no working tasks */ > > + NR_PSI_STATES, > > +}; > > + > > +struct psi_resource { > > + /* Current pressure state for this resource */ > > + enum psi_state state; > > + > > + /* Start of current state (cpu_clock) */ > > + u64 state_start; > > + > > + /* Time sampling buckets for pressure states (ns) */ > > + u64 times[NR_PSI_STATES - 1]; > > Fails to explain why no FULL. It's NONE that's excluded. I'll add a comment. > > +struct psi_group_cpu { > > + /* States of the tasks belonging to this group */ > > + unsigned int tasks[NR_PSI_TASK_COUNTS]; > > + > > AFAICT there's a hole here, that would fit the @nonidle member. Which > also avoids the later hole generated by it. Good spot, I'll reshuffle this accordingly. > > + /* Per-resource pressure tracking in this group */ > > + struct psi_resource res[NR_PSI_RESOURCES]; > > + > > + /* There are runnable or D-state tasks */ > > + bool nonidle; > > Mandatory complaint about using _Bool in composites goes here. int it is. Thanks