From patchwork Mon Jun 5 19:16:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 103449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2902241vqr; Mon, 5 Jun 2023 12:17:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Jcu+I9hH47dizsKgfbr8GlLfRBilI1eN2INH//ENW0orNe0bbjcYLiU8Te1Dr0518G7LQ X-Received: by 2002:a05:6a20:7fa2:b0:111:4a86:f70 with SMTP id d34-20020a056a207fa200b001114a860f70mr72246pzj.6.1685992660240; Mon, 05 Jun 2023 12:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685992660; cv=none; d=google.com; s=arc-20160816; b=b712JG09A5zz29nEVFRQ7YItlb5nUx4veoUhXMTh5XWCiTc6p0PiWkZLTyn7k1qkyU 2EZ2gA7z+8fuiVHw1z6/FJrgRf5vRcMspZRt3YV+812gTxdDurMlZb77hdfKR1c9cfPV LvUR35EcfAu+NpnZ5jeY1n7tCU68d32CODoKvcR3H6bk84DSSoAO1jdtuXdPcYPs1T5Y CBXjWXQ12R7+C8bk/3X0eyITMZ1NVryt57+ejQS/Ng6VL2SDY04Qg+nA+49a29RgakZO /hbwQ3wZvViKeFMJUrRs5yJsAyOwsdR6T6Tl/31iXWnrGbCRkK9vUz2CfFYr5LvwOgQt LUyg== 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=Z2cLY1ozMTw4KDVSAVub6jpX7BafSFI8k9ZI7soaBJY=; b=lAk/OGMftlnAUTdEb8T1vObl2l8FM6JNf2rKts+1LrD49OWDyItQq/My/wRJ4B0IOx 6rbE5CbHN+RIxRxI7uQ9YQwXAwqUv5BPRHoRzfxKh+3ZBGrwxDLNCctc21jbW307fyI1 J1qDmBJU6ckhxcOspRM5npUv03yTZdags97CP4ssyFE5q7Fr6HssLYyfko2tggMpCGG9 b8itah+q880HNtVzr7sJ+5B7rqkTa7+u6GDjmhBOTdfK/ZXEEdnQnM4x7NYr60ank46d 9tWI2dbzizcSB37qPoyw8Aa2nR/1xFoRDkBmVndMm/RiFws8c9aoSgSax5HjyaKPs8zS tkJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DBWlsNUw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020a636904000000b00530b7ef148asi5830457pgc.894.2023.06.05.12.17.27; Mon, 05 Jun 2023 12:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DBWlsNUw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235406AbjFETQX (ORCPT + 99 others); Mon, 5 Jun 2023 15:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235297AbjFETQT (ORCPT ); Mon, 5 Jun 2023 15:16:19 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2428DED; Mon, 5 Jun 2023 12:16:18 -0700 (PDT) Date: Mon, 05 Jun 2023 19:16:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685992576; 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=Z2cLY1ozMTw4KDVSAVub6jpX7BafSFI8k9ZI7soaBJY=; b=DBWlsNUwZWkW4ynyACghcZ+XqiumyBWfzJQ75HnKPKMm2nvUkFX/XtlnPKaflxTAzMKwW7 s/hOcmorgJzdAYfkx7Gu4s+PpSJPivBRHJ5VTsPhbkH9MgP0FzFkgGd8FwbV2Ee3HxlVXc G+DDtMJsHlExoqdyP3uPntRuR/LBXM0twXP7Xu8lYD2sINb+mKTINYt1uXcG+mtWoJ4C9J gp+4b7syTjV4ktOFjJ/RMQpTD1X2B8alvrDKIOBc5hpJYGAaphf14wd3quMnEB6AG2dFw9 GmFYsGChPhDOrFWmCf7dj2qt/7+M9DiAkrEtyEw04ZKyn3TnQg7Qh1vxmuwXAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685992576; 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=Z2cLY1ozMTw4KDVSAVub6jpX7BafSFI8k9ZI7soaBJY=; b=e3Zl6FoYoF6kCrsYUNZgoIjdMEwU59aW8cCHyUMei4JhMwT0NHkkqrapofNIGE13nqD3Jf egGpLY/+R+e+ffDw== 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] cpuidle: Use local_clock_noinstr() Cc: "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Michael Kelley , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230519102716.045980863@infradead.org> References: <20230519102716.045980863@infradead.org> MIME-Version: 1.0 Message-ID: <168599257519.404.12817417791147203587.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766318514479871316?= X-GMAIL-MSGID: =?utf-8?q?1767891439665305361?= The following commit has been merged into the sched/core branch of tip: Commit-ID: e6a15fa9ea8372ad4db973191233f743ae1081d5 Gitweb: https://git.kernel.org/tip/e6a15fa9ea8372ad4db973191233f743ae1081d5 Author: Peter Zijlstra AuthorDate: Fri, 19 May 2023 12:21:11 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 05 Jun 2023 21:11:09 +02:00 cpuidle: Use local_clock_noinstr() With the introduction of local_clock_noinstr(), local_clock() itself is no longer marked noinstr, use the correct function. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102716.045980863@infradead.org --- drivers/cpuidle/cpuidle.c | 8 ++++---- drivers/cpuidle/poll_state.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 8e929f6..737a026 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -145,7 +145,7 @@ static noinstr void enter_s2idle_proper(struct cpuidle_driver *drv, instrumentation_begin(); - time_start = ns_to_ktime(local_clock()); + time_start = ns_to_ktime(local_clock_noinstr()); tick_freeze(); /* @@ -169,7 +169,7 @@ static noinstr void enter_s2idle_proper(struct cpuidle_driver *drv, tick_unfreeze(); start_critical_timings(); - time_end = ns_to_ktime(local_clock()); + time_end = ns_to_ktime(local_clock_noinstr()); dev->states_usage[index].s2idle_time += ktime_us_delta(time_end, time_start); dev->states_usage[index].s2idle_usage++; @@ -243,7 +243,7 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev, sched_idle_set_state(target_state); trace_cpu_idle(index, dev->cpu); - time_start = ns_to_ktime(local_clock()); + time_start = ns_to_ktime(local_clock_noinstr()); stop_critical_timings(); if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE)) { @@ -276,7 +276,7 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev, start_critical_timings(); sched_clock_idle_wakeup_event(); - time_end = ns_to_ktime(local_clock()); + time_end = ns_to_ktime(local_clock_noinstr()); trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu); /* The cpu is no longer idle or about to enter idle. */ diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index bdcfeae..9b6d90a 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -15,7 +15,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, { u64 time_start; - time_start = local_clock(); + time_start = local_clock_noinstr(); dev->poll_time_limit = false; @@ -32,7 +32,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, continue; loop_count = 0; - if (local_clock() - time_start > limit) { + if (local_clock_noinstr() - time_start > limit) { dev->poll_time_limit = true; break; }