Received: by 10.192.165.148 with SMTP id m20csp5328032imm; Wed, 9 May 2018 03:17:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZobGtA5/Qsy6Fyr2c43GxwbzvesSuDsHRq5hnJounD0XIOhXLedWFNntBFKo/69yNt8e8bt X-Received: by 2002:a63:7159:: with SMTP id b25-v6mr916485pgn.194.1525861029793; Wed, 09 May 2018 03:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525861029; cv=none; d=google.com; s=arc-20160816; b=oMOFoAveDJ70s54tzx6idJ1y79qAuTlzpev4ePDmtoelLevrfJHI0C2WQ8n08p9cH9 QUPVZgsyjihZKiaEQkpi6zHHWYe2U/z+y/sriHBJIJ1OjPgk3FV3ihSdnRTbO8JLYNOA T4UQzq/BVNAF/cwlkAztVayZQH0ivVj8Cl7ibc3yGUiFHKe5QUyHGOk7ZgTQUcxejvMa WJqhQkXzqVa+eQfWLIpzvS1JJu1MwXlQH9jA2urjbSDvyFlpPy2+hq1CGBRETRasPwqR 4k8rGReXjvo5BCwhgzUmFdVPgdu9W+VFGKC7tl0c0PlntL4m3HcB40z1Tb/1Sn2xXLkq LSSg== 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=GD8m3WBMV1BgnBZDw7MJQYeGkQPjhAcVEZEsG9vXJsw=; b=zHZ1s4dx7ISPvjI8MMckC6l+xWfx76Msi+dxnkvggPibsq9bOnHR0kY/bP68LtAp+g fCLiYZfTB1Sa+WDCnVV1KAgutqTGbSFjm+ws4YP0i7S2slq8qtACxZ90bmNMqPeTEPSb m7Zs2OqNbmIcXb5STZQZlxdX3eyV5Uiu2YX7rXuxLSfpb+O9ZQdN3/lA/wevtQGPrYxn s9/EHgB/j85Tb042hw3orPdrHIe4g8pFdvBcgt6bk7fiE7SXXm0gCSMyX0x/zEbOUQYh MFaRCXejX5LrX5ZhNNwRjnylI/qjyJ7EyVBE+eOeEfAPGIb9ITyJN0motuO7FnvkYfzO /ShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=izp+nAGb; 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 u28si17535191pfl.143.2018.05.09.03.16.55; Wed, 09 May 2018 03:17:09 -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=@infradead.org header.s=bombadil.20170209 header.b=izp+nAGb; 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 S934023AbeEIKPG (ORCPT + 99 others); Wed, 9 May 2018 06:15:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33574 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753339AbeEIKPE (ORCPT ); Wed, 9 May 2018 06:15:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=GD8m3WBMV1BgnBZDw7MJQYeGkQPjhAcVEZEsG9vXJsw=; b=izp+nAGbQh25/3K3eZgH3O80l CjQcWE1Z6QAXNUGfxvY/x7tMKWGSIFQO/4RmkBjCIBsfV5ZvYPELLd4jEbt6uZvYPI8jKuVl10Hs2 sSa8jJIURksQmQ/Z8vIW63vOQBUGlZ0F0IFzT5TRIfF5llyP6pnnRTn6rTYFth3Xu+NOsuy6vax2Y 3G7oYn7gpq3gbjOMqQ1LqbGuvZtRCVu3YwT8cj8JcgzjkbyofkcLFP0AX5CsHsF3qTVNq2tWmL2oQ nmW1mzWGQQuWO+dfrYSTn4BWfURYFTRVulS75PyakJtgOwxj2LvFLVsUfhSlQYRVHO/GWJFygPzSy k2KX3AC/A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGM7c-00067Q-Dl; Wed, 09 May 2018 10:14:56 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DF75C2029FA13; Wed, 9 May 2018 12:14:54 +0200 (CEST) Date: Wed, 9 May 2018 12:14:54 +0200 From: Peter Zijlstra To: Johannes Weiner 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: <20180509101454.GM12217@hirez.programming.kicks-ass.net> References: <20180507210135.1823-1-hannes@cmpxchg.org> <20180507210135.1823-7-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180507210135.1823-7-hannes@cmpxchg.org> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 15750c222ca2..1658477466d5 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -919,6 +921,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); > #define cpu_curr(cpu) (cpu_rq(cpu)->curr) > #define raw_rq() raw_cpu_ptr(&runqueues) > > +extern void update_rq_clock(struct rq *rq); > + > static inline u64 __rq_clock_broken(struct rq *rq) > { > return READ_ONCE(rq->clock); > @@ -1037,6 +1041,86 @@ static inline void rq_repin_lock(struct rq *rq, struct rq_flags *rf) > #endif > } > > +struct rq *__task_rq_lock(struct task_struct *p, struct rq_flags *rf) > + __acquires(rq->lock); > + > +struct rq *task_rq_lock(struct task_struct *p, struct rq_flags *rf) > + __acquires(p->pi_lock) > + __acquires(rq->lock); > + > +static inline void __task_rq_unlock(struct rq *rq, struct rq_flags *rf) > + __releases(rq->lock) > +{ > + rq_unpin_lock(rq, rf); > + raw_spin_unlock(&rq->lock); > +} > + > +static inline void > +task_rq_unlock(struct rq *rq, struct task_struct *p, struct rq_flags *rf) > + __releases(rq->lock) > + __releases(p->pi_lock) > +{ > + rq_unpin_lock(rq, rf); > + raw_spin_unlock(&rq->lock); > + raw_spin_unlock_irqrestore(&p->pi_lock, rf->flags); > +} > + > +static inline void > +rq_lock_irqsave(struct rq *rq, struct rq_flags *rf) > + __acquires(rq->lock) > +{ > + raw_spin_lock_irqsave(&rq->lock, rf->flags); > + rq_pin_lock(rq, rf); > +} > + > +static inline void > +rq_lock_irq(struct rq *rq, struct rq_flags *rf) > + __acquires(rq->lock) > +{ > + raw_spin_lock_irq(&rq->lock); > + rq_pin_lock(rq, rf); > +} > + > +static inline void > +rq_lock(struct rq *rq, struct rq_flags *rf) > + __acquires(rq->lock) > +{ > + raw_spin_lock(&rq->lock); > + rq_pin_lock(rq, rf); > +} > + > +static inline void > +rq_relock(struct rq *rq, struct rq_flags *rf) > + __acquires(rq->lock) > +{ > + raw_spin_lock(&rq->lock); > + rq_repin_lock(rq, rf); > +} > + > +static inline void > +rq_unlock_irqrestore(struct rq *rq, struct rq_flags *rf) > + __releases(rq->lock) > +{ > + rq_unpin_lock(rq, rf); > + raw_spin_unlock_irqrestore(&rq->lock, rf->flags); > +} > + > +static inline void > +rq_unlock_irq(struct rq *rq, struct rq_flags *rf) > + __releases(rq->lock) > +{ > + rq_unpin_lock(rq, rf); > + raw_spin_unlock_irq(&rq->lock); > +} > + > +static inline void > +rq_unlock(struct rq *rq, struct rq_flags *rf) > + __releases(rq->lock) > +{ > + rq_unpin_lock(rq, rf); > + raw_spin_unlock(&rq->lock); > +} > + > #ifdef CONFIG_NUMA > enum numa_topology_type { > NUMA_DIRECT, > @@ -1670,8 +1754,6 @@ static inline void sub_nr_running(struct rq *rq, unsigned count) > sched_update_tick_dependency(rq); > } > > -extern void update_rq_clock(struct rq *rq); > - > extern void activate_task(struct rq *rq, struct task_struct *p, int flags); > extern void deactivate_task(struct rq *rq, struct task_struct *p, int flags); > > @@ -1752,86 +1834,6 @@ static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta) { } > static inline void sched_avg_update(struct rq *rq) { } > #endif > > -struct rq *__task_rq_lock(struct task_struct *p, struct rq_flags *rf) > - __acquires(rq->lock); > - > -struct rq *task_rq_lock(struct task_struct *p, struct rq_flags *rf) > - __acquires(p->pi_lock) > - __acquires(rq->lock); > - > -static inline void __task_rq_unlock(struct rq *rq, struct rq_flags *rf) > - __releases(rq->lock) > -{ > - rq_unpin_lock(rq, rf); > - raw_spin_unlock(&rq->lock); > -} > - > -static inline void > -task_rq_unlock(struct rq *rq, struct task_struct *p, struct rq_flags *rf) > - __releases(rq->lock) > - __releases(p->pi_lock) > -{ > - rq_unpin_lock(rq, rf); > - raw_spin_unlock(&rq->lock); > - raw_spin_unlock_irqrestore(&p->pi_lock, rf->flags); > -} > - > -static inline void > -rq_lock_irqsave(struct rq *rq, struct rq_flags *rf) > - __acquires(rq->lock) > -{ > - raw_spin_lock_irqsave(&rq->lock, rf->flags); > - rq_pin_lock(rq, rf); > -} > - > -static inline void > -rq_lock_irq(struct rq *rq, struct rq_flags *rf) > - __acquires(rq->lock) > -{ > - raw_spin_lock_irq(&rq->lock); > - rq_pin_lock(rq, rf); > -} > - > -static inline void > -rq_lock(struct rq *rq, struct rq_flags *rf) > - __acquires(rq->lock) > -{ > - raw_spin_lock(&rq->lock); > - rq_pin_lock(rq, rf); > -} > - > -static inline void > -rq_relock(struct rq *rq, struct rq_flags *rf) > - __acquires(rq->lock) > -{ > - raw_spin_lock(&rq->lock); > - rq_repin_lock(rq, rf); > -} > - > -static inline void > -rq_unlock_irqrestore(struct rq *rq, struct rq_flags *rf) > - __releases(rq->lock) > -{ > - rq_unpin_lock(rq, rf); > - raw_spin_unlock_irqrestore(&rq->lock, rf->flags); > -} > - > -static inline void > -rq_unlock_irq(struct rq *rq, struct rq_flags *rf) > - __releases(rq->lock) > -{ > - rq_unpin_lock(rq, rf); > - raw_spin_unlock_irq(&rq->lock); > -} > - > -static inline void > -rq_unlock(struct rq *rq, struct rq_flags *rf) > - __releases(rq->lock) > -{ > - rq_unpin_lock(rq, rf); > - raw_spin_unlock(&rq->lock); > -} > - > #ifdef CONFIG_SMP > #ifdef CONFIG_PREEMPT > What's all this churn about?