[PATCH 7 of 8] Added creation and close of pipes for sendfile of ngx_uring_module

SoYun Seong thdbsdox12 at gmail.com
Tue Nov 24 08:43:35 UTC 2020


# HG changeset patch
# User SoYun Seong <thdbsdox12 at gmail.com>
# Date 1606129296 0
#      Mon Nov 23 11:01:36 2020 +0000
# Node ID 09dfe4a92414513c6bd3c18d871e8a76ed19c3d7
# Parent  57e46378828172e06b32b11d4c059ff0a7213d0d
Added creation and close of pipes for sendfile of ngx_uring_module.

Creates pipes for asynchronous sendfile of ngx_uring module in ngx_get_connection() and destroy them in ngx_free_connection(). However this code is disabled for the performance issue.

diff -r 57e463788281 -r 09dfe4a92414 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c	Mon Nov 23 10:59:09 2020 +0000
+++ b/src/core/ngx_connection.c	Mon Nov 23 11:01:36 2020 +0000
@@ -1152,6 +1152,14 @@
 
     wev->write = 1;
 
+#if (NGX_USE_URING_SPLICE)
+    if(ngx_event_flags & NGX_USE_URING_EVENT) {
+        if(pipe(c->write->uring_splice_pipe) < 0){
+            return NULL;
+        }
+    }
+#endif
+
     return c;
 }
 
@@ -1166,6 +1174,13 @@
     if (ngx_cycle->files && ngx_cycle->files[c->fd] == c) {
         ngx_cycle->files[c->fd] = NULL;
     }
+
+#if (NGX_USE_URING_SPLICE)
+    if(ngx_event_flags & NGX_USE_URING_EVENT) {
+        close(c->write->uring_splice_pipe[0]);
+        close(c->write->uring_splice_pipe[1]);
+    }
+#endif
 }
 
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-7.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20201124/a732c47d/attachment-0001.bin>


More information about the nginx-devel mailing list