Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+7 -4
+6 -3
fs/cifs/cifsfs.c
··· 1503 1503 } 1504 1504 1505 1505 /* 1506 - * BB Consider setting limit!=0 maybe to min(num_of_cores - 1, 3) so we 1507 - * don't launch too many worker threads 1506 + * Consider in future setting limit!=0 maybe to min(num_of_cores - 1, 3) 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 1512 decrypt_wq = alloc_workqueue("smb3decryptd", 1510 - WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); 1513 + WQ_UNBOUND|WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); 1511 1514 if (!decrypt_wq) { 1512 1515 rc = -ENOMEM; 1513 1516 goto out_destroy_cifsiod_wq;
+1 -1
fs/cifs/smb2ops.c
··· 4121 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 4125 (server->pdu_size >= server->min_offload)) { 4126 4126 dw = kmalloc(sizeof(struct smb2_decrypt_work), GFP_KERNEL); 4127 4127 if (dw == NULL)