]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: haterm: preserve the pipe size margin for splicing
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Apr 2026 16:32:25 +0000 (18:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 Apr 2026 16:37:04 +0000 (18:37 +0200)
Originally in httpterm we used to allocate 5/4 of the size of a pipe to
permit to use vmsplice because there's some fragmentation or overhead
internally that requires to use a bit of margin. While this was initially
applied to haterm as well, it was accidentally lost with commit fb82dece47
("BUG/MEDIUM: haterm: Properly initialize the splicing support for haterm"),
resulting in errors about vmsplice() whenever tune.pipesize is set. Let's
enforce the ratio again.

No backport is needed.

src/haterm.c

index ef6c8ca40fb51d370511c919314fe3aa15cd3f07..dfe9e5ae0ce5b7a47c1d71d7d10810990c237607 100644 (file)
@@ -1225,7 +1225,7 @@ static void hstream_init_splicing(void)
                int total, ret;
 
 #ifdef F_SETPIPE_SZ
-                fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize);
+                fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize * 5 / 4);
 #endif
                total = ret = 0;
                do {
@@ -1238,7 +1238,7 @@ static void hstream_init_splicing(void)
                if (master_pipesize < pipesize) {
                        if (master_pipesize < 60*1024) {
                                /* Older kernels were limited to around 60-61 kB */
-                               ha_warning("Failed to vmsplice haterm mastre pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize);
+                               ha_warning("Failed to vmsplice haterm master pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize);
                                put_pipe(master_pipe);
                                master_pipe = NULL;
                                master_pipesize = 0;