Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3476743ybc; Thu, 21 Nov 2019 08:54:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyPzOjazHmpZztFvwH55iVcIUX6ABmb8SBxvEZxR4jMcpBP11GeHuyiNFV3YLhVcGX0k43q X-Received: by 2002:a17:906:a989:: with SMTP id jr9mr14624693ejb.160.1574355243590; Thu, 21 Nov 2019 08:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574355243; cv=none; d=google.com; s=arc-20160816; b=ZB99S4Ug06Cm85HlWnXApKybpvM7zGbph9jUn308Dn57zj/3wG7uLWk9tt7BbUaVmN DAc3ZUqhPQ1axJJxsAH7SJOXSoVkAVEshiDhBtSJf25NRhrZ2l7oKRjYSaRZSJmUmLAG kqAk9dbp575ultOwYt3RBrN6JnQ1Vt971erPUvIcp1A+S6Yb8Ce99zvvoeYTLLu12FyP T64Sjrm5LgxEHryPt7rzDhGkujbDeaRa009Y57i2NGva9PgGP2OJlEjQjJunGameIPRN 1wXsiz7lKc+BAeQyHobgNOg93qQUWeFmQUErWk41y9+SmU8xCl7mEuPT21cqzObHPZ+I ONpg== 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=nARvRJe8IG8Ozbyqs0oQ0/7TITtn5wag058peJHBpZg=; b=tS2Lk0UxCFS6QIWhEU10ty9C3P7/Ab2h+62pEF/K9vq2EG+uo+xJkPXcxWTPAy/nDg M67JePCEZ9Z4oUYIWg3X8JHmTgAquVdHbeqlMtw5x4MGvjDv/rRQH/iHDKhXuZ5nMDVa P7fSvciZDvNDeSwn/eIadNMCiF6nm2wWNlkwu2Fej2zOxdgohRLd+C33PtOjO9MM5O2m Oap72AxqoKmfY8feuInn4rKu/EX8I8xqw1e/ZEsXTXdRHWrclglnq0T3OyaHG3N4nAf7 Y20bofxbgkVvyE10zjbTb2XXRP+ZHUExmE8GJdPACPvPc/T0j5UnwFO5vqW+IdncUKg9 /iNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Md7qsHyh; 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 b9si2088097ejq.218.2019.11.21.08.53.39; Thu, 21 Nov 2019 08:54:03 -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=Md7qsHyh; 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 S1726905AbfKUQuD (ORCPT + 99 others); Thu, 21 Nov 2019 11:50:03 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36581 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbfKUQuD (ORCPT ); Thu, 21 Nov 2019 11:50:03 -0500 Received: by mail-wm1-f66.google.com with SMTP id n188so2593113wme.1 for ; Thu, 21 Nov 2019 08:50:02 -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=nARvRJe8IG8Ozbyqs0oQ0/7TITtn5wag058peJHBpZg=; b=Md7qsHyhqKF3kozzj2W2LpQc9Ck3Zlp4BsZy3JhEM1p8qJalTWheghmCL9n1sNqHvU /sHDzMTnhYsRu/X9pKjmSn9nOEDyDnlbCwx54F/mQ43AIraqwOu7GjXd6rSpvx3MXvXb 9HbH/fgMaAos2pfN0KSBPXxwmX2nLNThFT2mbfWicLtAsJ4ZlmFMkFSkhDKu6n5xQ551 SJUUCbW/6tHnmysyuRKdplPMlh+AU3hw9bLZrit3VOKV9fyEU0kKgQnLuq16ekO6Qj2k fpZB0mJC7ZMBfA+qwiUuAvbsDB8nNTz7i+aRMCo8h7Z/UPh7jkYd46xjRIQ10+D1w52U buAg== 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=nARvRJe8IG8Ozbyqs0oQ0/7TITtn5wag058peJHBpZg=; b=ulPviOFXYyniF3CIuBSumC9KTXzMZe5yVGqR/UWPCsuInPb2WuSbwC7o87v+W3fffP +K+N4DFY92Ts4SxvdzsW/U0gZzYng7Qqggco0UFMCBOmbQ+UT7ZTtL24wUdt9q9v/xOh SB2OZksUaMClEUbDCzB89S1nLV8TQC+fAaoZh7MHgYUklGE/7Pg14TB4KJGVXbKCpIo8 RO+ar/LqyvOlAlBXOQSZ18l9bAJQNYF2uopyHmZo2W6leXrFqfM7tzulkFZv7MEg5vIn +xdBdZSVw1adPtVcWE48F41+GBp1Uos5kJ5Sc1pFLdd87VNwVNjDgqyNd8NA31eMZ/BB aIpA== X-Gm-Message-State: APjAAAUuho3KxjGzExjtc5KviM54ZwUbtfFnHIx9CxYqmexT1sUUlqez Gs2OdyVVX0g52U9EIbmjxCY= X-Received: by 2002:a05:600c:2253:: with SMTP id a19mr11068931wmm.97.1574355001650; Thu, 21 Nov 2019 08:50:01 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id i71sm4369790wri.68.2019.11.21.08.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 08:50:01 -0800 (PST) Date: Thu, 21 Nov 2019 17:49:58 +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: <20191121164958.GA46146@gmail.com> References: <20191121024430.19938-1-frederic@kernel.org> <20191121024430.19938-6-frederic@kernel.org> <20191121065826.GA3552@gmail.com> <20191121141410.GA17301@lenoir> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121141410.GA17301@lenoir> 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: > 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? No need, I suspect this slipped in via my last minute request for that interface cleanup - so I just applied the fix and tested it - it all passed testing today and I just pushed it out into tip:sched/core. So all's good so far. Thanks Frederic! Ingo