Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Decking
GHC
Commits
beda2308
Commit
beda2308
authored
6 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
nonmoving: Upper-bound time we hold SM_MUTEX for during sweep
parent
495397b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rts/sm/NonMovingSweep.c
+26
-1
26 additions, 1 deletion
rts/sm/NonMovingSweep.c
with
26 additions
and
1 deletion
rts/sm/NonMovingSweep.c
+
26
−
1
View file @
beda2308
...
...
@@ -293,9 +293,34 @@ void nonmovingSweepMutLists()
}
}
/* A variant of freeChain_lock that will only hold the lock for at most max_dur
* freed blocks to ensure that we don't starve other lock users (e.g. the
* mutator).
*/
static
void
freeChain_lock_max
(
bdescr
*
bd
,
int
max_dur
)
{
ACQUIRE_SM_LOCK
;
bdescr
*
next_bd
;
int
i
=
0
;
while
(
bd
!=
NULL
)
{
next_bd
=
bd
->
link
;
freeGroup
(
bd
);
bd
=
next_bd
;
if
(
i
==
max_dur
)
{
RELEASE_SM_LOCK
;
usleep
(
10
);
// sadly it seems yieldThread isn't sufficient here to
// avoid starvation
ACQUIRE_SM_LOCK
;
i
=
0
;
}
i
++
;
}
RELEASE_SM_LOCK
;
}
void
nonmovingSweepLargeObjects
()
{
freeChain_lock
(
nonmoving_large_objects
);
freeChain_lock
_max
(
nonmoving_large_objects
,
10000
);
nonmoving_large_objects
=
nonmoving_marked_large_objects
;
n_nonmoving_large_blocks
=
n_nonmoving_marked_large_blocks
;
nonmoving_marked_large_objects
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment