This tool can be used to move IRQs assigned to a device to a specific CPU.
It's a simple shell script that takes two arguments, device name and cpu. IRQs are determined by device name.
Signed-off-by: Jan Tluka jtluka@redhat.com --- test_tools/pin_dev_irqs/lnst-setup.sh | 4 ++++ test_tools/pin_dev_irqs/pin_dev_irqs.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 test_tools/pin_dev_irqs/lnst-setup.sh create mode 100755 test_tools/pin_dev_irqs/pin_dev_irqs.sh
diff --git a/test_tools/pin_dev_irqs/lnst-setup.sh b/test_tools/pin_dev_irqs/lnst-setup.sh new file mode 100755 index 0000000..feab344 --- /dev/null +++ b/test_tools/pin_dev_irqs/lnst-setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +chmod u+x pin_dev_irqs.sh + diff --git a/test_tools/pin_dev_irqs/pin_dev_irqs.sh b/test_tools/pin_dev_irqs/pin_dev_irqs.sh new file mode 100755 index 0000000..316f14d --- /dev/null +++ b/test_tools/pin_dev_irqs/pin_dev_irqs.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +DEV=$1 +CPU=$2 + +dev_irqs=`grep $DEV /proc/interrupts | cut -f1 -d: | sed 's/ //'` + +for irq in $dev_irqs; do + echo "current cpu list for irq $irq" + cat /proc/irq/$irq/smp_affinity_list + echo "reassigning irq $irq to cpu $CPU" + echo $CPU > /proc/irq/$irq/smp_affinity_list +done +
We've discussed this in person, just sending an email so that it's archived and in case anyone else want's to join to conversation:
* The test tool should also disable irqbalance so that we don't have to do it manually outside of this tool.
* It would be nice to have an option of "unpinning" the irqs for the cleanup phase of the recipe.
-Ondrej
On Tue, Nov 10, 2015 at 05:53:31PM +0100, Jan Tluka wrote:
This tool can be used to move IRQs assigned to a device to a specific CPU.
It's a simple shell script that takes two arguments, device name and cpu. IRQs are determined by device name.
Signed-off-by: Jan Tluka jtluka@redhat.com
test_tools/pin_dev_irqs/lnst-setup.sh | 4 ++++ test_tools/pin_dev_irqs/pin_dev_irqs.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 test_tools/pin_dev_irqs/lnst-setup.sh create mode 100755 test_tools/pin_dev_irqs/pin_dev_irqs.sh
diff --git a/test_tools/pin_dev_irqs/lnst-setup.sh b/test_tools/pin_dev_irqs/lnst-setup.sh new file mode 100755 index 0000000..feab344 --- /dev/null +++ b/test_tools/pin_dev_irqs/lnst-setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash
+chmod u+x pin_dev_irqs.sh
diff --git a/test_tools/pin_dev_irqs/pin_dev_irqs.sh b/test_tools/pin_dev_irqs/pin_dev_irqs.sh new file mode 100755 index 0000000..316f14d --- /dev/null +++ b/test_tools/pin_dev_irqs/pin_dev_irqs.sh @@ -0,0 +1,14 @@ +#!/bin/bash
+DEV=$1 +CPU=$2
+dev_irqs=`grep $DEV /proc/interrupts | cut -f1 -d: | sed 's/ //'`
+for irq in $dev_irqs; do
- echo "current cpu list for irq $irq"
- cat /proc/irq/$irq/smp_affinity_list
- echo "reassigning irq $irq to cpu $CPU"
- echo $CPU > /proc/irq/$irq/smp_affinity_list
+done
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
I'll do this some other way.
lnst-developers@lists.fedorahosted.org