Re: [RFC] [Patch 5/8] statistics infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2006-05-17 at 14:29 +1000, Keith Owens wrote:
> Martin Peschke (on Tue, 16 May 2006 19:46:38 +0200) wrote:
> >+static inline void statistic_add(struct statistic *stat, int i,
> >+				 s64 value, u64 incr)
> >+{
> >+	int cpu;
> >+	unsigned long flags;
> >+
> >+	if (stat[i].state == statistic_state_on) {
> >+		cpu = get_cpu();
> >+		local_irq_save(flags);
> >+		stat[i].add(&stat[i], cpu, value, incr);
> >+		local_irq_restore(flags);
> >+		put_cpu();
> >+	}
> >+}
> 
> Using get_cpu()/put_cpu() is pure overhead when you are disabling
> interrupts as well.
> 
> 	if (stat[i].state == statistic_state_on) {
> 		local_irq_save(flags);
> 		stat[i].add(&stat[i], smp_processor_id(), value, incr);
> 		local_irq_restore(flags);
> 	}
> 

Ouch. Fixed it. Thank you.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux