diff options
author | Steve French <stfrench@microsoft.com> | 2019-09-09 14:30:15 -0400 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-09-16 12:43:38 -0400 |
commit | 10328c44cc1506dd82fd835efcaafd519866c464 (patch) | |
tree | 52a8a71596ab8a61c27fa1f7d19ddbf6728d2492 | |
parent | 496902dc173dead0e5eeba1f2fd4abd9ba6f2da0 (diff) |
smb3: only offload decryption of read responses if multiple requests
No point in offloading read decryption if no other requests on the
wire
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
-rw-r--r-- | fs/cifs/cifsfs.c | 9 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index ebf85a5d95e4..c1b685072063 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -1503,11 +1503,14 @@ init_cifs(void) | |||
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | /* | 1505 | /* |
1506 | * BB Consider setting limit!=0 maybe to min(num_of_cores - 1, 3) so we | 1506 | * Consider in future setting limit!=0 maybe to min(num_of_cores - 1, 3) |
1507 | * don't launch too many worker threads | 1507 | * so that we don't launch too many worker threads but |
1508 | * Documentation/workqueue.txt recommends setting it to 0 | ||
1508 | */ | 1509 | */ |
1510 | |||
1511 | /* WQ_UNBOUND allows decrypt tasks to run on any CPU */ | ||
1509 | decrypt_wq = alloc_workqueue("smb3decryptd", | 1512 | decrypt_wq = alloc_workqueue("smb3decryptd", |
1510 | WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); | 1513 | WQ_UNBOUND|WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); |
1511 | if (!decrypt_wq) { | 1514 | if (!decrypt_wq) { |
1512 | rc = -ENOMEM; | 1515 | rc = -ENOMEM; |
1513 | goto out_destroy_cifsiod_wq; | 1516 | goto out_destroy_cifsiod_wq; |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 1cfb8d518132..72b3e39d7f4f 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -4121,7 +4121,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid, | |||
4121 | * use more cores decrypting which can be expensive | 4121 | * use more cores decrypting which can be expensive |
4122 | */ | 4122 | */ |
4123 | 4123 | ||
4124 | if ((server->min_offload) && | 4124 | if ((server->min_offload) && (server->in_flight > 1) && |
4125 | (server->pdu_size >= server->min_offload)) { | 4125 | (server->pdu_size >= server->min_offload)) { |
4126 | dw = kmalloc(sizeof(struct smb2_decrypt_work), GFP_KERNEL); | 4126 | dw = kmalloc(sizeof(struct smb2_decrypt_work), GFP_KERNEL); |
4127 | if (dw == NULL) | 4127 | if (dw == NULL) |