LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-10-2011, 07:30 PM   #1
GreenForest
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
Post smp_affinity doesn't work


i created a virtual machine with 2 processors in virtual box, and installed centos 6.0 as the os.

after setting up the lamp environment, i wrote a simple php script:
test.php
<?php
for ($loop=0; $loop<10000; $loop++)
echo "<img src='image/default/nopic.gif?$loop' width=5 />";
?>

i visited test.php, and then typed /proc/interrupts in the terminal.
CPU0 CPU1
0: 145 0 IO-APIC-edge timer
1: 1601 0 IO-APIC-edge i8042
8: 0 0 IO-APIC-edge rtc0
9: 0 0 IO-APIC-fasteoi acpi
12: 1420 0 IO-APIC-edge i8042
14: 3595 0 IO-APIC-edge ata_piix
15: 89 0 IO-APIC-edge ata_piix
19: 34125 0 IO-APIC-fasteoi eth0
21: 6 0 IO-APIC-fasteoi Intel 82801AA-ICH
NMI: 0 0 Non-maskable interrupts
LOC: 58185 44542 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 0 0 Performance monitoring interrupts
PND: 0 0 Performance pending work
RES: 6603 10727 Rescheduling interrupts
CAL: 42 123 Function call interrupts
TLB: 195 316 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 7 7 Machine check polls
ERR: 0
MIS: 0

/proc/irq/19/smp_affinity:
3

cpu1 didn't handle irq 19.

anyone can tell me what is the wrong?

thanks!
 
Old 11-14-2011, 10:48 AM   #2
mulyadi.santosa
Member
 
Registered: Sep 2011
Posts: 96

Rep: Reputation: 15
Hi

Nothing is wrong in your case. That's how Linux kernel works when handling interrupts.

More precisely, Linux kernel tends to make the last serving core to handle the same interrupt again and again. You might ask "weird, doesn't that mean load will be unbalanced?". True. But in this case, Linux kernel tries to maintain cache hotness. As you can guess, interrupt handling involves code (the handler) and data (the packets etc). By making sure interrupt is handled by same core, there is no need to cache the same data on another core. The (wanted) net result is eventually faster execution.
 
Old 11-17-2011, 07:31 PM   #3
GreenForest
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks, bro!
 
Old 11-18-2011, 07:47 AM   #4
mulyadi.santosa
Member
 
Registered: Sep 2011
Posts: 96

Rep: Reputation: 15
You welcome GreenForest
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard doesn't work right click on mouse doesn't work ramblinrick Linux Mint 2 10-15-2010 01:10 AM
DNS lookup doesn't work, ping, firefox will not work properly lovemov Linux - Networking 2 04-23-2009 02:30 PM
IRQ smp_affinity gangaraju Fedora 1 01-07-2009 12:34 PM
How does "latest" /proc/irq/xx/smp_affinity work? shimrot Linux - General 2 01-07-2009 12:33 PM
logout in x doesn't work and nvidia doesn't boot Meriadoc Linux - Newbie 2 06-18-2004 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration