Message ID | 20181204155122.6327-4-douliyangs@gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Series | irq/core: Fix and expand the irq affinity descriptor | expand |
On Tue, 4 Dec 2018, Dou Liyang wrote: > In case of irq_default_affinity != cpu_possible_mask, setting the affinity > for the pre/post vectors to irq_default_affinity is a breakage. Why so? All interrupts which are not managed get te default affinity mask. It can be different than cpu_possible_mask, but that's what the admin has set. The affinity of these non-managed interrupts can still be set via /proc/... so where is the breakage? Thanks, tglx
Hi tglx, on 2018/12/5 16:28, Thomas Gleixner wrote: > On Tue, 4 Dec 2018, Dou Liyang wrote: > >> In case of irq_default_affinity != cpu_possible_mask, setting the affinity >> for the pre/post vectors to irq_default_affinity is a breakage. > > Why so? All interrupts which are not managed get te default affinity > mask. It can be different than cpu_possible_mask, but that's what the admin > has set. The affinity of these non-managed interrupts can still be set via > /proc/... so where is the breakage? I misunderstood it. please ignore this, ;-) Thanks, dou
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d122575ba1b4..aaa1dd82c3df 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -257,7 +257,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) /* Fill out vectors at the beginning that don't need affinity */ for (curvec = 0; curvec < affd->pre_vectors; curvec++) - cpumask_copy(&masks[curvec].mask, irq_default_affinity); + cpumask_copy(&masks[curvec].mask, cpu_possible_mask); /* * Spread on present CPUs starting from affd->pre_vectors. If we * have multiple sets, build each sets affinity mask separately. @@ -282,12 +282,15 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) } /* Fill out vectors at the end that don't need affinity */ - if (usedvecs >= affvecs) + if (usedvecs >= affvecs) { curvec = affd->pre_vectors + affvecs; - else + } else { curvec = affd->pre_vectors + usedvecs; + for (; curvec < affd->pre_vectors + affvecs; curvec++) + cpumask_copy(&masks[curvec].mask, irq_default_affinity); + } for (; curvec < nvecs; curvec++) - cpumask_copy(&masks[curvec].mask, irq_default_affinity); + cpumask_copy(&masks[curvec].mask, cpu_possible_mask); /* Setup complementary information */ for (i = 0; i < nvecs; i++) {
In case of irq_default_affinity != cpu_possible_mask, setting the affinity for the pre/post vectors to irq_default_affinity is a breakage. Just set the pre/post vectors to cpu_possible_mask and be done with it. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dou Liyang <douliyangs@gmail.com> --- kernel/irq/affinity.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)