Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp260299pxb; Wed, 18 Nov 2020 23:50:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIkR+zsCvhcO2Lt7POlpoCyLokfpTURXTswueY2UrEDlVndFoIzZ2GgdkZAwXN6KTIm4kG X-Received: by 2002:a17:906:6b82:: with SMTP id l2mr26592405ejr.241.1605772219195; Wed, 18 Nov 2020 23:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605772219; cv=none; d=google.com; s=arc-20160816; b=pN+dgbqj6l0lajMWzPsJTt67Rwe6OYxjugajQ1jM49USx9/03jl3L0j3KgcSOO427K 7wz5DTR2ZwRTlbn8AxhKvjIRtwaFSVCcK5USWl7h+DmzqcGWtMHm755xro8GXGGzTHST OPGXjybZCSfoEMQoQgKJ6xlGgY4XEu3LKSXrh54kDh2T95KS2Rn2zNdj53xVl3D7l/CY Z3/niV4Ph21btsxP26zetZnFx9I0EeZtCdJ1KrCZULspOderprD4JyInoN1PLQnX7hBR 49Z9W5NeAgWPOv6mL8X7xiU91MJUNOVkRmgLsbdJUQctl2AVbPu4XT7MMLu4JDQhTGV2 DLcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CtHIqfFPw2qYXaUZsINmZ2Sadgyuoq8ILYH6DP4AOvA=; b=Xj8nFRLd4eE036KthQz5zlAMkt2bHgj4yJ6ZsSRWMygBkJ0uwAG4NcAO0Y3xbkqWh4 qpR6QdJSusNbgpJNJFEuku46SMURxqjmLgGktI5jhDaqSVTLFuRsCQzX5vre+b4aRc9J STMc53KdoPlFLTW4OIszTM3cljUgc2YEKVGs7oSzYL5cSkIObtjCAJ0y0KwjCnqN0uHB SjXvBKZeOPuLOVLpIzgzfl7ks40mJFGb0GOFdeLhXMn/E7H0j6I3Qbh71PhoymochB2N rVJBnY+ChLlEI0AGry123IyLU2yu/tqUVRL2FkIVA3Dv+z6x5MIjFn94jUd4q3HdE9eJ Bd/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: 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 a17si16357456ejv.205.2020.11.18.23.49.34; Wed, 18 Nov 2020 23:50:19 -0800 (PST) Received-SPF: pass (google.com: 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; spf=pass (google.com: 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 S1726251AbgKSHpo (ORCPT + 99 others); Thu, 19 Nov 2020 02:45:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:48674 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgKSHpn (ORCPT ); Thu, 19 Nov 2020 02:45:43 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 11F17AD45; Thu, 19 Nov 2020 07:45:42 +0000 (UTC) Date: Thu, 19 Nov 2020 07:45:39 +0000 From: Mel Gorman To: Yafang Shao Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [RFC PATCH 2/4] sched: make schedstats helpers not depend on cfs_rq Message-ID: <20201119074539.GE3306@suse.de> References: <20201119035230.45330-1-laoar.shao@gmail.com> <20201119035230.45330-3-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201119035230.45330-3-laoar.shao@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 11:52:28AM +0800, Yafang Shao wrote: > The 'cfs_rq' in these helpers is only used to get the rq_clock, so we > can pass the rq_clock directly. After that, these helpers can be used by > all sched class. > > Signed-off-by: Yafang Shao This introduces overhead in the general case even when schedstats is disabled. Previously, update_stats_wait_start was a static inline so function call overhead was avoided and schedstat_enabled() meant the overhead was negligible. As it's now a function call, the cost of the function entry/exit will be unconditionally hit regardless of intrest in schedstat. Regardless of the merit of adding schedstats for RT, the overhead of schedstats when stats are disabled should remain the same with the static branch check done in an inline function. -- Mel Gorman SUSE Labs