Thread (21 messages) 21 messages, 5 authors, 2021-06-18

Re: [patch v6 3/7] genirq/affinity: Add new callback for (re)calculating interrupt sets

From: Thomas Gleixner <hidden>
Date: 2021-06-18 19:19:19
Also in: linux-nvme, linux-pci, lkml

On Tue, Jun 15 2021 at 14:57, Bjorn Helgaas wrote:
quoted
@@ -1196,6 +1196,13 @@ int pci_alloc_irq_vectors_affinity(struc
 	/* use legacy irq if allowed */
 	if (flags & PCI_IRQ_LEGACY) {
 		if (min_vecs == 1 && dev->irq) {
+			/*
+			 * Invoke the affinity spreading logic to ensure that
+			 * the device driver can adjust queue configuration
+			 * for the single interrupt case.
+			 */
+			if (affd)
+				irq_create_affinity_masks(1, affd);
This looks like a leak because irq_create_affinity_masks() returns a
pointer to kcalloc()ed space, but we throw away the pointer.

Or is there something very subtle going on here, like this special
case doesn't allocate anything?  I do see the "Nothing to assign?"
case that returns NULL with no alloc, but it's not completely trivial
to verify that we take that case here.
Yes, it's subtle and it's subtle crap. Sorry that I did not catch that.

Thanks,

        tglx
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help