summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbdunahu <bdunahu@operationnull.com>2026-08-02 09:27:39 -0400
committerNguyễn Gia Phong <cnx@loang.net>2026-08-08 00:12:06 +0900
commit53b2de97116607100646eb4554575de278ac818d (patch)
tree4dc15fe3919eb4a465a99e583878aa761f1c5f09
parent415de5477979bfb8e4de409eddef8386834b86d0 (diff)
gnu: curl: Graft performance fixes.
curl 8.20 has a bug which causes high cpu usage when built with `enable-threaded-resolver`. * gnu/packages/patches/curl-fix-wakeup-consumption.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/curl.scm (curl/fixed): New variable. (curl)[replacement]: Use it here. Fixes: https://codeberg.org/guix/guix/issues/10284 Merges: https://codeberg.org/guix/guix/pulls/10330 Reviewed-by: Yelninei <yelninei@tutamail.com> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/curl.scm11
-rw-r--r--gnu/packages/patches/curl-fix-wakeup-consumption.patch35
3 files changed, 47 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index d828205b7cd..96a95525d43 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1181,6 +1181,7 @@ dist_patch_DATA = \
1181 %D%/packages/patches/cups-relax-root-ownership-check.patch \ 1181 %D%/packages/patches/cups-relax-root-ownership-check.patch \
1182 %D%/packages/patches/cura-engine-gcc-14.patch \ 1182 %D%/packages/patches/cura-engine-gcc-14.patch \
1183 %D%/packages/patches/curl-use-ssl-cert-env.patch \ 1183 %D%/packages/patches/curl-use-ssl-cert-env.patch \
1184 %D%/packages/patches/curl-fix-wakeup-consumption.patch \
1184 %D%/packages/patches/curlftpfs-fix-error-closing-file.patch \ 1185 %D%/packages/patches/curlftpfs-fix-error-closing-file.patch \
1185 %D%/packages/patches/curlftpfs-fix-file-names.patch \ 1186 %D%/packages/patches/curlftpfs-fix-file-names.patch \
1186 %D%/packages/patches/curlftpfs-fix-memory-leak.patch \ 1187 %D%/packages/patches/curlftpfs-fix-memory-leak.patch \
diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index 78ca03096a5..96fb6e9213a 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -69,6 +69,7 @@
69 (package 69 (package
70 (name "curl") 70 (name "curl")
71 (version "8.20.0") 71 (version "8.20.0")
72 (replacement curl/fixed)
72 (source (origin 73 (source (origin
73 (method url-fetch) 74 (method url-fetch)
74 (uri (string-append "https://curl.se/download/curl-" 75 (uri (string-append "https://curl.se/download/curl-"
@@ -180,6 +181,16 @@ tunneling, and so on.")
180 (license (license:non-copyleft "file://COPYING" 181 (license (license:non-copyleft "file://COPYING"
181 "See COPYING in the distribution.")))) 182 "See COPYING in the distribution."))))
182 183
184(define-public curl/fixed
185 (package
186 (inherit curl)
187 (name "curl")
188 (version "8.20.0")
189 (source (origin
190 (inherit (package-source curl))
191 (patches (search-patches "curl-use-ssl-cert-env.patch"
192 "curl-fix-wakeup-consumption.patch"))))))
193
183(define-deprecated-package gnurl 194(define-deprecated-package gnurl
184 curl) 195 curl)
185 196
diff --git a/gnu/packages/patches/curl-fix-wakeup-consumption.patch b/gnu/packages/patches/curl-fix-wakeup-consumption.patch
new file mode 100644
index 00000000000..f84eb729727
--- /dev/null
+++ b/gnu/packages/patches/curl-fix-wakeup-consumption.patch
@@ -0,0 +1,35 @@
1From 2a2104f3cff44bb28bb570a093be52bbeeed8f23 Mon Sep 17 00:00:00 2001
2From: Stefan Eissing <stefan@eissing.org>
3Date: Mon, 11 May 2026 14:56:04 +0200
4Subject: [PATCH] event: fix wakeup consumption
5
6The events on a multi wakeup socketpair were only consumed via
7curl_multi_poll()/curl_multi_wait() but not in event based processing on
8a curl_multi_socket() call. That led to busy loops as reported in
9
10Fixes #21547
11Reported-by: Earnestly on github
12Closes #21549
13
14original report: https://github.com/curl/curl/issues/21547
15original pull request: https://github.com/curl/curl/pull/21549
16---
17 lib/multi.c | 5 +++++
18 1 file changed, 5 insertions(+)
19
20diff --git a/lib/multi.c b/lib/multi.c
21index be32740a7097..5e84133f13fd 100644
22--- a/lib/multi.c
23+++ b/lib/multi.c
24@@ -2703,6 +2703,11 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
25 Curl_uint32_bset_remove(&multi->dirty, data->mid);
26
27 if(data == multi->admin) {
28+#ifdef ENABLE_WAKEUP
29+ /* Consume any pending wakeup signals before processing.
30+ * This is necessary for event based processing. See #21547 */
31+ (void)Curl_wakeup_consume(multi->wakeup_pair, TRUE);
32+#endif
33 #ifdef USE_RESOLV_THREADED
34 Curl_async_thrdd_multi_process(multi);
35 #endif