From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450AbcFNSNj (ORCPT ); Tue, 14 Jun 2016 14:13:39 -0400 Received: from www.linutronix.de ([62.245.132.108]:35874 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932235AbcFNSNh (ORCPT ); Tue, 14 Jun 2016 14:13:37 -0400 Date: Tue, 14 Jun 2016 20:11:39 +0200 (CEST) From: Thomas Gleixner To: Nicolas Pitre cc: Daniel Lezcano , shreyas@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, peterz@infradead.org, rafael@kernel.org, vincent.guittot@linaro.org Subject: Re: [PATCH V5] irq: Track the interrupt timings In-Reply-To: Message-ID: References: <1465922036-27100-1-git-send-email-daniel.lezcano@linaro.org> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Jun 2016, Nicolas Pitre wrote: > What about simply this: > > void __handle_timings(struct irq_desc *desc) > { > struct irq_timings *timings = this_cpu_ptr(desc->timings); > timings->w_index = (timings->w_index + 1) & IRQ_TIMINGS_MASK; > timings->values[timings->w_index] = local_clock(); > } > > ? > > Then you could s/__handle_timings/__record_irq_time/ to better represent > what it does. And both the difference and the summing of squares could > be done upon entering idle instead. And make it part of the handle_timings() inline to avoid the function call. Thanks, tglx