Commit 98624899 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target patches from Nicholas Bellinger:
 "Here are the remaining target-pending patches for v3.9-rc1.

  The most important one here is the immediate queue starvation
  regression fix for iscsi-target, which addresses a bug that's
  effecting v3.5+ kernels under heavy sustained READ only workloads.
  Thanks alot to Benjamin Estrabaud for helping to track this down!

  Also included is a pSCSI exception bugfix from Asias, along with a
  handful of other minor changes.  Both bugfixes are CC'ed to stable."

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target/pscsi: Rename sg_num to nr_vecs in pscsi_get_bio()
  target/pscsi: Fix page increment
  target/pscsi: Drop unnecessary NULL assignment to bio->bi_next
  target: Add __exit annotation for module_exit functions
  iscsi-target: Fix immediate queue starvation regression with DATAIN
parents 426d266c 2dbe10a2
...@@ -3584,6 +3584,10 @@ static int handle_response_queue(struct iscsi_conn *conn) ...@@ -3584,6 +3584,10 @@ static int handle_response_queue(struct iscsi_conn *conn)
spin_lock_bh(&cmd->istate_lock); spin_lock_bh(&cmd->istate_lock);
cmd->i_state = ISTATE_SENT_STATUS; cmd->i_state = ISTATE_SENT_STATUS;
spin_unlock_bh(&cmd->istate_lock); spin_unlock_bh(&cmd->istate_lock);
if (atomic_read(&conn->check_immediate_queue))
return 1;
continue; continue;
} else if (ret == 2) { } else if (ret == 2) {
/* Still must send status, /* Still must send status,
...@@ -3673,7 +3677,7 @@ static int handle_response_queue(struct iscsi_conn *conn) ...@@ -3673,7 +3677,7 @@ static int handle_response_queue(struct iscsi_conn *conn)
} }
if (atomic_read(&conn->check_immediate_queue)) if (atomic_read(&conn->check_immediate_queue))
break; return 1;
} }
return 0; return 0;
...@@ -3717,12 +3721,15 @@ int iscsi_target_tx_thread(void *arg) ...@@ -3717,12 +3721,15 @@ int iscsi_target_tx_thread(void *arg)
signal_pending(current)) signal_pending(current))
goto transport_err; goto transport_err;
get_immediate:
ret = handle_immediate_queue(conn); ret = handle_immediate_queue(conn);
if (ret < 0) if (ret < 0)
goto transport_err; goto transport_err;
ret = handle_response_queue(conn); ret = handle_response_queue(conn);
if (ret == -EAGAIN) if (ret == 1)
goto get_immediate;
else if (ret == -EAGAIN)
goto restart; goto restart;
else if (ret < 0) else if (ret < 0)
goto transport_err; goto transport_err;
......
...@@ -2598,7 +2598,7 @@ static int __init sbp_init(void) ...@@ -2598,7 +2598,7 @@ static int __init sbp_init(void)
return 0; return 0;
}; };
static void sbp_exit(void) static void __exit sbp_exit(void)
{ {
sbp_deregister_configfs(); sbp_deregister_configfs();
}; };
......
...@@ -631,7 +631,7 @@ static int __init fileio_module_init(void) ...@@ -631,7 +631,7 @@ static int __init fileio_module_init(void)
return transport_subsystem_register(&fileio_template); return transport_subsystem_register(&fileio_template);
} }
static void fileio_module_exit(void) static void __exit fileio_module_exit(void)
{ {
transport_subsystem_release(&fileio_template); transport_subsystem_release(&fileio_template);
} }
......
...@@ -821,7 +821,7 @@ static int __init iblock_module_init(void) ...@@ -821,7 +821,7 @@ static int __init iblock_module_init(void)
return transport_subsystem_register(&iblock_template); return transport_subsystem_register(&iblock_template);
} }
static void iblock_module_exit(void) static void __exit iblock_module_exit(void)
{ {
transport_subsystem_release(&iblock_template); transport_subsystem_release(&iblock_template);
} }
......
...@@ -840,14 +840,14 @@ static void pscsi_bi_endio(struct bio *bio, int error) ...@@ -840,14 +840,14 @@ static void pscsi_bi_endio(struct bio *bio, int error)
bio_put(bio); bio_put(bio);
} }
static inline struct bio *pscsi_get_bio(int sg_num) static inline struct bio *pscsi_get_bio(int nr_vecs)
{ {
struct bio *bio; struct bio *bio;
/* /*
* Use bio_malloc() following the comment in for bio -> struct request * Use bio_malloc() following the comment in for bio -> struct request
* in block/blk-core.c:blk_make_request() * in block/blk-core.c:blk_make_request()
*/ */
bio = bio_kmalloc(GFP_KERNEL, sg_num); bio = bio_kmalloc(GFP_KERNEL, nr_vecs);
if (!bio) { if (!bio) {
pr_err("PSCSI: bio_kmalloc() failed\n"); pr_err("PSCSI: bio_kmalloc() failed\n");
return NULL; return NULL;
...@@ -940,7 +940,6 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, ...@@ -940,7 +940,6 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
bio = NULL; bio = NULL;
} }
page++;
len -= bytes; len -= bytes;
data_len -= bytes; data_len -= bytes;
off = 0; off = 0;
...@@ -952,7 +951,6 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, ...@@ -952,7 +951,6 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
while (*hbio) { while (*hbio) {
bio = *hbio; bio = *hbio;
*hbio = (*hbio)->bi_next; *hbio = (*hbio)->bi_next;
bio->bi_next = NULL;
bio_endio(bio, 0); /* XXX: should be error */ bio_endio(bio, 0); /* XXX: should be error */
} }
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
...@@ -1092,7 +1090,6 @@ pscsi_execute_cmd(struct se_cmd *cmd) ...@@ -1092,7 +1090,6 @@ pscsi_execute_cmd(struct se_cmd *cmd)
while (hbio) { while (hbio) {
struct bio *bio = hbio; struct bio *bio = hbio;
hbio = hbio->bi_next; hbio = hbio->bi_next;
bio->bi_next = NULL;
bio_endio(bio, 0); /* XXX: should be error */ bio_endio(bio, 0); /* XXX: should be error */
} }
ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
...@@ -1178,7 +1175,7 @@ static int __init pscsi_module_init(void) ...@@ -1178,7 +1175,7 @@ static int __init pscsi_module_init(void)
return transport_subsystem_register(&pscsi_template); return transport_subsystem_register(&pscsi_template);
} }
static void pscsi_module_exit(void) static void __exit pscsi_module_exit(void)
{ {
transport_subsystem_release(&pscsi_template); transport_subsystem_release(&pscsi_template);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment