Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As you can see below, nvidia is sharing the intrerrupt and the interrupt is using only CPU0, how can I change the interrupt for nvidia, and how can I make it use both CPU's ?
Here is an article describing the second question, I can change between CPU0 and CPU1 by modifing smp_affinity, but did not understand how can I set it to use both CPU's.

Acording to this blog setting smp_affinity to 3 should use both CPU0 and CPU1. Actualy in my case, it uses CPU0 (behaving like it was set to 1). Setting it to 2 uses CPU1.

radu@radu-work:~$ cat /proc/interrupts
           CPU0       CPU1       
  0:         79          0   IO-APIC-edge      timer
  1:          9      17152   IO-APIC-edge      i8042
  4:          2          0   IO-APIC-edge    
  6:          5          0   IO-APIC-edge      floppy
  7:          0          0   IO-APIC-edge      parport0
  8:          1          0   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
 12:     694613          0   IO-APIC-edge      i8042
 16:    1233922          0   IO-APIC-fasteoi   uhci_hcd:usb3, ahci, nvidia
 17:       3961     168757   IO-APIC-fasteoi   uhci_hcd:usb4, pata_jmicron
 18:          0          0   IO-APIC-fasteoi   ehci_hcd:usb1, uhci_hcd:usb7
 19:         59          0   IO-APIC-fasteoi   ata_piix, ata_piix, uhci_hcd:usb6
 22:        819       6915   IO-APIC-fasteoi   HDA Intel
 23:          2          0   IO-APIC-fasteoi   ehci_hcd:usb2, uhci_hcd:usb5, eth


radu@radu-work:~$ sudo cat /proc/irq/16/smp_affinity 
1

root@radu-work:~# uname -a
Linux radu-work 2.6.32-32-generic #62-Ubuntu SMP Wed Apr 20 21:54:21 UTC 2011 i686 GNU/Linux

Thank you.

EDIT: I am triyng to get my Linux box to play HD movies (at least 720). I have an nvidia 66xx series, Linux version Ubuntu 11.04, I have nvidia proprietary drivers instaled, but they do not suport hardware acceleration (and video decoding) for old harware (just 8xxx series and above) so the decoding is done in software. When I try to see a HD movie the image frozes for a few seconds, works a couple of seconds then frozes again. The CPU usage cougth my attention, nvidia drivers were using just one CPU, so I thouth that if I can make nvidia use both CPU's maybe I will have a better performance, and be able to finaly watch HD movies on my Linux box. By the way, I have tried every posible Linux player: mplayer (even nightly builds), totem, vlc and many more ...

EDIT: irqbalance --debug

root@radu-work:/# irqbalance --debug
Package 0:  cpu mask is 00000001 (workload 0)
        Cache domain 0: cpu mask is 00000001  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 0  (workload 0)
Package 0:  cpu mask is 00000003 (workload 0)
        Cache domain 0: cpu mask is 00000003  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 1  (workload 0)
Interrupt 44 (class ethernet) has workload 7 
Interrupt 0 (class timer) has workload 0 
Interrupt 16 (class storage) has workload 122 
Interrupt 17 (class storage) has workload 29 
Interrupt 19 (class storage) has workload 0 
Interrupt 45 (class legacy) has workload 2 
Interrupt 1 (class legacy) has workload 2 
Interrupt 12 (class legacy) has workload 0 
-----------------------------------------------------------------------------
IRQ delta is 152640 
Rescanning cpu topology 
Package 0:  cpu mask is 00000001 (workload 0)
        Cache domain 0: cpu mask is 00000001  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 0  (workload 0)
Package 0:  cpu mask is 00000003 (workload 0)
        Cache domain 0: cpu mask is 00000003  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 1  (workload 0)
Package 0:  cpu mask is 00000001 (workload 16)
        Cache domain 0: cpu mask is 00000001  (workload 16) 
                CPU number 0  (workload 3)
                  Interrupt 44 (ethernet/2) 
                CPU number 0  (workload 0)
          Interrupt 17 (storage/9) 
          Interrupt 19 (storage/0) 
          Interrupt 45 (legacy/0) 
          Interrupt 12 (legacy/0) 
Package 0:  cpu mask is 00000003 (workload 42)
        Cache domain 0: cpu mask is 00000003  (workload 42) 
                CPU number 0  (workload 0)
                CPU number 1  (workload 0)
          Interrupt 16 (storage/40) 
          Interrupt 1 (legacy/0) 

-----------------------------------------------------------------------------
...
-----------------------------------------------------------------------------
IRQ delta is 10 
IRQ delta is 10, switching to power mode 
Rescanning cpu topology 
Package 0:  cpu mask is 00000001 (workload 0)
        Cache domain 0: cpu mask is 00000001  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 0  (workload 0)
Package 0:  cpu mask is 00000003 (workload 0)
        Cache domain 0: cpu mask is 00000003  (workload 0) 
                CPU number 0  (workload 0)
                CPU number 1  (workload 0)
Package 0:  cpu mask is 00000001 (workload 38)
        Cache domain 0: cpu mask is 00000001  (workload 38) 
                CPU number 0  (workload 36)
                  Interrupt 44 (ethernet/35) 
                CPU number 0  (workload 0)
          Interrupt 16 (storage/0) 
          Interrupt 1 (legacy/0) 
Package 0:  cpu mask is 00000003 (workload 4)
        Cache domain 0: cpu mask is 00000003  (workload 4) 
                CPU number 0  (workload 0)
                CPU number 1  (workload 0)
          Interrupt 19 (storage/0) 
          Interrupt 17 (storage/0) 
          Interrupt 45 (legacy/0) 
          Interrupt 12 (legacy/0) 
share|improve this question
    
What's your actual problem? Why would you want to do something that would have such a negative impact on performance? –  David Schwartz Aug 26 '11 at 11:46
    
@David Schwartz - added to my question –  Radu Maris Aug 26 '11 at 17:46
    
You're barking up the wrong tree. Having the interrupts go to both CPUs would make performance worse, not better. –  David Schwartz Sep 26 '11 at 18:05
    
@David Schwartz, can you answer the question, so I can accept your answer to close the question. Thank you. –  Radu Maris Sep 27 '11 at 8:36
add comment

2 Answers

up vote 1 down vote accepted

You're barking up the wrong tree. Having the interrupts go to both CPUs would make performance worse, not better. For one thing, it would mean the software decoder would constantly be interrupted. For another, it would mean the interrupt code would be less likely to be hot in cache. There are many other reasons this would make things worse.

share|improve this answer
add comment

Have you looked at irqbalance? That looks like it will solve what you're trying to do. Irqbalance also takes into account caches as well as how many cores are running at a time documentation, something which modifying /proc entries won't achieve.

(I'm not convinced that your problem is strictly due to lack of interrupt sharing - as pauses of a few seconds sound like performance issues with disk, etc?).

share|improve this answer
    
yes, irqbalance is installed and running, but doens't seem to help (updated question with irqbalance debug messages). I did some IO disk test, it works fine in every benckmark. The problem is decoding H.264 videos :( IMO it works like this mplayer->nvidiaDrivers->kernel(or irqbalance)->CPU0, and I think it will be a little performance boost if it can use both cores. In newer nVidia hardware the linux driver uses hardware decoding not software decoding using CPU (mplayer->nvidia->GPU). –  Radu Maris Aug 30 '11 at 12:16
    
You are incorrect. Having interrupts go to both cores would make performance worse, not better. For one thing, it would mean the software decoder would constantly be interrupted. For another, it would mean the interrupt code would be less likely to be hot in cache. There are many other reasons this would make things worse. (Think about it. If this were not so, why would we even have 'irqbalance'?) –  David Schwartz Sep 26 '11 at 18:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.