From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06750C2BA19 for ; Tue, 14 Apr 2020 10:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D49BE2072D for ; Tue, 14 Apr 2020 10:06:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kYEogDVd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438120AbgDNKGW (ORCPT ); Tue, 14 Apr 2020 06:06:22 -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). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48105C2BB86 for ; Tue, 14 Apr 2020 10:06:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B9CF2075E for ; Tue, 14 Apr 2020 10:06:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VJPoQ7No" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B9CF2075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MhXOnMGugvhfY0IHia/TC1zUdW0LCfsJ/rBCAmmKIOM=; b=VJPoQ7NoehA/B8 zxCdTIOj4Nxy2HnvdVKGm4ZyS2vqEJTJnoXMBkWy9Lwo+GQkUD3pLTvEnOaBgvpdd4xwcLrcu+m+D TrcmIHE+6EefJb+g6y6pBQcESQxplj/pQ9osDfo5gc51wNg4WG39xqeqHQe4C4qpWoxJnOjpy24p3 oLhC2v9nnG5bYHXGhI/oMZdQcbd9rBzTXtWcEclxmGXbKG/tnqYRoI13ixlQQtnqXQK5Fou+AJqdO mJUcA8BYCrPCCskBoUU6xzbjxDd8ByI7E8vJjPFcLFLkDOEnbrWqeRlSW4GCDlNABGT80dIEXgGyo ig2dlwbikzzVbRMpv/xg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOISB-0000Eb-Qr; Tue, 14 Apr 2020 10:06:03 +0000 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 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-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Ben Segall , Thomas Gleixner , opensource.kernel@vivo.com, Catalin Marinas , linux-kernel , Steven Rostedt , Dave Martin , Wang Qing , jinho lim , Ingo Molnar , James Morse , Mel Gorman , Mark Rutland , Will Deacon , Dietmar Eggemann , LAK , "Eric W. Biederman" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel