diff options
author | Mingzhe Zou | 2022-03-01 15:55:00 +0800 |
---|---|---|
committer | Martin K. Petersen | 2022-03-14 23:40:36 -0400 |
commit | d72d827f2f2636d8d72f0f3ebe5b661c9a24d343 (patch) | |
tree | b0ecafd9845045fa030fd2fc2fbf2133d1f9e4d6 /drivers/target/iscsi/iscsi_target_login.c | |
parent | 095478a6e5bf590f2bbf341569eb25173c9c5f32 (diff) |
scsi: target: Add iscsi/cpus_allowed_list in configfs
The RX/TX threads for iSCSI connection can be scheduled to any online CPUs,
and will not be rescheduled.
When binding other heavy load threads along with iSCSI connection RX/TX
thread to the same CPU, the iSCSI performance will be worse.
Add iscsi/cpus_allowed_list in configfs. The available CPU set of iSCSI
connection RX/TX threads is allowed_cpus & online_cpus. If it is modified,
all RX/TX threads will be rescheduled.
Link: https://lore.kernel.org/r/20220301075500.14266-1-mingzhe.zou@easystack.cn
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Mingzhe Zou <mingzhe.zou@easystack.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_login.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 1a9c50401bdb..9c01fb864585 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1129,8 +1129,15 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np) goto free_conn_ops; } + if (!zalloc_cpumask_var(&conn->allowed_cpumask, GFP_KERNEL)) { + pr_err("Unable to allocate conn->allowed_cpumask\n"); + goto free_conn_cpumask; + } + return conn; +free_conn_cpumask: + free_cpumask_var(conn->conn_cpumask); free_conn_ops: kfree(conn->conn_ops); put_transport: @@ -1142,6 +1149,7 @@ free_conn: void iscsit_free_conn(struct iscsi_conn *conn) { + free_cpumask_var(conn->allowed_cpumask); free_cpumask_var(conn->conn_cpumask); kfree(conn->conn_ops); iscsit_put_transport(conn->conn_transport); |