| CARVIEW |
Select Language
HTTP/2 301
server: nginx
date: Fri, 16 Jan 2026 14:48:37 GMT
content-type: text/html
content-length: 115
location: https://gitlab.haskell.org/ghc/ghc/-/issues/19147
cache-control: no-cache
nel: {"max_age": 0}
x-gitlab-meta: {"correlation_id":"01KF3MF6STBBCKC4CKB7XEATSF","version":"1"}
x-request-id: 01KF3MF6STBBCKC4CKB7XEATSF
x-runtime: 0.045660
HTTP/2 200
server: nginx
date: Fri, 16 Jan 2026 14:48:38 GMT
content-type: text/html; charset=utf-8
content-length: 54893
cache-control: max-age=0, private, must-revalidate
content-security-policy:
etag: W/"dec76fc0eeee8783cf95f2c709b81400"
nel: {"max_age": 0}
permissions-policy: interest-cohort=()
referrer-policy: strict-origin-when-cross-origin
set-cookie: _gitlab_session=34201debdd472f135d2f4cc89cd9f3c6; path=/; secure; HttpOnly; SameSite=None
vary: Accept
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-gitlab-meta: {"correlation_id":"01KF3MF74C22VD450KKMZBHJFQ","version":"1"}
x-permitted-cross-domain-policies: none
x-request-id: 01KF3MF74C22VD450KKMZBHJFQ
x-runtime: 0.413236
x-ua-compatible: IE=edge
x-xss-protection: 1; mode=block
Error in accounting for GC cpu time in sequential collections (#19147) · Issues · Glasgow Haskell Compiler / GHC · GitLab
Skip to content
Error in accounting for GC cpu time in sequential collections
Summary
stat_endGC accounts for cpu time consumed by a garbage collection the following fragment:
for (unsigned int i=0; i < par_n_threads; i++) {
gc_thread *gct = gc_threads[i];
ASSERT(gct->gc_end_cpu >= gct->gc_start_cpu);
stats.gc.cpu_ns += gct->gc_end_cpu - gct->gc_start_cpu;
}
however, this is incorrect when accounting for a sequential collection when n_capabilities > 1. In this case, par_n_threads will be set to 1. However the cpu stats will not necessarily be on capability 0(i.e. in gc_threads[0]) which the fragment above assumes. The stats will be on the capability of the gc leader.
EDIT: I've also seen
for (i=0; i < n_gc_threads; i++) {
copied += RELAXED_LOAD(&gc_threads[i]->copied);
}
in GC.c seems to have the same problem. Holding off fixing this for now, since I now suspect I may be confused
Steps to reproduce
I've not constructed a demonstration.
Expected behavior
n/a
Environment
- GHC version used: head
Edited by Douglas Wilson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information