- Posts: 18115
- Thank you received: 5334
Reducing latency on multicore pc's - Success!
- PCW
- Offline
- Moderator
-
Less
More
13 years 10 months ago #27524
by PCW
Replied by PCW on topic Reducing latency on multicore pc's - Success!
Right
bit 0 and 1 is 3 so 0 _and_ 1 result in a 1 output
as does bit 2 (4)so only input codes of 3 (00011b) and 4 (00100) generate a '1' output
all other codes generate a 0
bit 0 and 1 is 3 so 0 _and_ 1 result in a 1 output
as does bit 2 (4)so only input codes of 3 (00011b) and 4 (00100) generate a '1' output
all other codes generate a 0
- awallin
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 2
13 years 10 months ago #27596
by awallin
Replied by awallin on topic Reducing latency on multicore pc's - Success!
Hi Spainman,
I would be interested in trying your real-time tuning tips.
Can you try to post your attachment again? or maybe use pastebin or make a wiki page about it.
I assume you were trying this with Ubuntu 10.04lts and the RTAI kernel?
Anders
I would be interested in trying your real-time tuning tips.
Can you try to post your attachment again? or maybe use pastebin or make a wiki page about it.
I assume you were trying this with Ubuntu 10.04lts and the RTAI kernel?
Anders
- ArcEye
- Offline
- Junior Member
-
Less
More
- Posts: 22
- Thank you received: 240
13 years 10 months ago #27664
by ArcEye
Ditto again,
Having read up on the subject I can see what you are doing and probably replicate it.
What confuses me is the use of isolcpus as well.
If the kernel option CONFIG_HOTPLUG_CPU is set and allows the 'unmounting' of CPUs, with isolcpus (1,2,3) on a quad core for instance, where else but core 0 can the interrupts be sent?
Are you saying that even with the other cores isolated, irq_balance and APIC are still using the other cores for interrupts?
I shall have to have a play with it.
I can show that for instance using echo "1" > /proc/irq/NN/smp_affinity will move most of the interrupts on IRQ NN to CPU 0.
Mapping all my IRQs by this method to CPU 0, which I assume is what your script does at start up, showed a corresponding reduction in use of the other CPUs (albeit not a complete cessation in use)
(This is without isolcpus on the bootline)
I have various development kernels on this machine, so can try a few different things when time allows, but would be nice to get a bit more detail on your findings that led you here
regards
Replied by ArcEye on topic Reducing latency on multicore pc's - Success!
awallin wrote: Hi Spainman,
I would be interested in trying your real-time tuning tips.
Can you try to post your attachment again? or maybe use pastebin or make a wiki page about it.
I assume you were trying this with Ubuntu 10.04lts and the RTAI kernel?
Anders
Ditto again,
Having read up on the subject I can see what you are doing and probably replicate it.
What confuses me is the use of isolcpus as well.
If the kernel option CONFIG_HOTPLUG_CPU is set and allows the 'unmounting' of CPUs, with isolcpus (1,2,3) on a quad core for instance, where else but core 0 can the interrupts be sent?
Are you saying that even with the other cores isolated, irq_balance and APIC are still using the other cores for interrupts?
I shall have to have a play with it.
I can show that for instance using echo "1" > /proc/irq/NN/smp_affinity will move most of the interrupts on IRQ NN to CPU 0.
Mapping all my IRQs by this method to CPU 0, which I assume is what your script does at start up, showed a corresponding reduction in use of the other CPUs (albeit not a complete cessation in use)
(This is without isolcpus on the bootline)
I have various development kernels on this machine, so can try a few different things when time allows, but would be nice to get a bit more detail on your findings that led you here
regards
- RGH
- Offline
- Junior Member
-
Less
More
- Posts: 35
- Thank you received: 13
13 years 10 months ago #27692
by RGH
Replied by RGH on topic Reducing latency on multicore pc's - Success!
Sorry... I was away for a few days and couldn't respond. The initial post is updated now and contains a zip.
Regarding the questions:
- I've installed the machine from the latest linuxCnc Iso so yes, it's Ubuntu 10.04lts.
- isolcpus alone does definately not prevent irq-handling on the isolated core (at least on my machine)
- echoing into the smp_affinity files is what I do, it did not work without the kernel options I mentioned on my first post
The lut5 function does not seem to be that simple
as the discussion shows. Will have to read the posts in detail as soon as I have a little bit more sparetime. Thanks for the information anyway - I'm sure it will help to figure out what it does exactly.
Cheers,
Ruben
Regarding the questions:
- I've installed the machine from the latest linuxCnc Iso so yes, it's Ubuntu 10.04lts.
- isolcpus alone does definately not prevent irq-handling on the isolated core (at least on my machine)
- echoing into the smp_affinity files is what I do, it did not work without the kernel options I mentioned on my first post
The lut5 function does not seem to be that simple
as the discussion shows. Will have to read the posts in detail as soon as I have a little bit more sparetime. Thanks for the information anyway - I'm sure it will help to figure out what it does exactly.Cheers,
Ruben
- BigJohnT
- Offline
- Administrator
-
Less
More
- Posts: 3981
- Thank you received: 994
13 years 10 months ago #27696
by BigJohnT
Replied by BigJohnT on topic Reducing latency on multicore pc's - Success!
I've just added a description of
lut5
to the manual that might be a bit easier to read than the man page.
John
John
- ArcEye
- Offline
- Junior Member
-
Less
More
- Posts: 22
- Thank you received: 240
13 years 10 months ago - 13 years 10 months ago #27697
by ArcEye
Replied by ArcEye on topic Reducing latency on multicore pc's - Success!
Hi
Regards multicore latency reduction - just done some quick tests and I am not able to reproduce the results.
I have a quad core machine in the house which brings in a steady 31179 max jitter on base thread as is, with stock 10.04 and 2.6.32-132-rtai kernel
Test with 4 instances of glxgears and opening Firefox and browsing.
With isolcpus=1,2,3 acpi_irq_nobalance noirqbalance on the boot line, irqbalance uninstalled, the irqbalance.conf script removed and your script inserted
max jitter 31218 with exact same loading for same time.
It runs like crap though on just 1 core.
I proved the other 3 cores had been isolated from mpstat -P ALL
and the IRQs have been moved to CPU 0 ( the low figures for 1,2,3 are constant throughout and presumably are those that occurred before the script was run)
I have some test kernels I compiled a while back testing the effects of various kernel options, I think the best of these got the latency max jitter down to 15K on the same machine
(albeit that ran like crap too with 3 cores turned off)
Shame but those are the figures I got.
regards
Regards multicore latency reduction - just done some quick tests and I am not able to reproduce the results.
I have a quad core machine in the house which brings in a steady 31179 max jitter on base thread as is, with stock 10.04 and 2.6.32-132-rtai kernel
Test with 4 instances of glxgears and opening Firefox and browsing.
With isolcpus=1,2,3 acpi_irq_nobalance noirqbalance on the boot line, irqbalance uninstalled, the irqbalance.conf script removed and your script inserted
max jitter 31218 with exact same loading for same time.
It runs like crap though on just 1 core.
I proved the other 3 cores had been isolated from mpstat -P ALL
Code:
Linux 2.6.32-122-rtai (INTEL-QUAD) 13/12/12 _i686_ (4 CPU)
17:36:35 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
17:36:35 all 0.16 0.00 14.27 1.30 0.05 0.02 0.00 0.00 84.20
17:36:35 0 0.65 0.00 58.86 5.38 0.19 0.10 0.00 0.00 34.83
17:36:35 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.99
17:36:35 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
17:36:35 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
and the IRQs have been moved to CPU 0 ( the low figures for 1,2,3 are constant throughout and presumably are those that occurred before the script was run)
Code:
CPU0 CPU1 CPU2 CPU3
0: 50 0 0 0 IO-APIC-edge timer
1: 3 1 0 1 IO-APIC-edge i8042
8: 0 0 0 0 IO-APIC-edge rtc0
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 2 2 1 1 IO-APIC-edge i8042
16: 1847 28 20 27 IO-APIC-fasteoi uhci_hcd:usb3
17: 19 0 0 0 IO-APIC-fasteoi
18: 266 20 20 11 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb5, uhci_hcd:usb8
19: 16354 560 566 562 IO-APIC-fasteoi ata_piix, ata_piix, uhci_hcd:usb7
21: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb4
22: 245 1 0 2 IO-APIC-fasteoi ohci1394, HDA Intel
23: 111 27 29 29 IO-APIC-fasteoi ehci_hcd:usb2, uhci_hcd:usb6
24: 481 0 0 0 PCI-MSI-edge eth0
25: 377712 1 0 1 PCI-MSI-edge i915
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 117573 93136 4044 1135 Local timer interrupts
SPU: 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 Performance monitoring interrupts
PND: 0 0 0 0 Performance pending work
RES: 551 19010 313 261 Rescheduling interrupts
CAL: 1110 439 437 435 Function call interrupts
TLB: 0 0 0 0 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 Machine check exceptions
MCP: 2 2 2 2 Machine check polls
ERR: 3
MIS: 0
I have some test kernels I compiled a while back testing the effects of various kernel options, I think the best of these got the latency max jitter down to 15K on the same machine
(albeit that ran like crap too with 3 cores turned off)
Shame but those are the figures I got.
regards
Last edit: 13 years 10 months ago by ArcEye.
Time to create page: 0.434 seconds