Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3474927ybc; Thu, 21 Nov 2019 08:52:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzMoIyqeJbhfDvQJrefMRvRy75pfLx+OsDePama8McSbRyZiMC5AhefCOQjR+6VdvBCbIiD X-Received: by 2002:a17:906:f18b:: with SMTP id gs11mr15310466ejb.2.1574355124758; Thu, 21 Nov 2019 08:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574355124; cv=none; d=google.com; s=arc-20160816; b=jWuYesEiuYjugG5nj7VH9nT/5OznddNQg3pgMR+1HgdUKDrIFfj/tiapSYE87bUUg7 wWMv+66Dgdik6mKWq33nMvdfCq+7WkOgmSRmU41wVKf5AXZBfYXefVB9/dziMcu2n8pi xao4npUmL+61LY8ahpcyPuJvygA7YkjHafbl7pTUsfOx/8AImmvxHIWzQy6QL+CBjE7t YurPgvljwYH/x9atME5zcBF8jp6t5FkOSjEE7lWglh58g0IBoJOz+i4wJiO1ovyZqIcc RUXscbz8xReXlHbqGbd2b574PVAjMGhGHTk16ZMAtk3cqXdqWCQpfvhR9QZCOPbrM07D jY/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=IAZWX7GKGHhn/ZNeQIPIVbaFXW2rEq6pUcpik7USs1s=; b=zXConP3t6wpVo0RRqrmgQ5VuShoUkNJf9EkmEGBJcYCeC53BtrtBAAp8ugxQWACO5O z9Vl3aO/LFXEO5f8BYfYbGc0Yp81+IaQaftBHb3SGoHiRxvgx/9xCxH8xZXtb3yjUZ4T R97PovOno8uoJWJZrLKXrG0tYUsv0KdRA7ZVCNb8ucwFB+0GqwBqAalGuoc2/yxOQXza ZISNnMqqPQ4a33rvtNwlygY7n5vwEN07twrOCUFFd5Cvx2k7m1dcGNrxYV2qAVBrSfWL OtVI8K6aIiLJUXCcGUSWBDjixqXaVh+Lqr0c+Udys0zTrAebhWcIxmJRuzp/AHp5+6MW +vMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si2189080ejb.285.2019.11.21.08.51.40; Thu, 21 Nov 2019 08:52:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfKUQsY (ORCPT + 99 others); Thu, 21 Nov 2019 11:48:24 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:32926 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbfKUQsX (ORCPT ); Thu, 21 Nov 2019 11:48:23 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iXpcm-0000Yw-1p; Thu, 21 Nov 2019 17:48:08 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id A807F1C1A3D; Thu, 21 Nov 2019 17:48:07 +0100 (CET) Date: Thu, 21 Nov 2019 16:48:07 -0000 From: "tip-bot2 for Frederic Weisbecker" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] leds: Use all-in-one vtime aware kcpustat accessor Cc: Yauheni Kaliuta , Frederic Weisbecker , Jacek Anaszewski , Pavel Machek , Dan Murphy , Peter Zijlstra , Wanpeng Li , Ingo Molnar , x86 , LKML In-Reply-To: <20191121024430.19938-6-frederic@kernel.org> References: <20191121024430.19938-6-frederic@kernel.org> MIME-Version: 1.0 Message-ID: <157435488761.21853.4853862724156729541.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org 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: 8688f2fb671b2ed59b1b16083136b6edc3750435 Gitweb: https://git.kernel.org/tip/8688f2fb671b2ed59b1b16083136b6edc3750435 Author: Frederic Weisbecker AuthorDate: Thu, 21 Nov 2019 03:44:29 +01:00 Committer: Ingo Molnar CommitterDate: Thu, 21 Nov 2019 07:58:48 +01:00 leds: Use all-in-one vtime aware kcpustat accessor We can now safely read user kcpustat fields on nohz_full CPUs. Use the appropriate accessor. [ mingo: Fixed build failure. ] Reported-by: Yauheni Kaliuta Signed-off-by: Frederic Weisbecker Cc: Jacek Anaszewski (maintainer:LED SUBSYSTEM) Cc: Pavel Machek (maintainer:LED SUBSYSTEM) Cc: Dan Murphy (reviewer:LED SUBSYSTEM) Cc: Peter Zijlstra Cc: Wanpeng Li Link: https://lkml.kernel.org/r/20191121024430.19938-6-frederic@kernel.org Signed-off-by: Ingo Molnar --- drivers/leds/trigger/ledtrig-activity.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c index ddfc5ed..14ba7fa 100644 --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -57,11 +57,15 @@ static void led_activity_function(struct timer_list *t) curr_used = 0; for_each_possible_cpu(i) { - curr_used += kcpustat_cpu(i).cpustat[CPUTIME_USER] - + kcpustat_cpu(i).cpustat[CPUTIME_NICE] - + kcpustat_field(&kcpustat_cpu(i), CPUTIME_SYSTEM, i) - + kcpustat_cpu(i).cpustat[CPUTIME_SOFTIRQ] - + kcpustat_cpu(i).cpustat[CPUTIME_IRQ]; + struct kernel_cpustat kcpustat; + + kcpustat_cpu_fetch(&kcpustat, i); + + curr_used += kcpustat.cpustat[CPUTIME_USER] + + kcpustat.cpustat[CPUTIME_NICE] + + kcpustat.cpustat[CPUTIME_SYSTEM] + + kcpustat.cpustat[CPUTIME_SOFTIRQ] + + kcpustat.cpustat[CPUTIME_IRQ]; cpus++; }