Re: UP/SMP difference in IRQ_STAT

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

 



On Thu, Dec 20, 2001 at 05:22:12PM +0530, Bharata B Rao wrote:

> On Thu, Dec 20, 2001 at 11:41:38AM +0000, John Levon wrote:
> > On Wed, Dec 19, 2001 at 11:07:11AM +0530, Bharata B Rao wrote:
> > 
> > > Please consider the following definitions from include/linux/irq_cpustat.h
> > > --------------------------
> > > #ifdef CONFIG_SMP
> > > #define __IRQ_STAT(cpu, member)	(irq_stat[cpu].member)
> > > #else
> > > #define __IRQ_STAT(cpu, member)	((void)(cpu), irq_stat[0].member)
> > > #endif	
> > 
> > I can only assume this is for performance. cpu might not be constant to the compiler,
> > so the first would still have an indirection overhead on UP. The second one, however,
> > lets the compiler optimise as the value of cpu is discarded (assume its evaluation has
> > not side effects that is ;)
> 
> If that is so, why not just
> #define __IRQ_STAT(cpu, member)	(irq_stat[0].member)
> for UP, so that the macros like local_irq_count(cpu) can be used as Lvalue.
> (I am concerned about not being able to use this as Lvalue in UP)

haven't I just answered this above ?

whether it makes a difference or not performance-wise is a different matter. IF you want
it to change, you should prove that it makes no real difference.

john

-- 
"Unless everyone else on earth is attending meetings I haven't been told
about."
	- /. paranoia at its finest
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux