xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 9 17:03:25 UTC 2022


 os/io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2ab70dede76c99876d7d5d1efa521b8082e13210
Author: Peter Harris <pharris at opentext.com>
Date:   Tue Apr 21 15:19:22 2020 -0400

    os: Restore buffer when writing to network
    
    The commit 9bf46610a9d20962854016032de4567974e87957 "os: Immediately
    queue initial WriteToClient" effectively disables buffering (of all
    writes, not just the "initial" write), since the OS's network buffers
    will usually be large enough to hold whatever replies we have sent.
    
    This does improve performance when drawing over a Unix socket (I measure
    approximtely 10%, not the ~5x mentioned in that commit message, probably
    due to the large changes in this area since that commit), but it
    decreases performance when drawing over a network due to the additional
    TCP packets. This decrease is small (~10%) in most cases, but if the two
    machines have mismatched Nagle / tcp_delay settings it can cause
    XGetWindowAttributes to take 200ms (because it's composed of two
    requests, the 2nd of which might wait for the ack which is delayed).
    
    Avoid network slowdowns by making the immediate flush conditional on
    who->local.
    
    Signed-off-by: Peter Harris <pharris at opentext.com>

diff --git a/os/io.c b/os/io.c
index 5b7fac349..841a0ee40 100644
--- a/os/io.c
+++ b/os/io.c
@@ -790,7 +790,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
         }
     }
 #endif
-    if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
+    if ((oco->count == 0 && who->local) || oco->count + count + padBytes > oco->size) {
         output_pending_clear(who);
         if (!any_output_pending()) {
             CriticalOutputPending = FALSE;


More information about the xorg-commit mailing list