Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Experiment/Theory] Messing with the irqs of certain things to increase their response/quality
New Posts  All Forums:Forum Nav:

[Experiment/Theory] Messing with the irqs of certain things to increase their response/quality

post #1 of 47
Thread Starter 
Basically I adapted a few guides that were more focused on audio so I'm not 100% on my video related changes. The goal is to increase response and quality of things like videos, audio, and visual/audio quality/response of games without having to mess with each individual program's processes. So what do you guys think? Stupid? Pointless? Dangerous?

This post has been updated as of May 9, 2014 August 8, 2014 September 5, 2014 September 7, 2014 September 21, 2014 September 27, 2014 September 29, 2014 October 3, 5, 9, 12, 19, 2014 November 8, 2014 . A better guide might be made at a later time but the scripts in this post (in the Spoiler bracket) are fairly detailed.

This first script is an example/guide to show you how to take control of IRQs priorities and manage them to your needs. Combine it with the second script for a noticeable difference. I leave whether that difference is a good or bad one up to you.

Anyway here's the guide(focused mainly on my desktop hardware needs so you probably will need to add and change things based on your needs):

Step One...reaching "soft realtime"
Just Process prioritization without any /proc/sys tunning (Click to show)
Code:
#!/bin/sh
#THIS SECTION NEED ONLY BE DONE ONCE OR WHENEVER A NEW KERNEL IS INSTALLED
#Using the threadirqs kernel option
#This is only needed for so­called generic kernels, ie. standard kernels that are not tweaked for lowlatency
#performance. You can check if your kernel already includes this option with the following command:
#############################################################################################################
#$ grep -e CONFIG_IRQ_FORCED_THREADING=y -e CONFIG_PREEMPT=y /boot/config-'uname -r'
#############################################################################################################
#If it returns CONFIG_IRQ_FORCED_THREADING=y and CONFIG_PREEMPT=y then your kernel is using IRQ
#threading and you don't have to proceed with the following steps. If it only returns
#CONFIG_IRQ_FORCED_THREADING=y you can add the threadirqs boot option as described below. If the
#command returns nothing you have a kernel that cannot use threaded IRQs.
#############################################################################################################
#Open /etc/default/grub with your favorite editor as root. Look for the line that starts with
#GRUB_CMDLINE_LINUX_DEFAULT and add threadirqs along with apic lapic to the list of options so it should look similar to this:
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs apic lapic"
#Save the file and update the grub configuration:
#sudo update-grub
#Now reboot and you should have threaded IRQs.
#############################################################################################################
#############################################################################################################
#The goal of the following is to see if changing the irqs of certain things would...
#...affect the quality and/or responsiveness of those things.
#Examples with the irqs of video and audio hardware.
#Thus this script is designed to raise those irqs very high.
#The script you can/should change to suit your needs.
#ionice should have no effect outside of systems using the cfq ioscheduler (default for Ubuntu is deadline)
#check your scheduler by typing: cat /sys/block/sd*/queue/scheduler
#whatever is in the [ ] is the current in use ioscheduler
#######################
#-f vs -r explanation
#######################
# if two processes are chrt -f -p 98 then whichever is first to need to run will run until it yields blocking the
#...second at the same chrt -f -p 98 level. However, something at chrt -f -p 99 will preempt both and both
#...would preempt anything at chrt -f -p 97. If you share priority levels use -r instead of -f.
#This will allow both to share the time should they both need to run at the same time.
#############################################################################################################
#Give your SATA drives a higher IRQ so they're not slowing you down
sudo chrt -f -p 98 $(pgrep ahci)
sudo ionice -c1 -n0 -p$(pgrep ahci)

#For an Nvidia related GPU system
sudo chrt -f -p 96 $(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)
sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)

#For an Intel GPU system
#sudo chrt -f -p 96 $(ps -ef | pgrep 'irq/.*-i915' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-i915' | cut -f1)

#To improve the audio of the system
#Find the name of the irq related to the audio card you're using
#For most onboard systems it will be snd_hda.
sudo chrt -r -p 95 $(ps -ef | pgrep 'snd_hda' | cut -f1)
sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'snd_hda' | cut -f1)

#Extra: Increase the irq of your networking device so it also has a higher priority
#My choices are eth0 for the desktop or anything with wired connections
sudo chrt -f -p 97 $(pgrep eth0)
sudo ionice -c1 -n0 -p$(pgrep eth0)

#iwlwifi is for an Intel based Wireless card
#sudo chrt -f -p 97 $(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)

#############################################################################################################
#Secondary IRQs that need prioritizing to further limit race/time fighting conflicts
#These include the ohci,ehci,xhci types which you will need to decide how to prioritize
#I recommend seeing the out put of the command [cat /proc/interrupts]
#...and seeing if anything such as snd_hda is shared on one of these irqs.
#If it is it is a good idea to get the process id number and raise it to one below
#...your snd_hda settings.
#############################################################################################################
for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo chrt -r -p 95 $pid ; done
for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo ionice -c1 -n0 -p $pid ; done

#############################################################################################################
#My Laptop specific ehci,ohci,xhci irqs
#############################################################################################################

#sudo chrt -f -p 91 $(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)

#sudo chrt -f -p 89 $(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)

#sudo chrt -f -p 88 $(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)

#sudo chrt -f -p 87 $(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)

#sudo chrt -f -p 86 $(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)

#sudo chrt -f -p 85 $(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)

#sudo chrt -f -p 84 $(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)

#sudo chrt -f -p 83 $(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)


#############################################################################################################
#Kernel level processes should be next
#what if rcuos and rcuob were Round Robins instead? Might require some of that scheduler tweaking though
#Change rcuos and rcuob back from -r to -f if you find out it's not as good
#############################################################################################################
#RCUs higher than ksoftirqds works best in my experience
for pid in `ps -ef | grep rcu_sched | awk '{print $2}'` ; do sudo chrt -f -p 94 $pid ; done
for pid in `ps -ef | grep rcu_sched| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuos | awk '{print $2}'` ; do sudo chrt -r -p 93 $pid ; done
for pid in `ps -ef | grep rcuos| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#block rcu set lower than os better?
for pid in `ps -ef | grep rcu_bh | awk '{print $2}'` ; do sudo chrt -f -p 92 $pid ; done
for pid in `ps -ef | grep rcu_bh| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuob | awk '{print $2}'` ; do sudo chrt -r -p 91 $pid ; done
for pid in `ps -ef | grep rcuob| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#This handles all ksoftirqds
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo chrt -r -p 90 $pid ; done
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#Unsure of these but they were all at the same -20 priority before which was higher than the next sections
#Test them as Round Robin 89 vs ranked priorities
#############################################################################################################
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#If you have irqbalance installed this will help
#############################################################################################################
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#############################################################################################################
#Things that might touch your disks
#############################################################################################################
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo chrt -f -p 85 $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo chrt -f -p 84 $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo chrt -r -p 83 $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo chrt -f -p 82 $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
#############################################################################################################
#Next for networking
#############################################################################################################
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo chrt -f -p 81 $pid ; done
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo chrt -f -p 80 $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo chrt -f -p 79 $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo chrt -f -p 78 $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done

