Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3289106ybc; Thu, 21 Nov 2019 06:16:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxgW2e31mSdiT8J9VWg+PupV0oUFRr3Y7ONq4pOVUjTNltSQgt52fFIyMVmzxs3jsf9or/d X-Received: by 2002:ac8:524a:: with SMTP id y10mr8420296qtn.325.1574345800015; Thu, 21 Nov 2019 06:16:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574345799; cv=none; d=google.com; s=arc-20160816; b=Xvy/IsYzt0uD+z6bu0yTJPVsgzYmCjZ/sjCyIt3l0U5cXToEYD/CWAPc+zp5aB8ObU 6noI34/LNrW6oSVUA6igcflkvdEWbrAueHXxgaFHgKyzmEDYz0B5upO8l081Jwab9V6L sLwa45kWJ+R1uNZ/JD6QjK7SR3sGoBeLG4rxtwnrUU/KzAEZEC/Sp4y6Q4Gs2yqqlEaI Rq04pA9aH8ss0ZOc/u+H59/dDJX+Yml4cnqRsTuipEUtzd9QEPhCT6nqx5pqeXS1r8de cTgHSVf3X9H7IXRGZtgSoKXFyZNgVy5PMRhq13uSsEqjYnJ2vHxwNcaCZ8UIdFXodzkj gBRA== 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=xyrHVS6P/z1hN/zA4mU8DizWwBUc4wAgNEmH68ibS94=; b=EvyHBcdAKNqySbsMSDmA3md4JJYTYj5CTwlsOq06p5b5QAjVkyCEMw7thu3ZOysJm0 3NUMNgT5JSZhpFjcA4RCUyAMATl17avdgq0NkH9b4EJw9qMxv8ZKE6WqMSg4xQ4PVOG0 Hw3x4UzxnfWj6/YrmQwj+c5bqVqAzCQjorUmfBbqfY4Ucmu+yKr3I6by/dNy2MEKNmBz jIiriELnos/1/bZuB9+Gtk+yWehh39ZBLiV7q7K2A8CN8ne7L4Qe9JwX0tqwdtNzdJPu WjPsQJ/wie1fZNk3DKP4VhS9BrtZmKXqKqxSd87K92l36Kgg1LJ4OEqruBIWjNBSVSaR wWgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YWaunm5r; 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=pass (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 c5si2030508eds.263.2019.11.21.06.16.15; Thu, 21 Nov 2019 06:16:39 -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=pass header.i=@kernel.org header.s=default header.b=YWaunm5r; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbfKUOOQ (ORCPT + 99 others); Thu, 21 Nov 2019 09:14:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:42862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfKUOOP (ORCPT ); Thu, 21 Nov 2019 09:14:15 -0500 Received: from localhost (lfbn-ncy-1-150-155.w83-194.abo.wanadoo.fr [83.194.232.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E40D2206D7; Thu, 21 Nov 2019 14:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574345654; bh=yrY1+PrSgHnuhC1q4l+RJtecHMlK3eI481hfgDhR2nI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YWaunm5rNrJy8+9XedsaT48F+WyCoeAqkczVNMjaIbaw+MDbTeoaJ7hPH/84HZFLi CcbauHV82zlmLimN1wnrWNQtICWuiuKybcR3GEJI8cQ8K31dopCswGGkB9GLcxMMXw V+2kp0z6sdLO/mqpraeK7hwe2vA/SdgDBEFIqbIA= Date: Thu, 21 Nov 2019 15:14:11 +0100 From: Frederic Weisbecker To: Ingo Molnar 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: <20191121141410.GA17301@lenoir> References: <20191121024430.19938-1-frederic@kernel.org> <20191121024430.19938-6-frederic@kernel.org> <20191121065826.GA3552@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121065826.GA3552@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 07:58:26AM +0100, Ingo Molnar wrote: > > * 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] > > > :-) Oops, I tested with vtime on and off but that one slipped under my config. Do you want me to resend? Thanks.