From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbcFNPKW (ORCPT ); Tue, 14 Jun 2016 11:10:22 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:35046 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbcFNPKV (ORCPT ); Tue, 14 Jun 2016 11:10:21 -0400 Date: Tue, 14 Jun 2016 11:10:17 -0400 (EDT) From: Nicolas Pitre To: Daniel Lezcano cc: Thomas Gleixner , shreyas@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, peterz@infradead.org, rafael@kernel.org, vincent.guittot@linaro.org Subject: Re: [PATCH V4] irq: Track the interrupt timings In-Reply-To: <57600866.4070601@linaro.org> Message-ID: References: <1460545556-15085-1-git-send-email-daniel.lezcano@linaro.org> <57600866.4070601@linaro.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Jun 2016, Daniel Lezcano wrote: > On 06/10/2016 04:52 PM, Thomas Gleixner wrote: > > > > + timings->sum -= timings->values[timings->w_index]; > > > + timings->values[timings->w_index] = diff; > > > + timings->sum += diff; > > > > Now the real question is whether you really need all that math, checks and > > memsets in the irq hotpath. If you make the storage slightly larger then you > > can just store the values unconditionally in the circular buffer and do all > > the computational stuff when you really it. > > Yes, that was one concern when I wrote the code: do some basic computation > when an interrupt occurs, and the rest after or do the entire math when > entering idle. > > If the storage is a bit larger (let's say 16 values) and there is no memset > and the sum is not computed, at least we need a count for the number of values > in the array before this one is fulfilled, otherwise the statistics will be > wrong as we will take into account the entire array with old values, no ? The point is not to change from 8 to 16 entries, but to store raw 64-bit timestamps instead of computed 32-bit deltas. Whether or not those timestamps are too far apart and discarded can be done at idle entry time. Nicolas