Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,246
    • Issues 5,246
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 563
    • Merge requests 563
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19147
Closed
Open
Issue created Jan 01, 2021 by Douglas Wilson@duogDeveloper

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 Jan 01, 2021 by Douglas Wilson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking