Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irq_poll: make blk-iopoll available outside the block layer

The new name is irq_poll as iopoll is already taken. Better suggestions
welcome.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>

+143 -138
+1 -1
Documentation/kernel-per-CPU-kthreads.txt
··· 90 90 from being initiated from tasks that might run on the CPU to 91 91 be de-jittered. (It is OK to force this CPU offline and then 92 92 bring it back online before you start your application.) 93 - BLOCK_IOPOLL_SOFTIRQ: Do all of the following: 93 + IRQ_POLL_SOFTIRQ: Do all of the following: 94 94 1. Force block-device interrupts onto some other CPU. 95 95 2. Initiate any block I/O and block-I/O polling on other CPUs. 96 96 3. Once your application has started, prevent CPU-hotplug operations
+1 -1
block/Makefile
··· 5 5 obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \ 6 6 blk-flush.o blk-settings.o blk-ioc.o blk-map.o \ 7 7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ 8 - blk-iopoll.o blk-lib.o blk-mq.o blk-mq-tag.o \ 8 + blk-lib.o blk-mq.o blk-mq-tag.o \ 9 9 blk-mq-sysfs.o blk-mq-cpu.o blk-mq-cpumap.o ioctl.o \ 10 10 genhd.o scsi_ioctl.o partition-generic.o ioprio.o \ 11 11 partitions/
+51 -54
block/blk-iopoll.c lib/irq_poll.c
··· 6 6 #include <linux/module.h> 7 7 #include <linux/init.h> 8 8 #include <linux/bio.h> 9 - #include <linux/blkdev.h> 10 9 #include <linux/interrupt.h> 11 10 #include <linux/cpu.h> 12 - #include <linux/blk-iopoll.h> 11 + #include <linux/irq_poll.h> 13 12 #include <linux/delay.h> 14 13 15 - #include "blk.h" 16 - 17 - static unsigned int blk_iopoll_budget __read_mostly = 256; 14 + static unsigned int irq_poll_budget __read_mostly = 256; 18 15 19 16 static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll); 20 17 21 18 /** 22 - * blk_iopoll_sched - Schedule a run of the iopoll handler 19 + * irq_poll_sched - Schedule a run of the iopoll handler 23 20 * @iop: The parent iopoll structure 24 21 * 25 22 * Description: 26 - * Add this blk_iopoll structure to the pending poll list and trigger the 23 + * Add this irq_poll structure to the pending poll list and trigger the 27 24 * raise of the blk iopoll softirq. The driver must already have gotten a 28 - * successful return from blk_iopoll_sched_prep() before calling this. 25 + * successful return from irq_poll_sched_prep() before calling this. 29 26 **/ 30 - void blk_iopoll_sched(struct blk_iopoll *iop) 27 + void irq_poll_sched(struct irq_poll *iop) 31 28 { 32 29 unsigned long flags; 33 30 34 31 local_irq_save(flags); 35 32 list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll)); 36 - __raise_softirq_irqoff(BLOCK_IOPOLL_SOFTIRQ); 33 + __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); 37 34 local_irq_restore(flags); 38 35 } 39 - EXPORT_SYMBOL(blk_iopoll_sched); 36 + EXPORT_SYMBOL(irq_poll_sched); 40 37 41 38 /** 42 - * __blk_iopoll_complete - Mark this @iop as un-polled again 39 + * __irq_poll_complete - Mark this @iop as un-polled again 43 40 * @iop: The parent iopoll structure 44 41 * 45 42 * Description: 46 - * See blk_iopoll_complete(). This function must be called with interrupts 43 + * See irq_poll_complete(). This function must be called with interrupts 47 44 * disabled. 48 45 **/ 49 - void __blk_iopoll_complete(struct blk_iopoll *iop) 46 + void __irq_poll_complete(struct irq_poll *iop) 50 47 { 51 48 list_del(&iop->list); 52 49 smp_mb__before_atomic(); 53 - clear_bit_unlock(IOPOLL_F_SCHED, &iop->state); 50 + clear_bit_unlock(IRQ_POLL_F_SCHED, &iop->state); 54 51 } 55 - EXPORT_SYMBOL(__blk_iopoll_complete); 52 + EXPORT_SYMBOL(__irq_poll_complete); 56 53 57 54 /** 58 - * blk_iopoll_complete - Mark this @iop as un-polled again 55 + * irq_poll_complete - Mark this @iop as un-polled again 59 56 * @iop: The parent iopoll structure 60 57 * 61 58 * Description: 62 59 * If a driver consumes less than the assigned budget in its run of the 63 60 * iopoll handler, it'll end the polled mode by calling this function. The 64 - * iopoll handler will not be invoked again before blk_iopoll_sched_prep() 61 + * iopoll handler will not be invoked again before irq_poll_sched_prep() 65 62 * is called. 66 63 **/ 67 - void blk_iopoll_complete(struct blk_iopoll *iop) 64 + void irq_poll_complete(struct irq_poll *iop) 68 65 { 69 66 unsigned long flags; 70 67 71 68 local_irq_save(flags); 72 - __blk_iopoll_complete(iop); 69 + __irq_poll_complete(iop); 73 70 local_irq_restore(flags); 74 71 } 75 - EXPORT_SYMBOL(blk_iopoll_complete); 72 + EXPORT_SYMBOL(irq_poll_complete); 76 73 77 - static void blk_iopoll_softirq(struct softirq_action *h) 74 + static void irq_poll_softirq(struct softirq_action *h) 78 75 { 79 76 struct list_head *list = this_cpu_ptr(&blk_cpu_iopoll); 80 - int rearm = 0, budget = blk_iopoll_budget; 77 + int rearm = 0, budget = irq_poll_budget; 81 78 unsigned long start_time = jiffies; 82 79 83 80 local_irq_disable(); 84 81 85 82 while (!list_empty(list)) { 86 - struct blk_iopoll *iop; 83 + struct irq_poll *iop; 87 84 int work, weight; 88 85 89 86 /* ··· 98 101 * entries to the tail of this list, and only ->poll() 99 102 * calls can remove this head entry from the list. 100 103 */ 101 - iop = list_entry(list->next, struct blk_iopoll, list); 104 + iop = list_entry(list->next, struct irq_poll, list); 102 105 103 106 weight = iop->weight; 104 107 work = 0; 105 - if (test_bit(IOPOLL_F_SCHED, &iop->state)) 108 + if (test_bit(IRQ_POLL_F_SCHED, &iop->state)) 106 109 work = iop->poll(iop, weight); 107 110 108 111 budget -= work; ··· 118 121 * move the instance around on the list at-will. 119 122 */ 120 123 if (work >= weight) { 121 - if (blk_iopoll_disable_pending(iop)) 122 - __blk_iopoll_complete(iop); 124 + if (irq_poll_disable_pending(iop)) 125 + __irq_poll_complete(iop); 123 126 else 124 127 list_move_tail(&iop->list, list); 125 128 } 126 129 } 127 130 128 131 if (rearm) 129 - __raise_softirq_irqoff(BLOCK_IOPOLL_SOFTIRQ); 132 + __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); 130 133 131 134 local_irq_enable(); 132 135 } 133 136 134 137 /** 135 - * blk_iopoll_disable - Disable iopoll on this @iop 138 + * irq_poll_disable - Disable iopoll on this @iop 136 139 * @iop: The parent iopoll structure 137 140 * 138 141 * Description: 139 142 * Disable io polling and wait for any pending callbacks to have completed. 140 143 **/ 141 - void blk_iopoll_disable(struct blk_iopoll *iop) 144 + void irq_poll_disable(struct irq_poll *iop) 142 145 { 143 - set_bit(IOPOLL_F_DISABLE, &iop->state); 144 - while (test_and_set_bit(IOPOLL_F_SCHED, &iop->state)) 146 + set_bit(IRQ_POLL_F_DISABLE, &iop->state); 147 + while (test_and_set_bit(IRQ_POLL_F_SCHED, &iop->state)) 145 148 msleep(1); 146 - clear_bit(IOPOLL_F_DISABLE, &iop->state); 149 + clear_bit(IRQ_POLL_F_DISABLE, &iop->state); 147 150 } 148 - EXPORT_SYMBOL(blk_iopoll_disable); 151 + EXPORT_SYMBOL(irq_poll_disable); 149 152 150 153 /** 151 - * blk_iopoll_enable - Enable iopoll on this @iop 154 + * irq_poll_enable - Enable iopoll on this @iop 152 155 * @iop: The parent iopoll structure 153 156 * 154 157 * Description: 155 158 * Enable iopoll on this @iop. Note that the handler run will not be 156 159 * scheduled, it will only mark it as active. 157 160 **/ 158 - void blk_iopoll_enable(struct blk_iopoll *iop) 161 + void irq_poll_enable(struct irq_poll *iop) 159 162 { 160 - BUG_ON(!test_bit(IOPOLL_F_SCHED, &iop->state)); 163 + BUG_ON(!test_bit(IRQ_POLL_F_SCHED, &iop->state)); 161 164 smp_mb__before_atomic(); 162 - clear_bit_unlock(IOPOLL_F_SCHED, &iop->state); 165 + clear_bit_unlock(IRQ_POLL_F_SCHED, &iop->state); 163 166 } 164 - EXPORT_SYMBOL(blk_iopoll_enable); 167 + EXPORT_SYMBOL(irq_poll_enable); 165 168 166 169 /** 167 - * blk_iopoll_init - Initialize this @iop 170 + * irq_poll_init - Initialize this @iop 168 171 * @iop: The parent iopoll structure 169 172 * @weight: The default weight (or command completion budget) 170 173 * @poll_fn: The handler to invoke 171 174 * 172 175 * Description: 173 - * Initialize this blk_iopoll structure. Before being actively used, the 174 - * driver must call blk_iopoll_enable(). 176 + * Initialize this irq_poll structure. Before being actively used, the 177 + * driver must call irq_poll_enable(). 175 178 **/ 176 - void blk_iopoll_init(struct blk_iopoll *iop, int weight, blk_iopoll_fn *poll_fn) 179 + void irq_poll_init(struct irq_poll *iop, int weight, irq_poll_fn *poll_fn) 177 180 { 178 181 memset(iop, 0, sizeof(*iop)); 179 182 INIT_LIST_HEAD(&iop->list); 180 183 iop->weight = weight; 181 184 iop->poll = poll_fn; 182 - set_bit(IOPOLL_F_SCHED, &iop->state); 185 + set_bit(IRQ_POLL_F_SCHED, &iop->state); 183 186 } 184 - EXPORT_SYMBOL(blk_iopoll_init); 187 + EXPORT_SYMBOL(irq_poll_init); 185 188 186 - static int blk_iopoll_cpu_notify(struct notifier_block *self, 189 + static int irq_poll_cpu_notify(struct notifier_block *self, 187 190 unsigned long action, void *hcpu) 188 191 { 189 192 /* ··· 196 199 local_irq_disable(); 197 200 list_splice_init(&per_cpu(blk_cpu_iopoll, cpu), 198 201 this_cpu_ptr(&blk_cpu_iopoll)); 199 - __raise_softirq_irqoff(BLOCK_IOPOLL_SOFTIRQ); 202 + __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); 200 203 local_irq_enable(); 201 204 } 202 205 203 206 return NOTIFY_OK; 204 207 } 205 208 206 - static struct notifier_block blk_iopoll_cpu_notifier = { 207 - .notifier_call = blk_iopoll_cpu_notify, 209 + static struct notifier_block irq_poll_cpu_notifier = { 210 + .notifier_call = irq_poll_cpu_notify, 208 211 }; 209 212 210 - static __init int blk_iopoll_setup(void) 213 + static __init int irq_poll_setup(void) 211 214 { 212 215 int i; 213 216 214 217 for_each_possible_cpu(i) 215 218 INIT_LIST_HEAD(&per_cpu(blk_cpu_iopoll, i)); 216 219 217 - open_softirq(BLOCK_IOPOLL_SOFTIRQ, blk_iopoll_softirq); 218 - register_hotcpu_notifier(&blk_iopoll_cpu_notifier); 220 + open_softirq(IRQ_POLL_SOFTIRQ, irq_poll_softirq); 221 + register_hotcpu_notifier(&irq_poll_cpu_notifier); 219 222 return 0; 220 223 } 221 - subsys_initcall(blk_iopoll_setup); 224 + subsys_initcall(irq_poll_setup);
+1
drivers/scsi/Kconfig
··· 1102 1102 tristate "IBM Power Linux RAID adapter support" 1103 1103 depends on PCI && SCSI && ATA 1104 1104 select FW_LOADER 1105 + select IRQ_POLL 1105 1106 ---help--- 1106 1107 This driver supports the IBM Power Linux family RAID adapters. 1107 1108 This includes IBM pSeries 5712, 5703, 5709, and 570A, as well
+1
drivers/scsi/be2iscsi/Kconfig
··· 3 3 depends on PCI && SCSI && NET 4 4 select SCSI_ISCSI_ATTRS 5 5 select ISCSI_BOOT_SYSFS 6 + select IRQ_POLL 6 7 7 8 help 8 9 This driver implements the iSCSI functionality for Emulex
+2 -2
drivers/scsi/be2iscsi/be.h
··· 20 20 21 21 #include <linux/pci.h> 22 22 #include <linux/if_vlan.h> 23 - #include <linux/blk-iopoll.h> 23 + #include <linux/irq_poll.h> 24 24 #define FW_VER_LEN 32 25 25 #define MCC_Q_LEN 128 26 26 #define MCC_CQ_LEN 256 ··· 101 101 struct beiscsi_hba *phba; 102 102 struct be_queue_info *cq; 103 103 struct work_struct work_cqs; /* Work Item */ 104 - struct blk_iopoll iopoll; 104 + struct irq_poll iopoll; 105 105 }; 106 106 107 107 struct be_mcc_obj {
+2 -2
drivers/scsi/be2iscsi/be_iscsi.c
··· 1292 1292 1293 1293 for (i = 0; i < phba->num_cpus; i++) { 1294 1294 pbe_eq = &phwi_context->be_eq[i]; 1295 - blk_iopoll_disable(&pbe_eq->iopoll); 1295 + irq_poll_disable(&pbe_eq->iopoll); 1296 1296 beiscsi_process_cq(pbe_eq); 1297 - blk_iopoll_enable(&pbe_eq->iopoll); 1297 + irq_poll_enable(&pbe_eq->iopoll); 1298 1298 } 1299 1299 } 1300 1300
+12 -12
drivers/scsi/be2iscsi/be_main.c
··· 910 910 num_eq_processed = 0; 911 911 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32] 912 912 & EQE_VALID_MASK) { 913 - if (!blk_iopoll_sched_prep(&pbe_eq->iopoll)) 914 - blk_iopoll_sched(&pbe_eq->iopoll); 913 + if (!irq_poll_sched_prep(&pbe_eq->iopoll)) 914 + irq_poll_sched(&pbe_eq->iopoll); 915 915 916 916 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0); 917 917 queue_tail_inc(eq); ··· 972 972 spin_unlock_irqrestore(&phba->isr_lock, flags); 973 973 num_mcceq_processed++; 974 974 } else { 975 - if (!blk_iopoll_sched_prep(&pbe_eq->iopoll)) 976 - blk_iopoll_sched(&pbe_eq->iopoll); 975 + if (!irq_poll_sched_prep(&pbe_eq->iopoll)) 976 + irq_poll_sched(&pbe_eq->iopoll); 977 977 num_ioeq_processed++; 978 978 } 979 979 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0); ··· 2295 2295 hwi_ring_eq_db(phba, pbe_eq->q.id, 0, 0, 1, 1); 2296 2296 } 2297 2297 2298 - static int be_iopoll(struct blk_iopoll *iop, int budget) 2298 + static int be_iopoll(struct irq_poll *iop, int budget) 2299 2299 { 2300 2300 unsigned int ret; 2301 2301 struct beiscsi_hba *phba; ··· 2306 2306 pbe_eq->cq_count += ret; 2307 2307 if (ret < budget) { 2308 2308 phba = pbe_eq->phba; 2309 - blk_iopoll_complete(iop); 2309 + irq_poll_complete(iop); 2310 2310 beiscsi_log(phba, KERN_INFO, 2311 2311 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO, 2312 2312 "BM_%d : rearm pbe_eq->q.id =%d\n", ··· 5293 5293 5294 5294 for (i = 0; i < phba->num_cpus; i++) { 5295 5295 pbe_eq = &phwi_context->be_eq[i]; 5296 - blk_iopoll_disable(&pbe_eq->iopoll); 5296 + irq_poll_disable(&pbe_eq->iopoll); 5297 5297 } 5298 5298 5299 5299 if (unload_state == BEISCSI_CLEAN_UNLOAD) { ··· 5579 5579 5580 5580 for (i = 0; i < phba->num_cpus; i++) { 5581 5581 pbe_eq = &phwi_context->be_eq[i]; 5582 - blk_iopoll_init(&pbe_eq->iopoll, be_iopoll_budget, 5582 + irq_poll_init(&pbe_eq->iopoll, be_iopoll_budget, 5583 5583 be_iopoll); 5584 - blk_iopoll_enable(&pbe_eq->iopoll); 5584 + irq_poll_enable(&pbe_eq->iopoll); 5585 5585 } 5586 5586 5587 5587 i = (phba->msix_enabled) ? i : 0; ··· 5752 5752 5753 5753 for (i = 0; i < phba->num_cpus; i++) { 5754 5754 pbe_eq = &phwi_context->be_eq[i]; 5755 - blk_iopoll_init(&pbe_eq->iopoll, be_iopoll_budget, 5755 + irq_poll_init(&pbe_eq->iopoll, be_iopoll_budget, 5756 5756 be_iopoll); 5757 - blk_iopoll_enable(&pbe_eq->iopoll); 5757 + irq_poll_enable(&pbe_eq->iopoll); 5758 5758 } 5759 5759 5760 5760 i = (phba->msix_enabled) ? i : 0; ··· 5795 5795 destroy_workqueue(phba->wq); 5796 5796 for (i = 0; i < phba->num_cpus; i++) { 5797 5797 pbe_eq = &phwi_context->be_eq[i]; 5798 - blk_iopoll_disable(&pbe_eq->iopoll); 5798 + irq_poll_disable(&pbe_eq->iopoll); 5799 5799 } 5800 5800 free_twq: 5801 5801 beiscsi_clean_port(phba);
+14 -14
drivers/scsi/ipr.c
··· 3638 3638 .store = ipr_store_reset_adapter 3639 3639 }; 3640 3640 3641 - static int ipr_iopoll(struct blk_iopoll *iop, int budget); 3641 + static int ipr_iopoll(struct irq_poll *iop, int budget); 3642 3642 /** 3643 3643 * ipr_show_iopoll_weight - Show ipr polling mode 3644 3644 * @dev: class device struct ··· 3681 3681 int i; 3682 3682 3683 3683 if (!ioa_cfg->sis64) { 3684 - dev_info(&ioa_cfg->pdev->dev, "blk-iopoll not supported on this adapter\n"); 3684 + dev_info(&ioa_cfg->pdev->dev, "irq_poll not supported on this adapter\n"); 3685 3685 return -EINVAL; 3686 3686 } 3687 3687 if (kstrtoul(buf, 10, &user_iopoll_weight)) 3688 3688 return -EINVAL; 3689 3689 3690 3690 if (user_iopoll_weight > 256) { 3691 - dev_info(&ioa_cfg->pdev->dev, "Invalid blk-iopoll weight. It must be less than 256\n"); 3691 + dev_info(&ioa_cfg->pdev->dev, "Invalid irq_poll weight. It must be less than 256\n"); 3692 3692 return -EINVAL; 3693 3693 } 3694 3694 3695 3695 if (user_iopoll_weight == ioa_cfg->iopoll_weight) { 3696 - dev_info(&ioa_cfg->pdev->dev, "Current blk-iopoll weight has the same weight\n"); 3696 + dev_info(&ioa_cfg->pdev->dev, "Current irq_poll weight has the same weight\n"); 3697 3697 return strlen(buf); 3698 3698 } 3699 3699 3700 3700 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 3701 3701 for (i = 1; i < ioa_cfg->hrrq_num; i++) 3702 - blk_iopoll_disable(&ioa_cfg->hrrq[i].iopoll); 3702 + irq_poll_disable(&ioa_cfg->hrrq[i].iopoll); 3703 3703 } 3704 3704 3705 3705 spin_lock_irqsave(shost->host_lock, lock_flags); 3706 3706 ioa_cfg->iopoll_weight = user_iopoll_weight; 3707 3707 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 3708 3708 for (i = 1; i < ioa_cfg->hrrq_num; i++) { 3709 - blk_iopoll_init(&ioa_cfg->hrrq[i].iopoll, 3709 + irq_poll_init(&ioa_cfg->hrrq[i].iopoll, 3710 3710 ioa_cfg->iopoll_weight, ipr_iopoll); 3711 - blk_iopoll_enable(&ioa_cfg->hrrq[i].iopoll); 3711 + irq_poll_enable(&ioa_cfg->hrrq[i].iopoll); 3712 3712 } 3713 3713 } 3714 3714 spin_unlock_irqrestore(shost->host_lock, lock_flags); ··· 5569 5569 return num_hrrq; 5570 5570 } 5571 5571 5572 - static int ipr_iopoll(struct blk_iopoll *iop, int budget) 5572 + static int ipr_iopoll(struct irq_poll *iop, int budget) 5573 5573 { 5574 5574 struct ipr_ioa_cfg *ioa_cfg; 5575 5575 struct ipr_hrr_queue *hrrq; ··· 5585 5585 completed_ops = ipr_process_hrrq(hrrq, budget, &doneq); 5586 5586 5587 5587 if (completed_ops < budget) 5588 - blk_iopoll_complete(iop); 5588 + irq_poll_complete(iop); 5589 5589 spin_unlock_irqrestore(hrrq->lock, hrrq_flags); 5590 5590 5591 5591 list_for_each_entry_safe(ipr_cmd, temp, &doneq, queue) { ··· 5693 5693 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 5694 5694 if ((be32_to_cpu(*hrrq->hrrq_curr) & IPR_HRRQ_TOGGLE_BIT) == 5695 5695 hrrq->toggle_bit) { 5696 - if (!blk_iopoll_sched_prep(&hrrq->iopoll)) 5697 - blk_iopoll_sched(&hrrq->iopoll); 5696 + if (!irq_poll_sched_prep(&hrrq->iopoll)) 5697 + irq_poll_sched(&hrrq->iopoll); 5698 5698 spin_unlock_irqrestore(hrrq->lock, hrrq_flags); 5699 5699 return IRQ_HANDLED; 5700 5700 } ··· 10405 10405 10406 10406 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 10407 10407 for (i = 1; i < ioa_cfg->hrrq_num; i++) { 10408 - blk_iopoll_init(&ioa_cfg->hrrq[i].iopoll, 10408 + irq_poll_init(&ioa_cfg->hrrq[i].iopoll, 10409 10409 ioa_cfg->iopoll_weight, ipr_iopoll); 10410 - blk_iopoll_enable(&ioa_cfg->hrrq[i].iopoll); 10410 + irq_poll_enable(&ioa_cfg->hrrq[i].iopoll); 10411 10411 } 10412 10412 } 10413 10413 ··· 10436 10436 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 10437 10437 ioa_cfg->iopoll_weight = 0; 10438 10438 for (i = 1; i < ioa_cfg->hrrq_num; i++) 10439 - blk_iopoll_disable(&ioa_cfg->hrrq[i].iopoll); 10439 + irq_poll_disable(&ioa_cfg->hrrq[i].iopoll); 10440 10440 } 10441 10441 10442 10442 while (ioa_cfg->in_reset_reload) {
+2 -2
drivers/scsi/ipr.h
··· 32 32 #include <linux/libata.h> 33 33 #include <linux/list.h> 34 34 #include <linux/kref.h> 35 - #include <linux/blk-iopoll.h> 35 + #include <linux/irq_poll.h> 36 36 #include <scsi/scsi.h> 37 37 #include <scsi/scsi_cmnd.h> 38 38 ··· 517 517 u8 allow_cmds:1; 518 518 u8 removing_ioa:1; 519 519 520 - struct blk_iopoll iopoll; 520 + struct irq_poll iopoll; 521 521 }; 522 522 523 523 /* Command packet structure */
-46
include/linux/blk-iopoll.h
··· 1 - #ifndef BLK_IOPOLL_H 2 - #define BLK_IOPOLL_H 3 - 4 - struct blk_iopoll; 5 - typedef int (blk_iopoll_fn)(struct blk_iopoll *, int); 6 - 7 - struct blk_iopoll { 8 - struct list_head list; 9 - unsigned long state; 10 - unsigned long data; 11 - int weight; 12 - int max; 13 - blk_iopoll_fn *poll; 14 - }; 15 - 16 - enum { 17 - IOPOLL_F_SCHED = 0, 18 - IOPOLL_F_DISABLE = 1, 19 - }; 20 - 21 - /* 22 - * Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating 23 - * that we were the first to acquire this iop for scheduling. If this iop 24 - * is currently disabled, return "failure". 25 - */ 26 - static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) 27 - { 28 - if (!test_bit(IOPOLL_F_DISABLE, &iop->state)) 29 - return test_and_set_bit(IOPOLL_F_SCHED, &iop->state); 30 - 31 - return 1; 32 - } 33 - 34 - static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) 35 - { 36 - return test_bit(IOPOLL_F_DISABLE, &iop->state); 37 - } 38 - 39 - extern void blk_iopoll_sched(struct blk_iopoll *); 40 - extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *); 41 - extern void blk_iopoll_complete(struct blk_iopoll *); 42 - extern void __blk_iopoll_complete(struct blk_iopoll *); 43 - extern void blk_iopoll_enable(struct blk_iopoll *); 44 - extern void blk_iopoll_disable(struct blk_iopoll *); 45 - 46 - #endif
+1 -1
include/linux/interrupt.h
··· 412 412 NET_TX_SOFTIRQ, 413 413 NET_RX_SOFTIRQ, 414 414 BLOCK_SOFTIRQ, 415 - BLOCK_IOPOLL_SOFTIRQ, 415 + IRQ_POLL_SOFTIRQ, 416 416 TASKLET_SOFTIRQ, 417 417 SCHED_SOFTIRQ, 418 418 HRTIMER_SOFTIRQ, /* Unused, but kept as tools rely on the
+46
include/linux/irq_poll.h
··· 1 + #ifndef IRQ_POLL_H 2 + #define IRQ_POLL_H 3 + 4 + struct irq_poll; 5 + typedef int (irq_poll_fn)(struct irq_poll *, int); 6 + 7 + struct irq_poll { 8 + struct list_head list; 9 + unsigned long state; 10 + unsigned long data; 11 + int weight; 12 + int max; 13 + irq_poll_fn *poll; 14 + }; 15 + 16 + enum { 17 + IRQ_POLL_F_SCHED = 0, 18 + IRQ_POLL_F_DISABLE = 1, 19 + }; 20 + 21 + /* 22 + * Returns 0 if we successfully set the IRQ_POLL_F_SCHED bit, indicating 23 + * that we were the first to acquire this iop for scheduling. If this iop 24 + * is currently disabled, return "failure". 25 + */ 26 + static inline int irq_poll_sched_prep(struct irq_poll *iop) 27 + { 28 + if (!test_bit(IRQ_POLL_F_DISABLE, &iop->state)) 29 + return test_and_set_bit(IRQ_POLL_F_SCHED, &iop->state); 30 + 31 + return 1; 32 + } 33 + 34 + static inline int irq_poll_disable_pending(struct irq_poll *iop) 35 + { 36 + return test_bit(IRQ_POLL_F_DISABLE, &iop->state); 37 + } 38 + 39 + extern void irq_poll_sched(struct irq_poll *); 40 + extern void irq_poll_init(struct irq_poll *, int, irq_poll_fn *); 41 + extern void irq_poll_complete(struct irq_poll *); 42 + extern void __irq_poll_complete(struct irq_poll *); 43 + extern void irq_poll_enable(struct irq_poll *); 44 + extern void irq_poll_disable(struct irq_poll *); 45 + 46 + #endif
+1 -1
include/trace/events/irq.h
··· 15 15 softirq_name(NET_TX) \ 16 16 softirq_name(NET_RX) \ 17 17 softirq_name(BLOCK) \ 18 - softirq_name(BLOCK_IOPOLL) \ 18 + softirq_name(IRQ_POLL) \ 19 19 softirq_name(TASKLET) \ 20 20 softirq_name(SCHED) \ 21 21 softirq_name(HRTIMER) \
+5
lib/Kconfig
··· 475 475 information. This data is useful for drivers handling 476 476 DDR SDRAM controllers. 477 477 478 + config IRQ_POLL 479 + bool "IRQ polling library" 480 + help 481 + Helper library to poll interrupt mitigation using polling. 482 + 478 483 config MPILIB 479 484 tristate 480 485 select CLZ_TAB
+1
lib/Makefile
··· 164 164 165 165 obj-$(CONFIG_SG_SPLIT) += sg_split.o 166 166 obj-$(CONFIG_STMP_DEVICE) += stmp_device.o 167 + obj-$(CONFIG_IRQ_POLL) += irq_poll.o 167 168 168 169 libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \ 169 170 fdt_empty_tree.o
+1 -1
tools/lib/traceevent/event-parse.c
··· 3746 3746 { "NET_TX_SOFTIRQ", 2 }, 3747 3747 { "NET_RX_SOFTIRQ", 3 }, 3748 3748 { "BLOCK_SOFTIRQ", 4 }, 3749 - { "BLOCK_IOPOLL_SOFTIRQ", 5 }, 3749 + { "IRQ_POLL_SOFTIRQ", 5 }, 3750 3750 { "TASKLET_SOFTIRQ", 6 }, 3751 3751 { "SCHED_SOFTIRQ", 7 }, 3752 3752 { "HRTIMER_SOFTIRQ", 8 },
+1 -1
tools/perf/util/trace-event-parse.c
··· 209 209 { "NET_TX_SOFTIRQ", 2 }, 210 210 { "NET_RX_SOFTIRQ", 3 }, 211 211 { "BLOCK_SOFTIRQ", 4 }, 212 - { "BLOCK_IOPOLL_SOFTIRQ", 5 }, 212 + { "IRQ_POLL_SOFTIRQ", 5 }, 213 213 { "TASKLET_SOFTIRQ", 6 }, 214 214 { "SCHED_SOFTIRQ", 7 }, 215 215 { "HRTIMER_SOFTIRQ", 8 },