#############################################################################################################
#Userspace/root processes you might want to mess with
#############################################################################################################
#Increase the display server priority to improve it's responsiveness/quality
sudo chrt -f -p 77 $(pgrep Xorg)
sudo ionice -c1 -n4 -p$(pgrep Xorg)

#Increase your DE/WM GUI process IE kwin, openbox
#Because of a glitch that launches many openbox instances you should run it Round Robin (-r)
for pid in `ps -ef | grep kwin | awk '{print $2}'` ; do sudo chrt -f -p 76 $pid ; done
for pid in `ps -ef | grep kwin | awk '{print $2}'` ; do sudo ionice -c1 -n4 -p $pid ; done
for pid in `ps -ef | grep openbox | awk '{print $2}'` ; do sudo chrt -r -p 76 $pid ; done
for pid in `ps -ef | grep openbox | awk '{print $2}'` ; do sudo ionice -c1 -n4 -p $pid ; done

#Increase other processes that might touch either sound or video
sudo chrt -f -p 75 $(pgrep hd-audio0)
sudo ionice -c1 -n4 -p$(pgrep hd-audio0)


#############################################################################################################
#This section is the useless daemons/processes killer section. Enable only the lines of daemons you want to kill
#cups is printer related. bluetooth is obvious, nmbd, smbd, and don't touch winbindd it relates to policy-kit
#############################################################################################################
sudo stop cups
sudo stop cups-browsed
sudo stop bluetooth
sudo stop smbd
sudo stop nmbd
#colord is a gamma daemon for multiple monitors and adds another delay to images
sudo kill $(pgrep colord)
#If you don't use ssh then it's worthwhile to kill it
sudo kill $(pgrep ssh-agent)
#If you don't need kmix kill it
sudo kill $(pgrep kmix)
#md seems to be about software RAID so if you don't need get rid of it?
#sudo stop md
#edac-poller seems to be only useful for ECC capable setups so maybe get rid of it?
#sudo stop edac-poller

#############################################################################################################
#############################################################################################################
#THE FOLLOWING IS NOT CONSIDERED SAFE AND NOT FULLY TESTED FOR THE BENEFITS OR COSTS IT MIGHT HAVE
#THESE CHANGES ARE ALL MOST CERTAINLY NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
#############################################################################################################

#############################################################################################################
#This is the RTC clock poller increaser part. Arch Wiki made me do it.
#Definitely changes things. I'll leave it up to you if it's for the best.
#64 is the default value if you want to fall back to that.
#4095 is the max/most responsive value for both. NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
echo 4095 | sudo tee /sys/class/rtc/rtc0/max_user_freq
echo 4095 | sudo tee /proc/sys/dev/hpet/max-user-freq

#############################################################################################################
#This is a check to show that the changes occurred
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -e "FF" -e "RR"


This script will make your IRQs or whatever IRQs you wish to enable run at highest priority but they'll Round Robin if they need to run at the same time. The danger of this script is that if something should cause an IRQ to never block or yield it will be unlikely that the watchdog processes can stop it from locking the system up.
IRQsTrulyRT.sh (Click to show)
Code:
#!/bin/sh

#############################################################################################################
#THIS SECTION NEED ONLY BE DONE ONCE OR WHENEVER A NEW KERNEL IS INSTALLED
#Using the threadirqs kernel option
#This is only needed for so­called generic kernels, ie. standard kernels that are not tweaked for lowlatency
#performance. You can check if your kernel already includes this option with the following command:
#############################################################################################################
#$ grep -e CONFIG_IRQ_FORCED_THREADING=y -e CONFIG_PREEMPT=y /boot/config-'uname -r'
#############################################################################################################
#If it returns CONFIG_IRQ_FORCED_THREADING=y and CONFIG_PREEMPT=y then your kernel is using IRQ
#threading and you don't have to proceed with the following steps. If it only returns
#CONFIG_IRQ_FORCED_THREADING=y you can add the threadirqs boot option as described below. If the
#command returns nothing you have a kernel that cannot use threaded IRQs.
#############################################################################################################
#Open /etc/default/grub with your favorite editor as root. Look for the line that starts with
#GRUB_CMDLINE_LINUX_DEFAULT and add threadirqs along with apic lapic to the list of options so it should look similar to this:
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs apic lapic"
#Save the file and update the grub configuration:
#sudo update-grub
#Now reboot and you should have threaded IRQs.
#############################################################################################################

#############################################################################################################
#The goal of the following is to see if changing the irqs of certain things would...
#...affect the quality and/or responsiveness of those things.
#Examples with the irqs of video and audio hardware.
#Thus this script is designed to raise those irqs very high.
#The script you can/should change to suit your needs.
#ionice should have no effect outside of systems using the cfq ioscheduler (default for Ubuntu is deadline)
#check your scheduler by typing: cat /sys/block/sd*/queue/scheduler
#whatever is in the [ ] is the current in use ioscheduler
#######################
#-f vs -r explanation
#######################
# if two processes are chrt -f -p 98 then whichever is first to need to run will run until it yields blocking the
#...second at the same chrt -f -p 98 level. However, something at chrt -f -p 99 will preempt both and both
#...would preempt anything at chrt -f -p 97. If you share priority levels use -r instead of -f.
#This will allow both to share the time should they both need to run at the same time.
#############################################################################################################
#Give your SATA drives a higher IRQ so they're not slowing you down
sudo chrt -f -p 99 $(pgrep ahci)
sudo ionice -c1 -n0 -p$(pgrep ahci)

#For an Nvidia related GPU system
sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)
sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)

#For an Intel GPU system
#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/.*-i915' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-i915' | cut -f1)

#To improve the audio of the system
#Find the name of the irq related to the audio card you're using
#For most onboard systems it will be snd_hda.
sudo chrt -f -p 99 $(ps -ef | pgrep 'snd_hda' | cut -f1)
sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'snd_hda' | cut -f1)

