Received: by 10.192.165.148 with SMTP id m20csp1216336imm; Thu, 10 May 2018 07:23:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQ8T10Fr4xKe7V069WUVkXP2wnaJprb4eEXw6R7OKVOx0NdDOBwKdd3zun36NtdPlaE9ih X-Received: by 2002:a62:f24a:: with SMTP id y10-v6mr1608291pfl.75.1525962219221; Thu, 10 May 2018 07:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525962219; cv=none; d=google.com; s=arc-20160816; b=Ia8Ycg5SHT29AtlKWRk42Y7YOzQ2Z8uMXIjqe/c/+CNOZh+zVTM8CPdZtkpOn3VZIh JHyUR4umbwLavjMhAULuiSzX4h6VkzLKCWqe4TOWO6jWVVV0m+UU4MGUA3SFEIQ2pttD t0sjfoVuWQyPJBirubLgtmd8kYOKtgWyxe3PffyRQF/jmwyAwOcB0dGe7mk6fgsbuHOr sSq3uUVylJZoLNcXIEwkTi01TMBclHbFM4YucRdSW+9MRKAG4go51xnHOxvaZsh7hYGG XiZSHyzcif2B7hwE1SYHsmUc5WPaSiyj5OBLzpG/JS3ULtFaqMieIH9xMkbQMbS9U6cZ vkGg== 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=VX6n6xNfzLtisMenr8eEvDlnrRFHvzpXhjbw0g+8Rpo=; b=EVNJjR0wPWj7C/YUKrbUvpwzzAockxOAEN1pBdGwsPh/KONo6lt2ZWwzlv7nfVSEOR hEQWNHI5E38JxphF1JpnFQUawheuxHhCVaGrBelFW5LoVR+NOfJV4vGzUFcpAdX+IlOD dTX8BarV8IuUi1DjrYjnhwK6SyqYbnukwhLTE3XnQSERCKnX+Z7rI5p7o8azcgJf2vpG NPMO4tGcS/jHGzyr+elEG+wIyXTmwmzFNjJSjHMTILL82DpzySIVENY043R28OWVaQkX 9s6HQKMMzoVrjDnJw8L9NABsdY95ASON1lbkkKCiV+lus4wykmV/JewzOK6/FHJW9wlZ d2Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=VcTK3cfk; 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 d37-v6si920289plb.125.2018.05.10.07.23.24; Thu, 10 May 2018 07:23:39 -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=VcTK3cfk; 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 S965919AbeEJOWw (ORCPT + 99 others); Thu, 10 May 2018 10:22:52 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:50242 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965078AbeEJOWv (ORCPT ); Thu, 10 May 2018 10:22:51 -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=VX6n6xNfzLtisMenr8eEvDlnrRFHvzpXhjbw0g+8Rpo=; b=VcTK3cfk8yOGUGI3zEw6tfCdPv eOTcAmhbjWgzJqrYadSjp8ej4N3H2xDUQuyaVbZimlh9I9kBhjSr+BNSiu6TH1mBqAlotZfTuIDmH sbjG3pCQJ4TkQMTU6qXDZ+Hnq7GjKAeOxR0HORYFaep3KhP+YYAEDrpx8YRVqBI0JHe8=; Date: Thu, 10 May 2018 10:24:42 -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: <20180510142442.GG19348@cmpxchg.org> References: <20180507210135.1823-1-hannes@cmpxchg.org> <20180507210135.1823-7-hannes@cmpxchg.org> <20180509102100.GN12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509102100.GN12217@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 12:21:00PM +0200, Peter Zijlstra wrote: > On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > > + local_irq_disable(); > > + rq = this_rq(); > > + raw_spin_lock(&rq->lock); > > + rq_pin_lock(rq, &rf); > > Given that churn in sched.h, you seen rq_lock() and friends. > > Either write this like: > > local_irq_disable(); > rq = this_rq(); > rq_lock(rq, &rf); > > Or instroduce "rq = this_rq_lock_irq()", which we could also use in > do_sched_yield(). Sounds good, I'll add that. > > + update_rq_clock(rq); > > + > > + current->flags |= PF_MEMSTALL; > > + psi_task_change(current, rq_clock(rq), 0, TSK_MEMSTALL); > > + > > + rq_unpin_lock(rq, &rf); > > + raw_spin_unlock(&rq->lock); > > + local_irq_enable(); > > That's called rq_unlock_irq(). I'll use that. This code was first written against a kernel that didn't have 8a8c69c32778 ("sched/core: Add rq->lock wrappers.") yet ;)