ChangeSet 1.2199.14.28, 2005/03/23 12:09:27-08:00, [EMAIL PROTECTED]

        [CRYPTO]: Optimise kmap calls in crypt()
        
        Perform kmap once (or twice if the buffer is not aligned correctly)
        per page in crypt() instead of the current code which does it once
        per block.  Consequently it will yield once per page instead of once
        per block.
        
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]>



 cipher.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)


diff -Nru a/crypto/cipher.c b/crypto/cipher.c
--- a/crypto/cipher.c   2005-03-26 17:23:38 -08:00
+++ b/crypto/cipher.c   2005-03-26 17:23:38 -08:00
@@ -117,17 +117,21 @@
 
                in_place = scatterwalk_samebuf(&walk_in, &walk_out);
 
-               src_p = prepare_src(&walk_in, bsize, tmp_src, in_place);
-               dst_p = prepare_dst(&walk_out, bsize, tmp_dst, in_place);
+               do {
+                       src_p = prepare_src(&walk_in, bsize, tmp_src,
+                                           in_place);
+                       dst_p = prepare_dst(&walk_out, bsize, tmp_dst,
+                                           in_place);
 
-               nbytes -= bsize;
+                       prfn(tfm, dst_p, src_p, crfn, enc, info);
 
-               prfn(tfm, dst_p, src_p, crfn, enc, info);
+                       complete_src(&walk_in, bsize, src_p, in_place);
+                       complete_dst(&walk_out, bsize, dst_p, in_place);
 
-               complete_src(&walk_in, bsize, src_p, in_place);
-               scatterwalk_done(&walk_in, 0, nbytes);
+                       nbytes -= bsize;
+               } while (nbytes && !scatterwalk_across_pages(&walk_in, bsize));
 
-               complete_dst(&walk_out, bsize, dst_p, in_place);
+               scatterwalk_done(&walk_in, 0, nbytes);
                scatterwalk_done(&walk_out, 1, nbytes);
 
                if (!nbytes)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to