Hello
On Wed, 2021-08-18 at 16:46 +0530, Purushottam Choudhary wrote:
> From: Glenn Strauss <[email protected]>
> +Date: Wed, 23 Dec 2020 23:14:47 -0500
> +Subject: [PATCH] reuse large mem chunks (fix mem usage) (fixes #3033)
> +
> +(cherry picked from commit 7ba521ffb4959f6f74a609d5d4acafc29a038337)
> +
> +(thx flynn)
> +
> +fix large memory usage for large file downloads from dynamic backends
> +
> +reuse or release large memory chunks
> +Upstream-Status: Backport
> +
> https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/7ba521ffb4959f6f74a609d5d4acafc29a038337
> +Signed-off-by: Purushottam Choudhary <[email protected]>
> +x-ref:
> + "Memory Growth with PUT and full buffered streams"
> + https://redmine.lighttpd.net/issues/3033
> +
> +---
> + src/chunk.c | 99 ++++++++++++++++++++++++++++++++++++++++-
> ---------
> + src/chunk.h | 2 +
> + src/http-header-glue.c | 2 +-
> + 3 files changed, 82 insertions(+), 21 deletions(-)
> +
> +diff --git a/src/chunk.c b/src/chunk.c
> +index 09dd3f1..ffb3795 100644
> +--- a/src/chunk.c
> ++++ b/src/chunk.c
> +@@ -28,16 +28,20 @@
> + static size_t chunk_buf_sz = 4096;
> + static chunk *chunks, *chunks_oversized;
> + static chunk *chunk_buffers;
> ++static int chunks_oversized_n;
> + static array *chunkqueue_default_tempdirs = NULL;
> + static off_t chunkqueue_default_tempfile_size =
> DEFAULT_TEMPFILE_SIZE;
> +
> + void chunkqueue_set_chunk_size (size_t sz)
> + {
> +- chunk_buf_sz = sz > 0 ? ((sz + 1023) & ~1023uL) : 4096;
> ++ size_t x = 1024;
> ++ while (x < sz && x < (1u << 30)) x <<= 1;
> ++ chunk_buf_sz = sz > 0 ? x : 4096;
This doesn't look like a clean backport and you seem to have changed
the chunk size to 4k from 8k in the patch. This should be mentioned.
> + }
> +
> + void chunkqueue_set_tempdirs_default_reset (void)
> + {
> ++ chunk_buf_sz = 8192;
While here it's being reset to 8k. This looks wrong ... Perhaps you
should consider taking an earlier commit as well that's changing the
size to 8k. Also, is the aim of this patch is to fix
https://redmine.lighttpd.net/issues/3033
? If yes, you probably need some other patches as well:
https://redmine.lighttpd.net/issues/3033?tab=changesets
Thanks,
Anuj
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154923):
https://lists.openembedded.org/g/openembedded-core/message/154923
Mute This Topic: https://lists.openembedded.org/mt/84969804/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-