Author: mav
Date: Fri May 22 18:10:46 2020
New Revision: 361400
URL: https://svnweb.freebsd.org/changeset/base/361400

Log:
  Do not try to fill socket send buffer to the last byte.
  
  Setting so_snd.sb_lowat to at least 1/8 of the socket buffer size allows
  send thread more actively use PDUs coalescing, that dramatically reduces
  TCP lock congestion and number of context switches, when the socket is
  full and PDUs are small.
  
  MFC after:    1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/iscsi/icl_soft.c

Modified: head/sys/dev/iscsi/icl_soft.c
==============================================================================
--- head/sys/dev/iscsi/icl_soft.c       Fri May 22 18:03:14 2020        
(r361399)
+++ head/sys/dev/iscsi/icl_soft.c       Fri May 22 18:10:46 2020        
(r361400)
@@ -914,7 +914,8 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu
                                    "have %ld, need %ld",
                                    available, size);
 #endif
-                               so->so_snd.sb_lowat = size;
+                               so->so_snd.sb_lowat = max(size,
+                                   so->so_snd.sb_hiwat / 8);
                                SOCKBUF_UNLOCK(&so->so_snd);
                                return;
                        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to