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,348
    • Issues 5,348
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 573
    • Merge requests 573
  • 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
  • #9067
Closed
Open
Issue created May 03, 2014 by Edward Z. Yang@ezyangDeveloper

Optimize clearNursery by short-circuiting when we get to currentNursery

This is a note to myself so I don't forget about this. Essentially, we can do something like this (this particular patch variant untested):

diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 36776b9..0311042 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -598,6 +598,11 @@ clearNursery (Capability *cap)
         ASSERT(bd->gen_no == 0);
         ASSERT(bd->gen == g0);
         IF_DEBUG(sanity,memset(bd->start, 0xaa, BLOCK_SIZE));
+        if (bd == cap->r.rCurrentNursery) {
+            IF_DEBUG(sanity, for (bd = bd->link; bd; bd = bd->link)
+                                ASSERT(bd->free == bd->start));
+            break;
+        }
     }
     }
 }

This is due to invariants about how we manage the currentNursery pointer. But we need a note about it, and I need to test it more carefully. This optimization probably doesn't help too much on normal GHC, but when I have lots of nurseries it helps quite a bit.

Trac metadata
Trac field Value
Version 7.9
Type Task
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC simonmar
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking