lkml.org 
[lkml]   [2006]   [Jun]   [16]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 16 Jun 2006 13:40:47 -0700
FromGreg KH <>
SubjectRe: statistics infrastructure (in -mm tree) review
On Thu, Jun 15, 2006 at 12:49:54AM +0200, Martin Peschke wrote:
> Andi Kleen wrote:
> >Greg KH <greg@kroah.com> writes:
> >>>+ * exploiters don't update several statistics of the same entity in one 
> >>>go.
> >>>+ */
> >>>+static inline void statistic_add(struct statistic *stat, int i,
> >>>+				 s64 value, u64 incr)
> >>>+{
> >>>+	unsigned long flags;
> >>>+	local_irq_save(flags);
> >>>+	if (stat[i].state == STATISTIC_STATE_ON)
> >>>+		stat[i].add(&stat[i], smp_processor_id(), value, incr);
> >
> >
> >Indirect call in statistics hotpath?  You know how slow this is 
> >on IA64 and even on other architectures it tends to disrupt 
> >the pipeline.
> 
> Okay, let's try to improve it then. The options here are:
> 
> a) Replace the indirect function call by a switch statement which directly
>    calls the add function of the data processing mode chosen by user.
>    (e.g. simple counter, histogram, utilisation indicator etc.).
> 
>    No loss in functionality, slightly uglier code, acceptable 
>    performance(?).
>    This would be my choice.

Probably best.  Just don't make it an inline function :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-16 21:07    [from the cache]
©2003-2008