From b05a7dd9f7c138443ff4cd47a96d0d98af0b71de Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 25 Oct 2023 14:17:04 -0400 Subject: [PATCH 1/3] serf: trim persistent nock cache as appropriate --- pkg/vere/serf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/vere/serf.c b/pkg/vere/serf.c index 80a5b1ccf3..7cc26d2ae9 100644 --- a/pkg/vere/serf.c +++ b/pkg/vere/serf.c @@ -193,7 +193,18 @@ u3_serf_grab(void) void u3_serf_post(u3_serf* sef_u) { - if ( sef_u->fag_w & (_serf_fag_hit1|_serf_fag_much|_serf_fag_vega) ) { + if ( sef_u->fag_w & _serf_fag_hit1 ) { + u3h_trim_to(u3R->cax.per_p, u3h_wyt(u3R->cax.per_p) / 2); + u3m_reclaim(); + } + + if ( sef_u->fag_w & _serf_fag_much ) { + u3m_reclaim(); + } + + if ( sef_u->fag_w & _serf_fag_vega ) { + u3h_free(u3R->cax.per_p); + u3R->cax.per_p = u3h_new_cache(u3C.per_w); u3m_reclaim(); } @@ -205,6 +216,8 @@ u3_serf_post(u3_serf* sef_u) } if ( sef_u->fag_w & _serf_fag_hit0 ) { + u3h_free(u3R->cax.per_p); + u3R->cax.per_p = u3h_new_cache(u3C.per_w); u3a_print_memory(stderr, "serf: pack: gained", u3m_pack()); u3l_log(""); } From 5fe3d1c5ab40201d008309c188939adba5f637a3 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 25 Oct 2023 14:19:58 -0400 Subject: [PATCH 2/3] serf: adds pnc threshold printfs (under -v) --- pkg/vere/serf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/vere/serf.c b/pkg/vere/serf.c index 7cc26d2ae9..4ac99db7de 100644 --- a/pkg/vere/serf.c +++ b/pkg/vere/serf.c @@ -194,6 +194,9 @@ void u3_serf_post(u3_serf* sef_u) { if ( sef_u->fag_w & _serf_fag_hit1 ) { + if ( u3C.wag_w & u3o_verbose ) { + u3l_log("serf: threshold 1: %u", u3h_wyt(u3R->cax.per_p)); + } u3h_trim_to(u3R->cax.per_p, u3h_wyt(u3R->cax.per_p) / 2); u3m_reclaim(); } @@ -216,6 +219,9 @@ u3_serf_post(u3_serf* sef_u) } if ( sef_u->fag_w & _serf_fag_hit0 ) { + if ( u3C.wag_w & u3o_verbose ) { + u3l_log("serf: threshold 0: per_p %u", u3h_wyt(u3R->cax.per_p)); + } u3h_free(u3R->cax.per_p); u3R->cax.per_p = u3h_new_cache(u3C.per_w); u3a_print_memory(stderr, "serf: pack: gained", u3m_pack()); From 9ca215db08d801d3d57aac06f988185e29ded265 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 10 Nov 2023 11:32:04 -0500 Subject: [PATCH 3/3] serf: switch vega post-op to only trim half of persistent cache --- pkg/vere/serf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/vere/serf.c b/pkg/vere/serf.c index 4ac99db7de..cec8bece55 100644 --- a/pkg/vere/serf.c +++ b/pkg/vere/serf.c @@ -206,8 +206,7 @@ u3_serf_post(u3_serf* sef_u) } if ( sef_u->fag_w & _serf_fag_vega ) { - u3h_free(u3R->cax.per_p); - u3R->cax.per_p = u3h_new_cache(u3C.per_w); + u3h_trim_to(u3R->cax.per_p, u3h_wyt(u3R->cax.per_p) / 2); u3m_reclaim(); }