Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4340481pxj; Wed, 12 May 2021 03:32:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGPPjgf1Pm558Y/Y1jJK8OU16Asfgj3rS80aaVy1C4b33hYCfp90gp70UftAY0N0HujcGE X-Received: by 2002:a02:ceb5:: with SMTP id z21mr31920950jaq.72.1620815552555; Wed, 12 May 2021 03:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620815552; cv=none; d=google.com; s=arc-20160816; b=PT+s02NO/BZ/d7JAg7OiEzAi4hvF8A4gOsR2jF9pkUiX8FPrOWQ72DNsIDFZujx1Fw U2IS4W3DbiA+IiWtrP43oMkPwoAXcG2OWlnkPlpl6MZhDwA2drL2/0uOhIazIkxbf7fD MswS5SuLMFkGlZWhVN3pCkAvixmVymwJRybMrqZ1CxkiWIznwvYrbBaEKTagBlhRgDKK HzQRgeOivLZ6Vv0go+6UsTUC/2s6Q5a/ol8YNKRkZnrTzh2BBKm7+PJ1cK9LCIzfBI9t vIBxJuV4ILk94yYkat7T5pB+/YrWBbl6pm2yhKbLAH8s6Y6PfqL8IlhQwVcfZYZqzcQh bKCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=ROj/MIT/eu3/TkvR6Y3ds+CV+uoi/1jboacWObQXHXU=; b=clL3lwWsjtrtQWtZS/QsVsMC4g8rI+meWxvBp438e6tpffIIDnn2qrWcEv4jDpJl9P I62nxq/NeuL391lSJrSvfKGrpXCiS5drI7UECrCkdPlU2MwPFvmDxCN6EHiRiShHfSsY TW6DTMc80/s0rdF0BTjVN87D+kh65ut8YuujE0HX1UI8JWo6fchheCVe4Vj27OuTA9N7 T3FenO1K43OYwi7MSQiCHaI5f09beRR/sBCfXKdVsUOXj1N4UlK7GdqHPmGwisC4latb 3mHyoV8HoonNsLy+g6fqDF68V/Yr2rFlN7eSkiL0uHhKyepASw/SYXRDrT7kcg5fg8Yq bdLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KkBaRwSX; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si30309521ilu.8.2021.05.12.03.32.12; Wed, 12 May 2021 03:32:32 -0700 (PDT) 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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KkBaRwSX; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbhELKbF (ORCPT + 99 others); Wed, 12 May 2021 06:31:05 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50576 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230435AbhELK3k (ORCPT ); Wed, 12 May 2021 06:29:40 -0400 Date: Wed, 12 May 2021 10:28:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620815311; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ROj/MIT/eu3/TkvR6Y3ds+CV+uoi/1jboacWObQXHXU=; b=KkBaRwSXPIUt9G2RoAlxuE/9z0UtsTXVTaAchVSvKCfkLt4ssZmlkggHr36H7C/Utj6Ymg ii+YYOeCQTVbcfIeK4BFCDnmrW/pekS27tmjwhehLs7/d5mBaIg2B58J3eREI4URD5O+Fs ZyhGgw55wAN+Qsr+UbUBTFEzmnysu62Ro2bf7ZvOymcJkCeSLl2/8ivL3DzO5lZP8dY2Ai UgcJCREhye3fYXr3da2DC+93rMngCELUc1sT9Rq7gP6+dYdqVVDiUkjOEPRbtPju8h52OB 33t2+7aMcZ5aptBiuNEWsc98Tqvzs1ojkmQTk83R/oDV8swTgZEH6uk5zN/Q7g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620815311; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ROj/MIT/eu3/TkvR6Y3ds+CV+uoi/1jboacWObQXHXU=; b=XUDHEQTXA1iayjKCl6tBA3Tj9fvPuK6cM70L+GwBWMMTe6uaLytedcpEH+DoiHTGdxsu9E cixFgBv1BusAVjCA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] delayacct: Use sched_clock() Cc: "Peter Zijlstra (Intel)" , Rik van Riel , Thomas Gleixner , Ingo Molnar , Johannes Weiner , Balbir Singh , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210505111525.001031466@infradead.org> References: <20210505111525.001031466@infradead.org> MIME-Version: 1.0 Message-ID: <162081531128.29796.18316814517076123725.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 4b7a08a0b6e4e910a6feee438d76e426381df0cb Gitweb: https://git.kernel.org/tip/4b7a08a0b6e4e910a6feee438d76e426381df0cb Author: Peter Zijlstra AuthorDate: Tue, 04 May 2021 22:43:48 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 12 May 2021 11:43:23 +02:00 delayacct: Use sched_clock() Like all scheduler statistics, use sched_clock() based time. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rik van Riel Reviewed-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Johannes Weiner Acked-by: Balbir Singh Link: https://lkml.kernel.org/r/20210505111525.001031466@infradead.org --- kernel/delayacct.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/kernel/delayacct.c b/kernel/delayacct.c index 2772575..3fe7cd5 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -42,10 +42,9 @@ void __delayacct_tsk_init(struct task_struct *tsk) * Finish delay accounting for a statistic using its timestamps (@start), * accumalator (@total) and @count */ -static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total, - u32 *count) +static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total, u32 *count) { - s64 ns = ktime_get_ns() - *start; + s64 ns = local_clock() - *start; unsigned long flags; if (ns > 0) { @@ -58,7 +57,7 @@ static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total, void __delayacct_blkio_start(void) { - current->delays->blkio_start = ktime_get_ns(); + current->delays->blkio_start = local_clock(); } /* @@ -151,21 +150,20 @@ __u64 __delayacct_blkio_ticks(struct task_struct *tsk) void __delayacct_freepages_start(void) { - current->delays->freepages_start = ktime_get_ns(); + current->delays->freepages_start = local_clock(); } void __delayacct_freepages_end(void) { - delayacct_end( - ¤t->delays->lock, - ¤t->delays->freepages_start, - ¤t->delays->freepages_delay, - ¤t->delays->freepages_count); + delayacct_end(¤t->delays->lock, + ¤t->delays->freepages_start, + ¤t->delays->freepages_delay, + ¤t->delays->freepages_count); } void __delayacct_thrashing_start(void) { - current->delays->thrashing_start = ktime_get_ns(); + current->delays->thrashing_start = local_clock(); } void __delayacct_thrashing_end(void)