Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp430325ybz; Wed, 15 Apr 2020 11:26:10 -0700 (PDT) X-Google-Smtp-Source: APiQypK/2xJIElDRYnHYlofqFtGm94Q634zkiImaBA5q9vK19uqCTdwNR6KSI18Jrk+9YPHpn8q+ X-Received: by 2002:a50:8b41:: with SMTP id l59mr25842457edl.44.1586975170744; Wed, 15 Apr 2020 11:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586975170; cv=none; d=google.com; s=arc-20160816; b=bMD0yU5WXHgjLTdJdEoegRFxaKUPJ3Pse46aSaFOXVve1ywqX8pgv7jIS5rePN/J1G 6CXWGtxIW4PrITgrHy2rFIWB/LnJbvWZb+ttJSXREelCPMIB3vKC2AFVTZ3iYlB/7onu bb4KPnoP1sA7R7bDAHhTXMidmpEn12g44AaPUFmtyhq+MGwiRCYf4aBSIySM+TOPxxSY LxIXJbp8xJCdRExEhCDJI6wLbmYweat7P5jOWyRhs7SP+FTVqSxpTpgyIpfwoXdWdfcu UamGf9JGnEowfZ6w78qUGLN7mr7J6HYEDBgq/3K5TuHwD+ns47ZniYEBAPp1JAg7hyV3 8y5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zRbIhkRTth0h/We8PXb627DVJp3T2IM7e0L6aaERpUc=; b=0XLPfZ61fDT8jWF0bM6HdegC2zy1pyqZjxiIzb8PIBnVsatetzUPjeyCIeVgfK+EuV p05SEVF4ofJ0Av2DHJkiFFn3Txd3gmx0bnrhGQubyh0n+mOULFqESka/z1jaaBn5DMoz gYevyBwbZ6Pnz/i0OioGuWnCvC51FJHk8PEuphYmnwECpeTM/ogKf5iblqvsRuXYxRcT dzFskdDqsolPqTWvfFMfDzFsDzmS1tIBvAw39SaIjWmURBem60bVRqKzBRAcgTNKRBhO qajjYvSjfcWaOwCKMvB4y0dhn8j4IBq509akL3os2U0AHyD6uv+lIixOF5pItGmNVH9O FlBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kYEogDVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si11240130edm.185.2020.04.15.11.25.46; Wed, 15 Apr 2020 11:26:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kYEogDVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438116AbgDNKGU (ORCPT + 99 others); Tue, 14 Apr 2020 06:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2438097AbgDNKGR (ORCPT ); Tue, 14 Apr 2020 06:06:17 -0400 X-Greylist: delayed 2360 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 14 Apr 2020 03:06:16 PDT Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD93AC061A0C for ; Tue, 14 Apr 2020 03:06:16 -0700 (PDT) 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; bh=zRbIhkRTth0h/We8PXb627DVJp3T2IM7e0L6aaERpUc=; b=kYEogDVdl6bmOzX4nQkttpVVB5 84XOkDu3cl4CQ8p4NYCdZbDaglqAbjjU20apeP4fcp+hdRwBUSeQNdbpcm/+QfZSWPUfSKXf2by7W Nmh7kXjLlO/KSMXDgBxn7BrBmVpnaGuPS/1FeJdH4mPtY0XyDsERlSIs0LgNDV5arcAj68DMNTtUV txfyLgHN5YUNMTcOy1YJ1ryh7V+GYNf3pf4yaIJX9WJQ3fC20l+4IxozIQLI8wFoba27sUyUxO6jI 6ZUa1Ler7eZ8PCg8glPW1N1iexhkQoAlyAhknzr514hS88GXm+bipOGJom0YWCM3MOklTqWCUxuVV dOaBaGHQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOIS6-0000Cp-RY; Tue, 14 Apr 2020 10:05:59 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CF59E3012D8; Tue, 14 Apr 2020 12:05:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 97BA020B07BF9; Tue, 14 Apr 2020 12:05:55 +0200 (CEST) Date: Tue, 14 Apr 2020 12:05:55 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Wang Qing , Catalin Marinas , Will Deacon , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , James Morse , Mark Rutland , "Eric W. Biederman" , Thomas Gleixner , jinho lim , Dave Martin , LAK , linux-kernel , opensource.kernel@vivo.com Subject: Re: [PATCH 1/2] [V2 1/2]sched:add task_running_oncpu Message-ID: <20200414100555.GJ20713@hirez.programming.kicks-ass.net> References: <1586779466-4439-1-git-send-email-wangqing@vivo.com> <1586779466-4439-2-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 09:20:57AM +0200, Vincent Guittot wrote: > On Mon, 13 Apr 2020 at 14:04, Wang Qing wrote: > > > > We have no interface whether the task is running, > > so we need to add an interface and distinguish CONFIG_SMP. > > > > Signed-off-by: Wang Qing > > --- > > include/linux/sched.h | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 4418f5c..13cc8f5 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1843,6 +1843,11 @@ static inline unsigned int task_cpu(const struct task_struct *p) > > > > extern void set_task_cpu(struct task_struct *p, unsigned int cpu); > > > > +static inline int task_running_oncpu(const struct task_struct *p) > > This function name is too close from task_running_on_cpu() and can be > misleading as the difference is only "_" > Also, how task_running_oncpu() is different from task_running() ? It doesn't have the (arguably superfluous) rq argument. But yes, agreed, if anything lift that thing (without the argument).