Messages in this thread | | | Subject | Re: [PATCH] genirq: Add default affinity mask command line option | From | Rik van Riel <> | Date | Wed, 3 Feb 2016 14:12:22 -0500 |
| |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 02/03/2016 01:52 PM, Thomas Gleixner wrote: > From: Thomas Gleixner <tglx@linutronix.de> Date: Fri May 25 > 16:59:47 2012 +0200 Subject: genirq: Add default affinity mask > command line option > > If we isolate CPUs, then we don't want random device interrupts on > them. Even w/o the user space irq balancer enabled we can end up > with irqs on non boot cpus and chasing newly requested interrupts > is a tedious task.
The userspace irqbalance daemon has code nowadays to prevent it from putting irqs on isolated CPUs.
> Allow to restrict the default irq affinity mask.
However, not placing them on there at boot time is a great enhancement, too.
> --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -24,10 > +24,27 @@ static struct lock_class_key irq_desc_lock_class; > > #if defined(CONFIG_SMP) +static int __init irq_affinity_setup(char > *str) +{ + zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); + > cpulist_parse(str, irq_default_affinity); + /* + * Set at least > the boot cpu. We don't want to end up with + * bugreports caused > by random comandline masks + */ + > cpumask_set_cpu(smp_processor_id(), irq_default_affinity); + return > 1; +} +__setup("irqaffinity=", irq_affinity_setup); + static void > __init init_irq_default_affinity(void) { - > alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); - > cpumask_setall(irq_default_affinity); +#ifdef > CONFIG_CPUMASK_OFFSTACK + if (!irq_default_affinity) + > zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); +#endif + if > (cpumask_empty(irq_default_affinity)) + > cpumask_setall(irq_default_affinity); }
Would it make sense to key off the isolated_cpus mask if isolated_cpus= was specified, but no irqaffinity mask was specified?
Is there any use case where we would want irqs on isolated cpus by default, and could not bear the cost of reassigning them from userspace after boot?
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJWslEWAAoJEM553pKExN6Dju0IAKDxqU2zS3rcC5jGfogfN9Q7 4XFOksNJ2VLfpDR/tSw6LTIkrDyl4BvhWv0WXcathfl3yVh1TEPsSWLUi1/ctL8U SbxK1+zZvja9UXjPL/KDoJLeaQTd9C8nA+lhP+UUkR/A3g23WezFcJVB+a8CYaqg pBQ4G1pz2xSfzraRe9HzzIb076QuieVUDllc+rdVxjBQRhmTBJ40MIxspTdRpNCY wx7PadVP5UiY/gPX7Q+KrQNlybBs3x0dq4DenaOmpULeBa1sdpgeRJX8K01OcXgE 1wcKk8RYmzgw2SPNvkO97Gyl8Acj24+ceHerzMmV2aUiWS98LU3faISQgB2ZUwg= =+ZYl -----END PGP SIGNATURE-----
| |