diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 14:43:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 14:43:27 -0500 |
commit | 986248993d495aebffcdf0758ce28ab85aa4e9ff (patch) | |
tree | 850c037dc3cb992ae1eb93bb05038f2fed95d70a /drivers/target | |
parent | 426d266c12e9116497e3055212f823a56e1a6914 (diff) | |
parent | 2dbe10a202d2743582b5fb7c9864455ef6ecf9a6 (diff) |
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
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 11 | ||||
-rw-r--r-- | drivers/target/sbp/sbp_target.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_file.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_iblock.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_pscsi.c | 9 |
5 files changed, 15 insertions, 11 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 9435a3d369a7..7ea246a07731 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -3584,6 +3584,10 @@ check_rsp_state: | |||
3584 | spin_lock_bh(&cmd->istate_lock); | 3584 | spin_lock_bh(&cmd->istate_lock); |
3585 | cmd->i_state = ISTATE_SENT_STATUS; | 3585 | cmd->i_state = ISTATE_SENT_STATUS; |
3586 | spin_unlock_bh(&cmd->istate_lock); | 3586 | spin_unlock_bh(&cmd->istate_lock); |
3587 | |||
3588 | if (atomic_read(&conn->check_immediate_queue)) | ||
3589 | return 1; | ||
3590 | |||
3587 | continue; | 3591 | continue; |
3588 | } else if (ret == 2) { | 3592 | } else if (ret == 2) { |
3589 | /* Still must send status, | 3593 | /* Still must send status, |
@@ -3673,7 +3677,7 @@ check_rsp_state: | |||
3673 | } | 3677 | } |
3674 | 3678 | ||
3675 | if (atomic_read(&conn->check_immediate_queue)) | 3679 | if (atomic_read(&conn->check_immediate_queue)) |
3676 | break; | 3680 | return 1; |
3677 | } | 3681 | } |
3678 | 3682 | ||
3679 | return 0; | 3683 | return 0; |
@@ -3717,12 +3721,15 @@ restart: | |||
3717 | signal_pending(current)) | 3721 | signal_pending(current)) |
3718 | goto transport_err; | 3722 | goto transport_err; |
3719 | 3723 | ||
3724 | get_immediate: | ||
3720 | ret = handle_immediate_queue(conn); | 3725 | ret = handle_immediate_queue(conn); |
3721 | if (ret < 0) | 3726 | if (ret < 0) |
3722 | goto transport_err; | 3727 | goto transport_err; |
3723 | 3728 | ||
3724 | ret = handle_response_queue(conn); | 3729 | ret = handle_response_queue(conn); |
3725 | if (ret == -EAGAIN) | 3730 | if (ret == 1) |
3731 | goto get_immediate; | ||
3732 | else if (ret == -EAGAIN) | ||
3726 | goto restart; | 3733 | goto restart; |
3727 | else if (ret < 0) | 3734 | else if (ret < 0) |
3728 | goto transport_err; | 3735 | goto transport_err; |
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 6917a9e938e7..d3536f57444f 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -2598,7 +2598,7 @@ static int __init sbp_init(void) | |||
2598 | return 0; | 2598 | return 0; |
2599 | }; | 2599 | }; |
2600 | 2600 | ||
2601 | static void sbp_exit(void) | 2601 | static void __exit sbp_exit(void) |
2602 | { | 2602 | { |
2603 | sbp_deregister_configfs(); | 2603 | sbp_deregister_configfs(); |
2604 | }; | 2604 | }; |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index d226c10a985b..17a6acbc3ab0 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -631,7 +631,7 @@ static int __init fileio_module_init(void) | |||
631 | return transport_subsystem_register(&fileio_template); | 631 | return transport_subsystem_register(&fileio_template); |
632 | } | 632 | } |
633 | 633 | ||
634 | static void fileio_module_exit(void) | 634 | static void __exit fileio_module_exit(void) |
635 | { | 635 | { |
636 | transport_subsystem_release(&fileio_template); | 636 | transport_subsystem_release(&fileio_template); |
637 | } | 637 | } |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c73f4a950e23..8bcc514ec8b6 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
@@ -821,7 +821,7 @@ static int __init iblock_module_init(void) | |||
821 | return transport_subsystem_register(&iblock_template); | 821 | return transport_subsystem_register(&iblock_template); |
822 | } | 822 | } |
823 | 823 | ||
824 | static void iblock_module_exit(void) | 824 | static void __exit iblock_module_exit(void) |
825 | { | 825 | { |
826 | transport_subsystem_release(&iblock_template); | 826 | transport_subsystem_release(&iblock_template); |
827 | } | 827 | } |
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 2bcfd79cf595..82e78d72fdb6 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -840,14 +840,14 @@ static void pscsi_bi_endio(struct bio *bio, int error) | |||
840 | bio_put(bio); | 840 | bio_put(bio); |
841 | } | 841 | } |
842 | 842 | ||
843 | static inline struct bio *pscsi_get_bio(int sg_num) | 843 | static inline struct bio *pscsi_get_bio(int nr_vecs) |
844 | { | 844 | { |
845 | struct bio *bio; | 845 | struct bio *bio; |
846 | /* | 846 | /* |
847 | * Use bio_malloc() following the comment in for bio -> struct request | 847 | * Use bio_malloc() following the comment in for bio -> struct request |
848 | * in block/blk-core.c:blk_make_request() | 848 | * in block/blk-core.c:blk_make_request() |
849 | */ | 849 | */ |
850 | bio = bio_kmalloc(GFP_KERNEL, sg_num); | 850 | bio = bio_kmalloc(GFP_KERNEL, nr_vecs); |
851 | if (!bio) { | 851 | if (!bio) { |
852 | pr_err("PSCSI: bio_kmalloc() failed\n"); | 852 | pr_err("PSCSI: bio_kmalloc() failed\n"); |
853 | return NULL; | 853 | return NULL; |
@@ -940,7 +940,6 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, | |||
940 | bio = NULL; | 940 | bio = NULL; |
941 | } | 941 | } |
942 | 942 | ||
943 | page++; | ||
944 | len -= bytes; | 943 | len -= bytes; |
945 | data_len -= bytes; | 944 | data_len -= bytes; |
946 | off = 0; | 945 | off = 0; |
@@ -952,7 +951,6 @@ fail: | |||
952 | while (*hbio) { | 951 | while (*hbio) { |
953 | bio = *hbio; | 952 | bio = *hbio; |
954 | *hbio = (*hbio)->bi_next; | 953 | *hbio = (*hbio)->bi_next; |
955 | bio->bi_next = NULL; | ||
956 | bio_endio(bio, 0); /* XXX: should be error */ | 954 | bio_endio(bio, 0); /* XXX: should be error */ |
957 | } | 955 | } |
958 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 956 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; |
@@ -1092,7 +1090,6 @@ fail_free_bio: | |||
1092 | while (hbio) { | 1090 | while (hbio) { |
1093 | struct bio *bio = hbio; | 1091 | struct bio *bio = hbio; |
1094 | hbio = hbio->bi_next; | 1092 | hbio = hbio->bi_next; |
1095 | bio->bi_next = NULL; | ||
1096 | bio_endio(bio, 0); /* XXX: should be error */ | 1093 | bio_endio(bio, 0); /* XXX: should be error */ |
1097 | } | 1094 | } |
1098 | ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 1095 | ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; |
@@ -1178,7 +1175,7 @@ static int __init pscsi_module_init(void) | |||
1178 | return transport_subsystem_register(&pscsi_template); | 1175 | return transport_subsystem_register(&pscsi_template); |
1179 | } | 1176 | } |
1180 | 1177 | ||
1181 | static void pscsi_module_exit(void) | 1178 | static void __exit pscsi_module_exit(void) |
1182 | { | 1179 | { |
1183 | transport_subsystem_release(&pscsi_template); | 1180 | transport_subsystem_release(&pscsi_template); |
1184 | } | 1181 | } |