#Extra: Increase the irq of your networking device so it also has a higher priority
#My choices are eth0 for the desktop or anything with wired connections
sudo chrt -f -p 99 $(pgrep eth0)
sudo ionice -c1 -n0 -p$(pgrep eth0)

#iwlwifi is for an Intel based Wireless card
#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)

#############################################################################################################
#Secondary IRQs that need prioritizing to further limit race/time fighting conflicts
#These include the ohci,ehci,xhci types which you will need to decide how to prioritize
#I recommend seeing the out put of the command [cat /proc/interrupts]
#...and seeing if anything such as snd_hda is shared on one of these irqs.
#If it is it is a good idea to get the process id number and raise it to one below
#...your snd_hda settings.
#############################################################################################################
for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo chrt -f -p 99 $pid ; done
for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo ionice -c1 -n0 -p $pid ; done

#############################################################################################################
#My Laptop specific ehci,ohci,xhci irqs
#############################################################################################################

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)

#sudo chrt -f -p 99 $(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)


#############################################################################################################
#Kernel level processes should be next
#what if rcuos and rcuob were Round Robins instead? Might require some of that scheduler tweaking though
#Change rcuos and rcuob back from -r to -f if you find out it's not as good
#############################################################################################################
#RCUs higher than ksoftirqds works best in my experience
for pid in `ps -ef | grep rcu_sched | awk '{print $2}'` ; do sudo chrt -f -p 98 $pid ; done
for pid in `ps -ef | grep rcu_sched| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuos | awk '{print $2}'` ; do sudo chrt -f -p 97 $pid ; done
for pid in `ps -ef | grep rcuos| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#block rcu set lower than os better?
for pid in `ps -ef | grep rcu_bh | awk '{print $2}'` ; do sudo chrt -f -p 96 $pid ; done
for pid in `ps -ef | grep rcu_bh| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuob | awk '{print $2}'` ; do sudo chrt -f -p 95 $pid ; done
for pid in `ps -ef | grep rcuob| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#This handles all ksoftirqds
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo chrt -f -p 94 $pid ; done
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#Unsure of these but they were all at the same -20 priority before which was higher than the next sections
#Test them as Round Robin 89 vs ranked priorities
#############################################################################################################
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#If you have irqbalance installed this will help
#############################################################################################################
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo chrt -f -p 93 $pid ; done
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#############################################################################################################
#Things that might touch your disks
#############################################################################################################
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo chrt -f -p 92 $pid ; done
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo chrt -f -p 91 $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo chrt -f -p 90 $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
#############################################################################################################
#Next for networking
#############################################################################################################
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo chrt -f -p 85 $pid ; done
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo chrt -f -p 84 $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo chrt -f -p 83 $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo chrt -f -p 82 $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done

#############################################################################################################
#Userspace/root processes you might want to mess with
#############################################################################################################
#Increase the display server priority to improve it's responsiveness/quality
sudo chrt -f -p 81 $(pgrep Xorg)
sudo ionice -c1 -n4 -p$(pgrep Xorg)

#Increase other processes that might touch either sound or video
sudo chrt -f -p 80 $(pgrep hd-audio0)
sudo ionice -c1 -n4 -p$(pgrep hd-audio0)


#############################################################################################################
#This section is the useless daemons/processes killer section. Enable only the lines of daemons you want to kill
#cups is printer related. bluetooth is obvious, nmbd, smbd, and don't touch winbindd it relates to policy-kit
#############################################################################################################
sudo stop cups
sudo stop cups-browsed
sudo stop bluetooth
sudo stop smbd
sudo stop nmbd
#colord is a gamma daemon for multiple monitors and adds another delay to images
sudo kill $(pgrep colord)
#If you don't use ssh then it's worthwhile to kill it
sudo kill $(pgrep ssh-agent)
#If you don't need kmix kill it
sudo kill $(pgrep kmix)
#md seems to be about software RAID so if you don't need get rid of it?
#sudo stop md
#edac-poller seems to be only useful for ECC capable setups so maybe get rid of it?
#sudo stop edac-poller

#############################################################################################################
#############################################################################################################
#THE FOLLOWING IS NOT CONSIDERED SAFE AND NOT FULLY TESTED FOR THE BENEFITS OR COSTS IT MIGHT HAVE
#THESE CHANGES ARE ALL MOST CERTAINLY NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
#############################################################################################################

#############################################################################################################
#This is the RTC clock poller increaser part. Arch Wiki made me do it.
#Definitely changes things. I'll leave it up to you if it's for the best.
#64 is the default value if you want to fall back to that.
#4095 is the max/most responsive value for both. NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
echo 4095 | sudo tee /sys/class/rtc/rtc0/max_user_freq
echo 4095 | sudo tee /proc/sys/dev/hpet/max-user-freq

#############################################################################################################
#This is a check to show that the changes occurred
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -e "FF" -e "RR"


This next script is my current favorite because it's produced the best results for me. It also contains some extra processes that come with a Low-Latency kernel but you can either delete them, comment them out, or ignore them if you're on a generic as they'll be ignored if they don't exist.
IORT.sh (Click to show)
Code:
#!/bin/sh
#This version is for lowlatency kernels only
#############################################################################################################
#THIS SECTION NEED ONLY BE DONE ONCE OR WHENEVER A NEW KERNEL IS INSTALLED
#Using the threadirqs kernel option
#This is only needed for so­called generic kernels, ie. standard kernels that are not tweaked for lowlatency
#performance. You can check if your kernel already includes this option with the following command:
#############################################################################################################
#$ grep -e CONFIG_IRQ_FORCED_THREADING=y -e CONFIG_PREEMPT=y /boot/config-'uname -r'
#############################################################################################################
#If it returns CONFIG_IRQ_FORCED_THREADING=y and CONFIG_PREEMPT=y then your kernel is using IRQ
#threading and you don't have to proceed with the following steps. If it only returns
#CONFIG_IRQ_FORCED_THREADING=y you can add the threadirqs boot option as described below. If the
#command returns nothing you have a kernel that cannot use threaded IRQs.
#############################################################################################################
#Open /etc/default/grub with your favorite editor as root. Look for the line that starts with
#GRUB_CMDLINE_LINUX_DEFAULT and add threadirqs along with apic lapic to the list of options so it should look similar to this:
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs apic lapic"
#Save the file and update the grub configuration:
#sudo update-grub
#Now reboot and you should have threaded IRQs.
#############################################################################################################

#############################################################################################################
#The goal of the following is to see if changing the irqs of certain things would...
#...affect the quality and/or responsiveness of those things.
#Examples with the irqs of video and audio hardware.
#Thus this script is designed to raise those irqs very high.
#The script you can/should change to suit your needs.
#ionice should have no effect outside of systems using the cfq ioscheduler (default for Ubuntu is deadline)
#check your scheduler by typing: cat /sys/block/sd*/queue/scheduler
#whatever is in the [ ] is the current in use ioscheduler
#######################
#-f vs -r explanation
#######################
# if two processes are chrt -f -p 98 then whichever is first to need to run will run until it yields blocking the
#...second at the same chrt -f -p 98 level. However, something at chrt -f -p 99 will preempt both and both
#...would preempt anything at chrt -f -p 97. If you share priority levels use -r instead of -f.
#This will allow both to share the time should they both need to run at the same time.
#############################################################################################################
#Give your SATA drives a higher IRQ so they're not slowing you down
sudo chrt -f -p 99 $(pgrep ahci)
sudo ionice -c1 -n0 -p$(pgrep ahci)

#Extra: Increase the irq of your networking device so it also has a higher priority
#My choices are eth0 for the desktop or anything with wired connections
sudo chrt -f -p 98 $(pgrep eth0)
sudo ionice -c1 -n0 -p$(pgrep eth0)

#iwlwifi is for an Intel based Wireless card
#sudo chrt -f -p 98 $(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)

#############################################################################################################
#Secondary IRQs that need prioritizing to further limit race/time fighting conflicts
#These include the ohci,ehci,xhci types which you will need to decide how to prioritize
#I recommend seeing the out put of the command [cat /proc/interrupts]
#...and seeing if anything such as snd_hda is shared on one of these irqs.
#If it is it is a good idea to get the process id number and raise it to one below
#...your snd_hda settings.
#############################################################################################################
#for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo chrt -f -p 96 $pid ; done
#for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo ionice -c1 -n0 -p $pid ; done

#############################################################################################################
#My Laptop specific ehci,ohci,xhci irqs
#############################################################################################################

#sudo chrt -f -p 91 $(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)

#sudo chrt -f -p 89 $(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)

#sudo chrt -f -p 88 $(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)

#sudo chrt -f -p 87 $(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)

#sudo chrt -f -p 86 $(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)

#sudo chrt -f -p 85 $(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)

#sudo chrt -f -p 84 $(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)

#sudo chrt -f -p 83 $(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)
#sudo ionic -c1 -n0 -p$(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)


#############################################################################################################
#Kernel level processes should be next
#what if rcuos and rcuob were Round Robins instead? Might require some of that scheduler tweaking though
#Change rcuos and rcuob back from -r to -f if you find out it's not as good
#############################################################################################################
#RCU preempt threads must come before the rest
for pid in `ps -ef | grep rcu_preempt | awk '{print $2}'` ; do sudo chrt -f -p 97 $pid ; done
for pid in `ps -ef | grep rcu_preempt | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuop | awk '{print $2}'` ; do sudo chrt -f -p 96 $pid ; done
for pid in `ps -ef | grep rcuop | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#RCUs higher than ksoftirqds works best in my experience
for pid in `ps -ef | grep rcu_sched | awk '{print $2}'` ; do sudo chrt -f -p 95 $pid ; done
for pid in `ps -ef | grep rcu_sched| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuos | awk '{print $2}'` ; do sudo chrt -f -p 94 $pid ; done
for pid in `ps -ef | grep rcuos| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#block rcu set lower than os better?
for pid in `ps -ef | grep rcu_bh | awk '{print $2}'` ; do sudo chrt -f -p 93 $pid ; done
for pid in `ps -ef | grep rcu_bh| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
for pid in `ps -ef | grep rcuob | awk '{print $2}'` ; do sudo chrt -f -p 92 $pid ; done
for pid in `ps -ef | grep rcuob| awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#This handles all ksoftirqds
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo chrt -f -p 91 $pid ; done
for pid in `ps -ef | grep ksoftirqd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#Unsure of these but they were all at the same -20 priority before which was higher than the next sections
#Test them as Round Robin 89 vs ranked priorities
#############################################################################################################
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
#for pid in `ps -ef | grep khelper | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
#for pid in `ps -ef | grep kintegrityd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
#for pid in `ps -ef | grep kblockd | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
#for pid in `ps -ef | grep kthrotld | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done

#############################################################################################################
#If you have irqbalance installed this will help
#############################################################################################################
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo chrt -f -p 90 $pid ; done
for pid in `ps -ef | grep irqbalance | awk '{print $2}'` ; do sudo ionice -c1 -n1 -p $pid ; done
#############################################################################################################
#Things that might touch your disks
#############################################################################################################
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo chrt -f -p 89 $pid ; done
for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo chrt -f -p 88 $pid ; done
for pid in `ps -ef | grep ata_sff | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo chrt -f -p 87 $pid ; done
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo chrt -f -p 86 $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo chrt -f -p 85 $pid ; done
for pid in `ps -ef | grep ext4-rsv-conver | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo chrt -f -p 84 $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo chrt -f -p 83 $pid ; done
for pid in `ps -ef | grep udisksd | awk '{print $2}'` ; do sudo ionice -c1 -n2 -p $pid ; done
#############################################################################################################
#Next for networking
#############################################################################################################
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo chrt -f -p 82 $pid ; done
for pid in `ps -ef | grep netns | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo chrt -f -p 81 $pid ; done
for pid in `ps -ef | grep NetworkManager | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo chrt -f -p 80 $pid ; done
for pid in `ps -ef | grep dhclient | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo chrt -f -p 79 $pid ; done
for pid in `ps -ef | grep dnsmasq | awk '{print $2}'` ; do sudo ionice -c1 -n3 -p $pid ; done

#############################################################################################################
#Userspace/root processes you might want to mess with
#############################################################################################################
#For an Nvidia related GPU system
sudo chrt -f -p 78 $(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)
sudo ionice -c1 -n4 -p$(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)

#For an Intel GPU system
#sudo chrt -f -p 78 $(ps -ef | pgrep 'irq/.*-i915' | cut -f1)
#sudo ionice -c1 -n0 -p$(ps -ef | pgrep 'irq/.*-i915' | cut -f1)

#Increase the display server priority to improve it's responsiveness/quality
sudo chrt -f -p 77 $(pgrep Xorg)
sudo ionice -c1 -n4 -p$(pgrep Xorg)

#To improve the audio of the system
#Find the name of the irq related to the audio card you're using
#For most onboard systems it will be snd_hda.
sudo chrt -f -p 76 $(ps -ef | pgrep 'snd_hda' | cut -f1)
sudo ionice -c1 -n4 -p$(ps -ef | pgrep 'snd_hda' | cut -f1)

#Increase other processes that might touch either sound or video
sudo chrt -f -p 75 $(pgrep hd-audio0)
sudo ionice -c1 -n4 -p$(pgrep hd-audio0)


#############################################################################################################
#This section is the useless daemons/processes killer section. Enable only the lines of daemons you want to kill
#cups is printer related. bluetooth is obvious, nmbd, smbd, and don't touch winbindd it relates to policy-kit
#############################################################################################################
sudo stop cups
sudo stop cups-browsed
sudo stop bluetooth
sudo stop smbd
sudo stop nmbd
#colord is a gamma daemon for multiple monitors and adds another delay to images
sudo kill $(pgrep colord)
#If you don't use ssh then it's worthwhile to kill it
sudo kill $(pgrep ssh-agent)
#If you don't need kmix kill it
sudo kill $(pgrep kmix)
#md seems to be about software RAID so if you don't need get rid of it?
#sudo stop md
#edac-poller seems to be only useful for ECC capable setups so maybe get rid of it?
#sudo stop edac-poller

#############################################################################################################
#############################################################################################################
#THE FOLLOWING IS NOT CONSIDERED SAFE AND NOT FULLY TESTED FOR THE BENEFITS OR COSTS IT MIGHT HAVE
#THESE CHANGES ARE ALL MOST CERTAINLY NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
#############################################################################################################

#############################################################################################################
#This is the RTC clock poller increaser part. Arch Wiki made me do it.
#Definitely changes things. I'll leave it up to you if it's for the best.
#64 is the default value if you want to fall back to that.
#4095 is the max/most responsive value for both. NOT SAFE FOR LAPTOP BATTERY LIFE
#############################################################################################################
echo 4095 | sudo tee /sys/class/rtc/rtc0/max_user_freq
echo 4095 | sudo tee /proc/sys/dev/hpet/max-user-freq

#############################################################################################################
#This is a check to show that the changes occurred
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -e "FF" -e "RR"

Step Two: Shielding/Isolating. The step that when combined with Full Preemption (a kernel config option I'm not going to cover yet) and core:irq isolation ratio of 1:1 would come close to "hard real time" and determinism

This second script is a potential big difference maker(but you need the first as you will get best results by having a determined priority order for you IRQs) but it also the most costly and the one that will change the most about how your computer performs. Be aware that it will probably sacrifice total CPU performance in order to do the things it does. If you're willing to sacrifice pure compute power for better media quality then this script is for you. Final note is you need to make sure you that you dedicate no more than half of the actual CPU cores (a core doesn't equal a hyperthread so be careful with those i3s and i7s as for hyperthreading CPUs a core equals a physical core and the hyperthread) to the IRQs as you will likely become more annoyed with the reduction of compute performance by that point.

That said I give you the final part of my hard work as of right now; ShieldedCPUallocator.sh (Click to show)
Code:
#!/bin/sh

#The use of this script is to allow isolating irqs to their own core
#Through the use of this isolation you can supposedly improve the irqs
#...functioning. Set the CPU # you want isolated after the isolcpus= boot
#...option to isolate it. IE 0=core1, 1=core2, etc.
#This requires "isolcpus= "boot option added to the /etc/default/grub file
#...in the GRUB_CMDLINE_LINUX_DEFAULT=" " line.
#Followed by sudo update-grub and then a reboot
#Also it requires irqbalance to be disabled by 
#editing /etc/default/irqbalance and change ENABLED="1" to "0"
#Finally it would benefit from adding these boot options...
#...acpi_irq_nobalance noirqbalance rcu_nocbs=$CPUsisolated acpi=noirq apic lapic as well to the DEFAULT line.
#This is an example script and you will need to change it to match...
#...the IRQs, the number of cores, and the needs you have.
#Chmod +x to enable
#########################################################################
#Common IRQs
#########################################################################
sudo taskset -cap 1 $(pgrep rtc0)
sudo taskset -cap 0 $(pgrep ahci)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/9-acpi' | cut -f1)
sudo taskset -cap 0 $(ps -ef | pgrep 'snd_hda' | cut -f1)
sudo taskset -cap 1 $(pgrep eth0)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/12-i8042' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/1-i8042' | cut -f1)

#########################################################################
#My desktop specific IRQs
#########################################################################
sudo taskset -cap 0 $(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/14-pata_ati' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/15-pata_ati' | cut -f1)
for pid in `ps -ef | grep irq/16-ohci_hcd | awk '{print $2}'` ; do sudo taskset -cap 0 $pid ; done
for pid in `ps -ef | grep irq/18-ohci_hcd | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/17-ehci_hcd' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/19-ehci_hcd' | cut -f1)

#########################################################################
#My laptop specific IRQs
#########################################################################
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/.*-i915' | cut -f1)
#sudo taskset -cap 0-1 $(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)

#########################################################################
#RCU processes
#########################################################################
for pid in `ps -ef | grep rcu | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done

#########################################################################
#Root processes (init's children included)
#########################################################################
#sudo taskset -cap 1 $(pgrep init) #if you touch init you touch it's children
sudo taskset -cap 1 $(pgrep udisksd)
sudo taskset -cap 1 $(pgrep systemd-shim)
sudo taskset -cap 1 $(pgrep dhclient)
sudo taskset -cap 1 $(pgrep polkitd)
sudo taskset -cap 1 $(pgrep NetworkManager)
sudo taskset -cap 1 $(pgrep nmbd)
sudo taskset -cap 1 $(pgrep ModemManager)
sudo taskset -cap 1 $(pgrep cupsd)
sudo taskset -cap 1 $(pgrep console-kit-daemon)
sudo taskset -cap 1 $(pgrep upowerd)
sudo taskset -cap 1 $(pgrep systemd-udevd)
sudo taskset -cap 1 $(pgrep upstart-file-bridge)
sudo taskset -cap 1 $(pgrep cups-browsed)
sudo taskset -cap 1 $(pgrep upstart-udev-bridge)
sudo taskset -cap 1 $(pgrep upstart-socket-bridge)
sudo taskset -cap 1 $(pgrep systemd-logind)
sudo taskset -cap 1 $(pgrep bluetoothd)
sudo taskset -cap 1 $(pgrep cron)
sudo taskset -cap 1 $(pgrep avahi-daemon:)
sudo taskset -cap 1 $(pgrep acpid)
sudo taskset -cap 1 $(pgrep colord)
sudo taskset -cap 1 $(pgrep accounts-daemon)
sudo taskset -cap 1 $(pgrep rsyslogd)
sudo taskset -cap 1 $(pgrep kerneloops)
sudo taskset -cap 1 $(pgrep whoopsie)
sudo taskset -cap 1 $(pgrep md)
for pid in `ps -ef | grep fsnotify_mark | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep jbd2/sda1-8 | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep smbd | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep winbindd | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep mount.ntfs | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep dbus-daemon | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep getty | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
for pid in `ps -ef | grep scsi | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done
#sudo taskset -cap 1 $(pgrep udisksd)
#sudo taskset -cap 1 $(pgrep udisksd)
#sudo taskset -cap 1 $(pgrep udisksd)

#########################################################################
#Kernel threads which I can't seem to move
#########################################################################
#sudo taskset -cap -1 $(pgrep kthreadd)
#sudo taskset -cap 1 $(pgrep ecryptfs-kthrea)
#sudo taskset -cap 1 $(pgrep kthrotld)
#sudo taskset -cap 1 $(ps -ef | pgrep 'hd-audio0' | cut -f1)
#sudo taskset -cap 1 $(pgrep edac-poller)
#sudo taskset -cap 1 $(pgrep khelper)
#sudo taskset -cap 1 $(pgrep kdevtmpfs)
#sudo taskset -cap 1 $(pgrep kintegrityd)
#sudo taskset -cap 1 $(pgrep khubd)
#sudo taskset -cap 1 $(pgrep khungtaskd)
#sudo taskset -cap 1 $(pgrep kswapd0)
#sudo taskset -cap 1 $(pgrep ksmd)
#sudo taskset -cap 1 $(pgrep khugepaged)
#sudo taskset -cap 1 $(pgrep kauditd)
#sudo taskset -cap 1 $(pgrep ata_sff)
#sudo taskset -cap 1 $(pgrep devfreq_wq)
#sudo taskset -cap 1 $(pgrep deferwq)
#sudo taskset -cap 1 $(pgrep kpsmoused)
#sudo taskset -cap 1 $(pgrep netns)
#sudo taskset -cap 1 $(pgrep bioset)
#sudo taskset -cap 1 $(pgrep ext4-rsv-conver)
#for pid in `ps -ef | grep writeback | awk '{print $2}'` ; do sudo taskset -cap 1 $pid ; done

#########################################################################
#Only add special userspace processes to the isolated cores IE Xorg
#lightdm is Xorg's parent so they need to be on the same cores
#########################################################################
sudo taskset -cap 0 $(pgrep Xorg)
for pid in `ps -ef | grep lightdm | awk '{print $2}'` ; do sudo taskset -cap 0 $pid ; done
#There's no point to touching the ksoftirqd processes as they are...
#..hard coded to each core and you would never want to move them.


This part is probably a mistake but I leave it for others to decide and test. But I'm pretty confident that if you aren't shielding/isolating cores yourself then it's best to let the kernel handle affinity/core dedication.

If you don't want to lose compute performance but get the best you can out of the realtime settings you make you can try this out but it probably isn't as good as allowing irqbalancing and acpi irqbalancing. Again the goal is to provide near deterministic running and avoidance of cache creation/sharing/destruction/moving latency. The best trade off between quality and performance comes from properly distributing IRQs across cores/threads and making sure related things such as your video IRQ and Xorg are on the same core/thread. So, it's up to you on an unshielded (lacking the isolcpu= boot option) whether you think you can do better than the kernel but I personally don't think in this case it will work out as well. Again, if you're not shielding (isolcpu= boot parameter) then there should be no need for managing processes. Stupid me thought there would be. redface.gif Just use the RTtweaker alone on unshielded setups.
UnshieldedCPUAllocation.sh (Click to show)
Code:
#!/bin/sh
#This is the non-isolated/shielded CPU allocation script.
#This is manual irqbalancing among other things.
#DO NOT USE IT WITH the isolcpu= acpi=noirq boot settings
#It will work best with acpi_irq_nobalance noirqbalance
#Chmod +x to enable
#########################################################################
#Common IRQs
#########################################################################
sudo taskset -cap 0 $(pgrep rtc0)
sudo taskset -cap 1 $(pgrep ahci)
sudo taskset -cap 2 $(ps -ef | pgrep 'irq/9-acpi' | cut -f1)
sudo taskset -cap 3 $(ps -ef | pgrep 'snd_hda' | cut -f1)
sudo taskset -cap 0 $(pgrep eth0)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/12-i8042' | cut -f1)
sudo taskset -cap 3 $(ps -ef | pgrep 'irq/1-i8042' | cut -f1)

#########################################################################
#My desktop specific IRQs
#########################################################################
#sudo taskset -cap 2 $(ps -ef | pgrep 'irq/.*-nvidia' | cut -f1)
#sudo taskset -cap 0 $(ps -ef | pgrep 'irq/14-pata_ati' | cut -f1)
#sudo taskset -cap 1 $(ps -ef | pgrep 'irq/15-pata_ati' | cut -f1)
#sudo taskset -cap 2 $(ps -ef | pgrep 'irq/18-ohci_hcd' | cut -f1)
#sudo taskset -cap 3 $(ps -ef | pgrep 'irq/16-ohci_hcd' | cut -f1)
#sudo taskset -cap 0 $(ps -ef | pgrep 'irq/17-ehci_hcd' | cut -f1)
#sudo taskset -cap 1 $(ps -ef | pgrep 'irq/19-ehci_hcd' | cut -f1)

#########################################################################
#My laptop specific IRQs
#########################################################################
sudo taskset -cap 3 $(ps -ef | pgrep 'irq/16-ehci_hcd' | cut -f1)
sudo taskset -cap 0 $(ps -ef | pgrep 'irq/23-ehci_hcd' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/40-xhci_hcd' | cut -f1)
sudo taskset -cap 2 $(ps -ef | pgrep 'irq/41-xhci_hcd' | cut -f1)
sudo taskset -cap 3 $(ps -ef | pgrep 'irq/42-xhci_hcd' | cut -f1)
sudo taskset -cap 0 $(ps -ef | pgrep 'irq/43-xhci_hcd' | cut -f1)
sudo taskset -cap 1 $(ps -ef | pgrep 'irq/44-xhci_hcd' | cut -f1)
sudo taskset -cap 3 $(ps -ef | pgrep 'irq/45-rtsx_pci' | cut -f1)
sudo taskset -cap 2 $(ps -ef | pgrep 'irq/.*-i915' | cut -f1)
sudo taskset -cap 0 $(ps -ef | pgrep 'irq/.*-iwlwifi' | cut -f1)

#########################################################################
#RCU processes
#########################################################################
sudo taskset -cap 0 $(pgrep rcu_sched)
sudo taskset -cap 1 $(pgrep rcuos/0)
sudo taskset -cap 2 $(pgrep rcuos/1)
sudo taskset -cap 3 $(pgrep rcuos/2)
sudo taskset -cap 0 $(pgrep rcuos/3)
sudo taskset -cap 1 $(pgrep rcuos/4)
sudo taskset -cap 2 $(pgrep rcuos/5)
sudo taskset -cap 3 $(pgrep rcuos/6)
sudo taskset -cap 0 $(pgrep rcuos/7)
sudo taskset -cap 1 $(pgrep rcu_bh)
sudo taskset -cap 2 $(pgrep rcuob/0)
sudo taskset -cap 3 $(pgrep rcuob/1)
sudo taskset -cap 0 $(pgrep rcuob/2)
sudo taskset -cap 1 $(pgrep rcuob/3)
sudo taskset -cap 2 $(pgrep rcuob/4)
sudo taskset -cap 3 $(pgrep rcuob/5)
sudo taskset -cap 0 $(pgrep rcuob/6)
sudo taskset -cap 1 $(pgrep rcuob/7)

#########################################################################
#Root processes (init's children included)
#########################################################################
#sudo taskset -cap 1 $(pgrep init) #if you touch init you touch it's children
sudo taskset -cap 0 $(pgrep udisksd)
sudo taskset -cap 1 $(pgrep systemd-shim)
sudo taskset -cap 2 $(pgrep dhclient)
sudo taskset -cap 3 $(pgrep polkitd)
sudo taskset -cap 0 $(pgrep NetworkManager)
sudo taskset -cap 1 $(pgrep nmbd)
sudo taskset -cap 2 $(pgrep ModemManager)
sudo taskset -cap 3 $(pgrep cupsd)
sudo taskset -cap 0 $(pgrep console-kit-daemon)
sudo taskset -cap 1 $(pgrep upowerd)
sudo taskset -cap 2 $(pgrep systemd-udevd)
sudo taskset -cap 3 $(pgrep upstart-file-bridge)
sudo taskset -cap 0 $(pgrep cups-browsed)
sudo taskset -cap 1 $(pgrep upstart-udev-bridge)
sudo taskset -cap 2 $(pgrep upstart-socket-bridge)
sudo taskset -cap 3 $(pgrep systemd-logind)
sudo taskset -cap 0 $(pgrep bluetoothd)
sudo taskset -cap 1 $(pgrep cron)
sudo taskset -cap 2 $(pgrep avahi-daemon:)
sudo taskset -cap 3 $(pgrep acpid)
sudo taskset -cap 0 $(pgrep colord)
sudo taskset -cap 1 $(pgrep accounts-daemon)
sudo taskset -cap 2 $(pgrep rsyslogd)
sudo taskset -cap 3 $(pgrep kerneloops)
sudo taskset -cap 0 $(pgrep whoopsie)
#sudo taskset -cap 1 $(pgrep udisksd)
#sudo taskset -cap 1 $(pgrep udisksd)
#sudo taskset -cap 1 $(pgrep udisksd)

#########################################################################
#Kernel threads which I can't seem to move
#########################################################################
#sudo taskset -cap -1 $(pgrep kthreadd)
#sudo taskset -cap 1 $(pgrep ecryptfs-kthrea)
#sudo taskset -cap 1 $(pgrep kthrotld)
#sudo taskset -cap 1 $(ps -ef | pgrep 'hd-audio0' | cut -f1)
#sudo taskset -cap 1 $(pgrep edac-poller)

#########################################################################
#Shared name processes I need to figure out how to handle
#########################################################################
#sudo taskset -cap 1 $(pgrep smbd)
#sudo taskset -cap 1 $(pgrep winbindd)
#sudo taskset -cap 1 $(pgrep lightdm)
#sudo taskset -cap 1 $(pgrep mount.ntfs)
#sudo taskset -cap 1 $(pgrep dbus-daemon)

#########################################################################
#Only add special userspace processes to the isolated cores IE Xorg
#Match Xorg to your GPU's IRQ core location
#########################################################################
sudo taskset -cap 2 $(pgrep Xorg)


GENERIC GENERALIZED EXAMPLE:
Examples of how one might isolate things: 1 core for IRQs, 1 core for root/daemons/rcus, 1 core for kernel threads (if I can figure out how to move them), and one core for the GUI/userspace world. This would probably max out the media production/consumption potential of the system from what could be done with the CPU and OS but would heavily sacrifice compute performance. In my current system I'm testing between 1 core for IRQs, 1 core for root/daemons/rcus, and 2 for userspace (and kernel as I can't move those threads yet), some kind of total process balance along those isolated cores, or possibly 1 core for IRQs and let the scheduler handle the rest on the other 3 cores. Needless to say there are so many potential combinations this might take me a while.

Research Sources

Explains the importance of shielding/isolating CPUs/Cores for RT work

Another source that uses cpusets for shielding RT work

This source mainly shows the pros/cons of a preemptable RT kernel in unshielded configuration.

This is a really good link
A recent paper from IBM that covers some of the things that I stumbled upon on my own such as core isolation and how that benefits RT work and even explains how putting all cores on one isolated core can be better than balanced among all cores but is weak/worse if a large enough workload falls on an I/O bound IRQs such as network or disks.


Current news
OK...this is the final update for myself for a while as I'm just going crazy with the research. It's so beyond me (I'm just a simple accountant).

Right now I'd love for someone to help me figure a few things out:
1) why I can't move some processes with taskset (IE can't move something like hd-audio0 and the error I get is basically "you can't do that Dave")
2) how to make a better script than what I've got (I'll face it that right now what I've got is nothing more than chains of commands)
----This script would be more interactive instead of manual among other things. Hit me up with a PM if you want details of the requirements.
3) a numad or cgroup version of the isolation/dedication technique. With systemd coming I'm sure the cgroups version is going to be the requirement in the future.

Full credit and possibly cookies will go to anyone whom provides help on those 4 points. thumb.gif


In the mean time I'm still trying to figure out why my kernel wasn't using apic and why irqbalance doesn't seem to actually work on any of my systems even when forced through the kernel. Thanks for dealing with my stupidity guys. redface.gif
Edited by Rookie1337 - 11/8/14 at 8:26am
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #2 of 47
I've not played around with IRQ's since the 90s so probably not the best person to comment, but I can't see any problem with experimenting. The worst you'll do is make Linux unstable. However I'd be surprised if you gain anything tangible from the experiments aside a few experience points.
post #3 of 47
How will you improve a digital video signal by doing this?
post #4 of 47
You won't. You'll reduce the input delay and decrease the time prior to initialization of the devices at boot. We utilize small tricks like this in critical low power applications; for example Kiosks, ECMs etc... We'll place the devices we need online lower on the IRQ table... the gains with a multi-threaded processor and a highly clocked northbridge are probably negligible.
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #5 of 47
Thread Starter 
So how come most of the realtime audio guides mention this as a method for preparing for audio processing and say "it helps reduce glitches and decreases in audio quality by preventing other proccesses from interrupting until the process fully finished everything it wants"? I don't want to say that I'm immune to placeboing but it seems that this has greatly improved responsiveness for my Nvidia GPU and I can say there sure is a difference (but you wouldn't notice it without going this high) in color quality and contrast quality (especially during my XBMC HD runs). I guess to answer captain blame's question could it be because they now have such a high priority that they can include/process more fully details on time and in full without interruption. But then I have to wonder why wouldn't the kernel allow drivers/their irqs this level of realtime access by default? Seems like a strange thing. And again..this was basically a little adaption from the real time guides for setting up JACK and real time audio work. They focused on audio related irqs. I threw in my nvidia card (the nvidia irq) as well because I also wanted to see if the work transfers over to video and it seems to. The big part for me is how to figure out what irq(s) are part of my disk drives (HDD,SSD) because after a while I get a 1/2 second pause in xbmc but it almost always occurs in a multi-file BD rip (or maybe it's the quantum time?). No major issue like that in L4D2 and it seemed to have fixed the microstuttering I was having with that game.

I know you guys didn't try the work I've done with pulseaudio...but could someone check and confirm or debunk this? And if you do find it makes a difference could you help me figure out what irq for drives?
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #6 of 47
It may actually do those things in the audio world. For video processing I doubt you'd see any gains. For audio processing, lower IRQ channels might be beneficial in some other way that I don't know about. Especially since it would in theory reduce the delay in the audio processing and increase the processing priority at a hardware level. That might reduce some noise that would be introduced otherwise via throttling or command queuing I don't know though. I'd like to read about it though, maybe after I get off work for the day.
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #7 of 47
Greetz
I used to be obsessive about this low-level ordering but things have changed and mostly for the better. I don't think you can get a simple binary confirm/deny answer for general usage on this because there are so many variables. For starters how old is the box? Does it have a BIOS or UEFI? If it has UEFI is it set to legacy or not? Is it an OEM or an enthusiast performance mobo? What quality peripherals? How far off reference and how well done? Are you running a single GPU or SLI/Crossfire?

Remember that when PNP began everything was ISA and most SOHO computers utilized few intelligent busses (although iirc Macs utilized SCSI bus and later FireWire which btw was far more independent than USB, but even that has caught up). Now, everyone disables the old Serial and Parallel "dumb" busses and we have dedicated Graphics busses and there has always been virtualization, even on 286's where up to 256 virtual serial ports were possible.

The point is that so much of what was handled by the clunky old BIOS has been handed off to busses and the OpSys that things are no longer centralized and simple, and this started a long time ago.. I'm afraid this is going to be specific to individual sets of hardware and software and many interactions, at least on full-fledged PCs. Dedicated embedded systems are vastly simpler but even those may be difficult to arrive at some General Truth. It's worth trying if for no other reason that the learning, but on complex modern systems the gains will be small and pale compared to carefully chosen, improved quality hardware and a well-balanced system.
Edited by enorbet2 - 3/31/14 at 7:33am
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
post #8 of 47
Thread Starter 
I really wish I knew I was smart enough to understand what you were getting at @enorbet2.

Maybe someone can explain something programming related to me...if you have a process that is at the same priority as many others would it produce as good results as if it were on a higher priority shared by maybe one or 2 others? In other words...does priority/time without interruption affect the end of a process if that process is judged by not just being responsive but also being correct? I ask because I only dealt with the most basic of systems in my single programming class which didn't deal with anything more than one program which was needed to get the robot to do the tasks I needed (scan a room, find the greatest heat source, aim the fan in that direction, turn on the fan,and so on...). I guess the simplistic question I have is whether there would be a difference in quality of two pieces of hardware if one was in a general purpose OS and one was in a stripped down embedded OS? IE...if the GPU of a Bluray player was instead under a Linux OS would it look better or worse?

At the very least I at least added to my limited scripting skills even if the script itself is useless. Now I have pgrep in my toolbox:
The sad script (Click to show)
Code:
#!/bin/bash

#This is an experiment that probably doesn't do anything
#The goal was to see if changing the irqs of certain things would...
#...affect the quality and/or responsiveness of those things.
#Examples where the irqs of video and audio hardware.
#Thus this scrpit is designed to raise those irqs very high.
#This must be enabled first to give proper quantum timing and keep things somewhat stable
sudo chrt -f -p 95 $(pgrep rtc0)
#For an Nvidia related GPU system
sudo chrt -f -p 94 $(pgrep nvidia)
#For Intel HD 2000/3000/4000
sudo chrt -f -p 94 $(pgrep i915)
#To improve the audio of the system
sudo chrt -f -p 94 $(pgrep snd_hda)
#This is a check to show that the changes occured
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep "FF"
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #9 of 47
Rookie no offence but there are a lot more valuable things to learn in the Linux world than mucking with IRQs. Even if it yielded a small improvement, I would still say you wasting your time, time you could better spend learning shell scripting for example.
post #10 of 47
Quote:
Originally Posted by CaptainBlame View Post

Rookie no offence but there are a lot more valuable things to learn in the Linux world than mucking with IRQs. Even if it yielded a small improvement, I would still say you wasting your time, time you could better spend learning shell scripting for example.

I think you're missing the point of why he's doing this.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Experiment/Theory] Messing with the irqs of certain things to increase their response/quality