Skip to content

Commit a161046

Browse files
davejiangvinodkoul
authored andcommitted
dmaengine: idxd: remove MSIX masking for interrupt handlers
Remove interrupt masking and just let the hard irq handler keep firing for new events. This is less of a performance impact vs the MMIO readback inside the pci_msi_{mask,unmas}_irq(). Especially with a loaded system those flushes can be stuck behind large amounts of MMIO writes to flush. When guest kernel is running on top of VFIO mdev, mask/unmask causes a vmexit each time and is not desirable. Suggested-by: Dan Williams <[email protected]> Signed-off-by: Dave Jiang <[email protected]> Reviewed-by: Dan Williams <[email protected]> Link: https://lore.kernel.org/r/161894523436.3210025.1834640110556139277.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <[email protected]>
1 parent 53b2ee7 commit a161046

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

drivers/dma/idxd/idxd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ void idxd_wqs_quiesce(struct idxd_device *idxd);
377377
/* device interrupt control */
378378
void idxd_msix_perm_setup(struct idxd_device *idxd);
379379
void idxd_msix_perm_clear(struct idxd_device *idxd);
380-
irqreturn_t idxd_irq_handler(int vec, void *data);
381380
irqreturn_t idxd_misc_thread(int vec, void *data);
382381
irqreturn_t idxd_wq_thread(int irq, void *data);
383382
void idxd_mask_error_interrupts(struct idxd_device *idxd);

drivers/dma/idxd/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int idxd_setup_interrupts(struct idxd_device *idxd)
102102
}
103103

104104
irq_entry = &idxd->irq_entries[0];
105-
rc = request_threaded_irq(irq_entry->vector, idxd_irq_handler, idxd_misc_thread,
105+
rc = request_threaded_irq(irq_entry->vector, NULL, idxd_misc_thread,
106106
0, "idxd-misc", irq_entry);
107107
if (rc < 0) {
108108
dev_err(dev, "Failed to allocate misc interrupt.\n");
@@ -119,7 +119,7 @@ static int idxd_setup_interrupts(struct idxd_device *idxd)
119119

120120
init_llist_head(&idxd->irq_entries[i].pending_llist);
121121
INIT_LIST_HEAD(&idxd->irq_entries[i].work_list);
122-
rc = request_threaded_irq(irq_entry->vector, idxd_irq_handler,
122+
rc = request_threaded_irq(irq_entry->vector, NULL,
123123
idxd_wq_thread, 0, "idxd-portal", irq_entry);
124124
if (rc < 0) {
125125
dev_err(dev, "Failed to allocate irq %d.\n", irq_entry->vector);

drivers/dma/idxd/irq.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,6 @@ static int idxd_device_schedule_fault_process(struct idxd_device *idxd,
102102
return 0;
103103
}
104104

105-
irqreturn_t idxd_irq_handler(int vec, void *data)
106-
{
107-
struct idxd_irq_entry *irq_entry = data;
108-
struct idxd_device *idxd = irq_entry->idxd;
109-
110-
idxd_mask_msix_vector(idxd, irq_entry->id);
111-
return IRQ_WAKE_THREAD;
112-
}
113-
114105
static int process_misc_interrupts(struct idxd_device *idxd, u32 cause)
115106
{
116107
struct device *dev = &idxd->pdev->dev;
@@ -237,7 +228,6 @@ irqreturn_t idxd_misc_thread(int vec, void *data)
237228
iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
238229
}
239230

240-
idxd_unmask_msix_vector(idxd, irq_entry->id);
241231
return IRQ_HANDLED;
242232
}
243233

@@ -394,8 +384,6 @@ irqreturn_t idxd_wq_thread(int irq, void *data)
394384
int processed;
395385

396386
processed = idxd_desc_process(irq_entry);
397-
idxd_unmask_msix_vector(irq_entry->idxd, irq_entry->id);
398-
399387
if (processed == 0)
400388
return IRQ_NONE;
401389

0 commit comments

Comments
 (0)