Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2873689ybc; Wed, 20 Nov 2019 23:02:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwVwK/FKJ5I09RLatT9gLuuUJrqrJFgp3OyTWth0shAIivMErrIaW4If7fcz9RNNTDb/5Zj X-Received: by 2002:a17:906:7a47:: with SMTP id i7mr11629826ejo.22.1574319779096; Wed, 20 Nov 2019 23:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574319779; cv=none; d=google.com; s=arc-20160816; b=LJfm0pXqKx2mKwQxDJwmerxHRIFqHmjRBoPq1y6XT1ZcM1m+eyADM4/s0BeATu7HiP vgRmx4JO2rLH1fN8wLvUYkSeayrDaS/R8qOJ3BFyZSC5YFxsYlwpC58EhvpND3JnQXdM vKq1QfVrhV6aXNT+XpBTmLRHe8l6IKc+7WzmkaTLgaNbUiu5yl3oXjK8fvDWzI2FUFgR 4s9zMi5B7JYhZV7YyyOHMn0Mp/RoiZM/tQVtOLlgr6SFc++BYDNLxYeeM9f/AiRWSiIR h1YKz/ewTrWf37XFXioAld0SGm/Qb/CegutJo1VU/8do9gLdeJiSkjdQHimZ+QsGd8dy tpWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ydWnZbz80hDPHetOcz9VtQf8CG2Ll4S/bjHFOgvmQNA=; b=Y3BTjTNJD6bqVjD4QORD2JKnkoPb60NXYsgeJAzW4F02ZEIBHijLobIsMxscI1YJho inPnSYTjcGbVK7nJPE5N2gqHbeHmiBEfa0cPxhdwsV+qFuoUtOdVrc1pTC1vD/HCoEqk 2nOT8hOsS3bmlfhPPBMFQE/u1l/x8wagpb5oMjcgQbf0oJfdFbJ+A/QbAz/xYk9IQWVE vYHs+8AOJ0v7khPJqjy53VUD4vWSA57CjzZLfXnF+q3/mirdlmt3B6qD1LOwuZ6MbgXz mw9wNvlIoX6P2Hff4A24VzsIZiwvv0EeOn2SxGRv7C9sCQ9IPT2fsVHwUi+3WnaH5w27 oWwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="GqJT/7Zg"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25si1088821ejw.44.2019.11.20.23.02.34; Wed, 20 Nov 2019 23:02:59 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="GqJT/7Zg"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbfKUG6c (ORCPT + 99 others); Thu, 21 Nov 2019 01:58:32 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35590 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfKUG6b (ORCPT ); Thu, 21 Nov 2019 01:58:31 -0500 Received: by mail-wr1-f66.google.com with SMTP id s5so3008439wrw.2 for ; Wed, 20 Nov 2019 22:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ydWnZbz80hDPHetOcz9VtQf8CG2Ll4S/bjHFOgvmQNA=; b=GqJT/7ZgXUOX7PNeD/pbEUbxhw99dd60OOa2w3z1El6FqUKzWt72Ms8jI38gb9UyZG gzN/3OMVhqwvUob5mIi6MaolL4GrJsFmzZSqbpqezrCoxF2Tk+zb4FnU0fCRXGSEYpn0 40H3BGlB9rUgTMNbCQDF9QiY6MmFZNO3uHQfpMdnbUS3RWtY1VSKhZgI/WHHaWRZkE2x vMvdF9rXGE5X0QUEF9tIMNjVzh9/cyBexY6aIvNHLlHT5N7v5NbmAIlRZkffYF/cLg3k qWTc5na+0iQo3HalhA9UQl6cnvO7SfHP9T7dTGFSEl26eyUA3guWlXsPA2lVsSMjoyEM lOIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ydWnZbz80hDPHetOcz9VtQf8CG2Ll4S/bjHFOgvmQNA=; b=I5mE1929dn0RW5B91V/cZx1aO+qcDWPsrZqxifWLy3cPUI67yM6CvyHQJKMwJAx2it 5g4z9JwHcqBuE+iwmD62YTpPbGZbc6O1xhbF+xVgKzgNHl8WSLCrK8aZc9vwCc2fNEtT 37HcRJiHEiAso360NN5AD1+J9isjNoxC6wpalIN2fUlMJ/pjSXAbRM4E2vQITnD1y49N ZYVDZEvqtxTZT9llSUzYzu/VQJ8vomzyaurFVM9eleki6sItqZ/8Ufr8vnoUrV7SfEqf 8TDuQxZOH0Cxkz0CFb11YASf53MWkZ4nXwFdODOP5wP5AEkOepHNQxJK+nNIrGlvN3sC avHw== X-Gm-Message-State: APjAAAVJthlni/auT1kroyj5wxnHqyTTao26ms7nT2nVwJjcPzll4Jtj YnnUSMUyvE0aRVFTNMyQdhskNMF+ X-Received: by 2002:a5d:570a:: with SMTP id a10mr8311344wrv.107.1574319509534; Wed, 20 Nov 2019 22:58:29 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id i71sm2301881wri.68.2019.11.20.22.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 22:58:28 -0800 (PST) Date: Thu, 21 Nov 2019 07:58:26 +0100 From: Ingo Molnar To: Frederic Weisbecker Cc: Peter Zijlstra , LKML , Jacek Anaszewski , Wanpeng Li , "Rafael J . Wysocki" , Benjamin Herrenschmidt , Rik van Riel , Thomas Gleixner , Yauheni Kaliuta , Viresh Kumar , Pavel Machek Subject: Re: [PATCH 5/6] leds: Use all-in-one vtime aware kcpustat accessor Message-ID: <20191121065826.GA3552@gmail.com> References: <20191121024430.19938-1-frederic@kernel.org> <20191121024430.19938-6-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121024430.19938-6-frederic@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Frederic Weisbecker wrote: > We can now safely read user kcpustat fields on nohz_full CPUs. > Use the appropriate accessor. > > Reported-by: Yauheni Kaliuta > Signed-off-by: Frederic Weisbecker > Cc: Jacek Anaszewski > Cc: Pavel Machek > Cc: Yauheni Kaliuta > Cc: Thomas Gleixner > Cc: Rik van Riel > Cc: Peter Zijlstra > Cc: Wanpeng Li > Cc: 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 ddfc5edd07c8..6901e3631c22 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_fetch_cpu(&kcpustat, i); > + > + curr_used += kcpustat.cpustat[CPUTIME_USER] > + + kcpustat.cpustat[CPUTIME_NICE] > + + kcpustat.cpustat[CPUTIME_SYSTEM] > + + kcpustat.cpustat[CPUTIME_SOFTIRQ] > + + kcpustat.cpustat[CPUTIME_IRQ]; Not the best tested series: --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -59,7 +59,7 @@ static void led_activity_function(struct timer_list *t) for_each_possible_cpu(i) { struct kernel_cpustat kcpustat; - kcpustat_fetch_cpu(&kcpustat, i); + kcpustat_cpu_fetch(&kcpustat, i); curr_used += kcpustat.cpustat[CPUTIME_USER] + kcpustat.cpustat[CPUTIME_NICE] :-) Thanks, Ingo