aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-03-13 11:38:42 -0400
committerJens Axboe <axboe@fb.com>2014-03-13 11:38:42 -0400
commit89f8b33ca1ea881d1d84542282cb85d07d02e78d (patch)
treeaec73b5cbf9e2c1baed0ecaf03a2a2093df26b6f
parentaf5040da01ef980670b3741b3e10733ee3e33566 (diff)
block: remove old blk_iopoll_enabled variable
This was a debugging measure to toggle enabled/disabled when testing. But for real production setups, it's not safe to toggle this setting without either reloading drivers of quiescing IO first. Neither of which the toggle enforces. Additionally, it makes drivers deal with the conditional state. Remove it completely. It's up to the driver whether iopoll is enabled or not. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/blk-iopoll.c3
-rw-r--r--drivers/scsi/be2iscsi/be_main.c206
-rw-r--r--drivers/scsi/ipr.c15
-rw-r--r--include/linux/blk-iopoll.h2
-rw-r--r--kernel/sysctl.c12
5 files changed, 68 insertions, 170 deletions
diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
index 1855bf51edb0..c11d24e379e2 100644
--- a/block/blk-iopoll.c
+++ b/block/blk-iopoll.c
@@ -14,9 +14,6 @@
14 14
15#include "blk.h" 15#include "blk.h"
16 16
17int blk_iopoll_enabled = 1;
18EXPORT_SYMBOL(blk_iopoll_enabled);
19
20static unsigned int blk_iopoll_budget __read_mostly = 256; 17static unsigned int blk_iopoll_budget __read_mostly = 256;
21 18
22static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll); 19static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 1f375051483a..a929c3c9aedc 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -873,7 +873,6 @@ static irqreturn_t be_isr_msix(int irq, void *dev_id)
873 struct be_queue_info *cq; 873 struct be_queue_info *cq;
874 unsigned int num_eq_processed; 874 unsigned int num_eq_processed;
875 struct be_eq_obj *pbe_eq; 875 struct be_eq_obj *pbe_eq;
876 unsigned long flags;
877 876
878 pbe_eq = dev_id; 877 pbe_eq = dev_id;
879 eq = &pbe_eq->q; 878 eq = &pbe_eq->q;
@@ -882,31 +881,15 @@ static irqreturn_t be_isr_msix(int irq, void *dev_id)
882 881
883 phba = pbe_eq->phba; 882 phba = pbe_eq->phba;
884 num_eq_processed = 0; 883 num_eq_processed = 0;
885 if (blk_iopoll_enabled) { 884 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32]
886 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32] 885 & EQE_VALID_MASK) {
887 & EQE_VALID_MASK) { 886 if (!blk_iopoll_sched_prep(&pbe_eq->iopoll))
888 if (!blk_iopoll_sched_prep(&pbe_eq->iopoll)) 887 blk_iopoll_sched(&pbe_eq->iopoll);
889 blk_iopoll_sched(&pbe_eq->iopoll);
890
891 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
892 queue_tail_inc(eq);
893 eqe = queue_tail_node(eq);
894 num_eq_processed++;
895 }
896 } else {
897 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32]
898 & EQE_VALID_MASK) {
899 spin_lock_irqsave(&phba->isr_lock, flags);
900 pbe_eq->todo_cq = true;
901 spin_unlock_irqrestore(&phba->isr_lock, flags);
902 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
903 queue_tail_inc(eq);
904 eqe = queue_tail_node(eq);
905 num_eq_processed++;
906 }
907 888
908 if (pbe_eq->todo_cq) 889 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
909 queue_work(phba->wq, &pbe_eq->work_cqs); 890 queue_tail_inc(eq);
891 eqe = queue_tail_node(eq);
892 num_eq_processed++;
910 } 893 }
911 894
912 if (num_eq_processed) 895 if (num_eq_processed)
@@ -927,7 +910,6 @@ static irqreturn_t be_isr(int irq, void *dev_id)
927 struct hwi_context_memory *phwi_context; 910 struct hwi_context_memory *phwi_context;
928 struct be_eq_entry *eqe = NULL; 911 struct be_eq_entry *eqe = NULL;
929 struct be_queue_info *eq; 912 struct be_queue_info *eq;
930 struct be_queue_info *cq;
931 struct be_queue_info *mcc; 913 struct be_queue_info *mcc;
932 unsigned long flags, index; 914 unsigned long flags, index;
933 unsigned int num_mcceq_processed, num_ioeq_processed; 915 unsigned int num_mcceq_processed, num_ioeq_processed;
@@ -953,72 +935,40 @@ static irqreturn_t be_isr(int irq, void *dev_id)
953 935
954 num_ioeq_processed = 0; 936 num_ioeq_processed = 0;
955 num_mcceq_processed = 0; 937 num_mcceq_processed = 0;
956 if (blk_iopoll_enabled) { 938 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32]
957 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32] 939 & EQE_VALID_MASK) {
958 & EQE_VALID_MASK) { 940 if (((eqe->dw[offsetof(struct amap_eq_entry,
959 if (((eqe->dw[offsetof(struct amap_eq_entry, 941 resource_id) / 32] &
960 resource_id) / 32] & 942 EQE_RESID_MASK) >> 16) == mcc->id) {
961 EQE_RESID_MASK) >> 16) == mcc->id) { 943 spin_lock_irqsave(&phba->isr_lock, flags);
962 spin_lock_irqsave(&phba->isr_lock, flags); 944 pbe_eq->todo_mcc_cq = true;
963 pbe_eq->todo_mcc_cq = true; 945 spin_unlock_irqrestore(&phba->isr_lock, flags);
964 spin_unlock_irqrestore(&phba->isr_lock, flags); 946 num_mcceq_processed++;
965 num_mcceq_processed++; 947 } else {
966 } else { 948 if (!blk_iopoll_sched_prep(&pbe_eq->iopoll))
967 if (!blk_iopoll_sched_prep(&pbe_eq->iopoll)) 949 blk_iopoll_sched(&pbe_eq->iopoll);
968 blk_iopoll_sched(&pbe_eq->iopoll);
969 num_ioeq_processed++;
970 }
971 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
972 queue_tail_inc(eq);
973 eqe = queue_tail_node(eq);
974 }
975 if (num_ioeq_processed || num_mcceq_processed) {
976 if (pbe_eq->todo_mcc_cq)
977 queue_work(phba->wq, &pbe_eq->work_cqs);
978
979 if ((num_mcceq_processed) && (!num_ioeq_processed))
980 hwi_ring_eq_db(phba, eq->id, 0,
981 (num_ioeq_processed +
982 num_mcceq_processed) , 1, 1);
983 else
984 hwi_ring_eq_db(phba, eq->id, 0,
985 (num_ioeq_processed +
986 num_mcceq_processed), 0, 1);
987
988 return IRQ_HANDLED;
989 } else
990 return IRQ_NONE;
991 } else {
992 cq = &phwi_context->be_cq[0];
993 while (eqe->dw[offsetof(struct amap_eq_entry, valid) / 32]
994 & EQE_VALID_MASK) {
995
996 if (((eqe->dw[offsetof(struct amap_eq_entry,
997 resource_id) / 32] &
998 EQE_RESID_MASK) >> 16) != cq->id) {
999 spin_lock_irqsave(&phba->isr_lock, flags);
1000 pbe_eq->todo_mcc_cq = true;
1001 spin_unlock_irqrestore(&phba->isr_lock, flags);
1002 } else {
1003 spin_lock_irqsave(&phba->isr_lock, flags);
1004 pbe_eq->todo_cq = true;
1005 spin_unlock_irqrestore(&phba->isr_lock, flags);
1006 }
1007 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
1008 queue_tail_inc(eq);
1009 eqe = queue_tail_node(eq);
1010 num_ioeq_processed++; 950 num_ioeq_processed++;
1011 } 951 }
1012 if (pbe_eq->todo_cq || pbe_eq->todo_mcc_cq) 952 AMAP_SET_BITS(struct amap_eq_entry, valid, eqe, 0);
953 queue_tail_inc(eq);
954 eqe = queue_tail_node(eq);
955 }
956 if (num_ioeq_processed || num_mcceq_processed) {
957 if (pbe_eq->todo_mcc_cq)
1013 queue_work(phba->wq, &pbe_eq->work_cqs); 958 queue_work(phba->wq, &pbe_eq->work_cqs);
1014 959
1015 if (num_ioeq_processed) { 960 if ((num_mcceq_processed) && (!num_ioeq_processed))
1016 hwi_ring_eq_db(phba, eq->id, 0, 961 hwi_ring_eq_db(phba, eq->id, 0,
1017 num_ioeq_processed, 1, 1); 962 (num_ioeq_processed +
1018 return IRQ_HANDLED; 963 num_mcceq_processed) , 1, 1);
1019 } else 964 else
1020 return IRQ_NONE; 965 hwi_ring_eq_db(phba, eq->id, 0,
1021 } 966 (num_ioeq_processed +
967 num_mcceq_processed), 0, 1);
968
969 return IRQ_HANDLED;
970 } else
971 return IRQ_NONE;
1022} 972}
1023 973
1024static int beiscsi_init_irqs(struct beiscsi_hba *phba)