forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 2
Multithreaded evaluator #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edolstra
wants to merge
146
commits into
main
Choose a base branch
from
multithreaded-eval-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
146 commits
Select commit
Hold shift + click to select a range
6760b39
EvalState: Make the parse/eval caches thread-safe
edolstra d3854d1
LRUCache: Mark size() as const
edolstra 945cd69
Sync: Add support for shared locks
edolstra 5f3b1a3
WIP
edolstra 9ddca98
WIP3
edolstra d133aca
WIP4
edolstra 1a55754
Disable some blackhole tests for now
edolstra d623dfb
WIP working
edolstra a9e3594
Better hash
edolstra b63a132
Symbol table concurrency hack
edolstra 76f822f
Hacks
edolstra 6a85af7
Fix failures due to value reuse
edolstra 6eafc52
Revive the Boehm GC alloc cache
edolstra f018a55
Make RegexCache thread-safe
edolstra ec8593d
Add some stats
edolstra 105dea5
Cleanup
edolstra 27fb652
Make EvalState::srcToStore thread-safe
edolstra d990974
PosixSourceAccessor: Use SharedSync
edolstra eba54f5
FileParseCache, FileEvalCache: Use read lock
edolstra a25a5b7
Add getOptional()
edolstra ca11328
EvalState: Add importResolutionCache
edolstra c2c01d8
Make fileEvalCache insertion more efficient
edolstra 9b88021
Ensure that files are parsed/evaluated only once
edolstra 708e0e8
Small optimization
edolstra cc38822
SymbolStr: Remove std::string conversion
edolstra 424e01e
Use a contiguous arena for storing symbols
edolstra c663076
Executor: Randomize the work queue
edolstra adcc351
Provide std::hash<SourcePath>
edolstra 3988faf
Provide std::hash<Symbol>
edolstra a70ec9e
Remove unused #include
edolstra 0cd29fe
Split the symbol table into domains
edolstra 0c87ead
Fix --disable-gc build
edolstra 33f50ae
Don't use finishValue() for thunks
edolstra 5e87cf4
Remove debug statement
edolstra 400a670
Specify memory order
edolstra 5c6eb1a
Split the PosixSourceAccessor lstat cache
edolstra 3353f9a
nix search: Restore output
edolstra 9b814c4
Make the max-call-depth check thread-local
edolstra fd5c32b
Move code
edolstra 1bdf907
nix flake show: Make multi-threaded
edolstra 3cc1319
Disable some failing tests for now
edolstra f6cbd6a
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 6103246
Cleanups
edolstra 576a03e
Re-enable assertNoSymlinks()
edolstra 52bd994
Formatting
edolstra b713591
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra fcbdc9f
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 997af66
Make the default GC_INITIAL_HEAP_SIZE a lot bigger
edolstra d3397d7
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 2b4c36f
Remove obsolete comment
edolstra d131a02
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 4482fe4
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 8cf80c9
nix repl: Remove unnecessary call to evalString
edolstra 67ff326
Remove FIXME
edolstra c8c9500
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra dd44b26
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 9102baf
Make AllowListSourceAccessor thread-safe
edolstra 998a289
Make positionToDocComment thread-safe
edolstra 5310b0f
callFunction(): Use correct environment in error messages
edolstra 839aec2
callFunction(): Create the primop app chain safely
edolstra 4f90786
Debug
edolstra 6357885
Move perf counters into EvalState
edolstra 4086c1c
Debug
edolstra a6d8217
Remove "SPURIOUS" message
edolstra ea4e981
Fix formatting
edolstra d36ea2e
Fix meson build
edolstra 114d1a0
finishAll(): Propagate an arbitrary exception
edolstra f947b63
nix flake show: Make sure the visit() closure is still alive in case …
edolstra ceeb648
Introduce ValueType::nFailed
edolstra 8b7d5b4
Make 'nix search --json' thread-safe
edolstra 8020c0c
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra fee4e0f
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra 8cf2af1
Formatting
edolstra d300e13
Use MAP_NORESERVE to avoid mmap failure on low-memory systems
edolstra 8b374fd
Add eval-cores setting
edolstra c4ecaeb
Remove configure.ac
edolstra 53356cf
Re-enable some tests
edolstra aa8025e
Tweak wording
edolstra 250562c
Fix warning
edolstra 50cf042
Fix UndefinedBehaviorSanitizer error passing a null Env
edolstra 53f6b24
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra e6caa9d
Merge remote-tracking branch 'origin/master' into multithreaded-eval
edolstra ce255bd
Merge remote-tracking branch 'detsys/multithreaded-eval' into sync-2.29
edolstra 33b8a1e
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 825a2af
GitSourceAccessor: Make thread-safe
edolstra 02eb215
nix flake check: Make multi-threaded
edolstra 9d6bfdb
Prevent double copy of nixpkgs source tree
edolstra 9ac8710
RemoteStore: Increase default maxConnections
edolstra ccf88cb
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 3746889
Move code out of header
edolstra fbb59f8
Move Executor into EvalState
edolstra 509db3d
Make printValueAsJSON() multi-threaded
edolstra f649f50
Run flake-regressions with eval-cores = 24
edolstra 5421f5c
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 0e4ed54
Fix macOS build
edolstra a66d268
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra dbc9423
nix flake prefetch-inputs: Add
edolstra 9a52b2f
flake-regressions: Use prefetching
edolstra 1626e65
Move FlakeCommand into a header, allow separate registration of subco…
edolstra 7ec889d
Don't set $PARALLEL with eval-cores
edolstra 59a2818
EvalState: Make the counters atomic
edolstra 7156b63
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra a66991a
Restore mkBlackhole() for testing
edolstra 08bf730
Re-enable some tests
edolstra aedaffd
Drop NIX_SHOW_THREAD_STATS
edolstra 1b88cfc
Implement SymbolTable::dump()
edolstra 2a245fc
Remove debug lines
edolstra 529e500
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra a1c5533
SymbolTable: Use boost::concurrent_flat_set
edolstra 47f8b6e
Update multithreaded eval to work with the 16-byte Value representation
edolstra 88cd30d
Formatting
edolstra fcd49c0
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 0c09c4c
Remove debug line
edolstra e0779b6
Remove unnecessary diff
edolstra 84cfa2b
PosixSourceAccessor: Use concurrent_flat_map
edolstra fe99dcf
Remove unused variable
edolstra d90ec7d
showHelp(): Simplify
edolstra a61c4ec
Remove unused Pending struct
edolstra 914baff
Clean up CallDepth merge issue
edolstra 0bcd256
Merge commit '47281531e' into multithreaded-eval-v2
edolstra 69c848b
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 0c5bfeb
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-…
edolstra 0a604eb
flake-regressions: Bypass the Nix daemon
edolstra 9edfe78
Clean up reading thunks
edolstra 1e8a3f3
usWaiting -> microsecondsWaiting
edolstra 840970f
Use better casts
edolstra 5dcdb1c
Remove unnecessary pureEval check
edolstra cb79524
Fix flake-regressions
edolstra ca5c411
Use flake-regressions main branch
edolstra d8a77d8
printError -> notice
edolstra 9788d8c
Fix SymbolTable::dump()
edolstra 6e908b5
Test
edolstra db9cc7b
Allow eval-cores to be set to 0 to use all cores
edolstra 38e711b
Make Executor interruptible
edolstra e4b43ba
FutureVector: Ensure all items are going before throwing an exception
edolstra 65189cf
Move setting GC_THREADS into eval-gc.hh
edolstra 33dbefd
Optimize wakeup a bit
edolstra e904e34
Call GC_allow_register_threads() to enable parallel marking in Boehm GC
edolstra f0763d5
Move setting GC_THREADS into eval-gc.hh
edolstra 8c53715
Apply a patch to boehmgc to increase the initial mark stack size
edolstra 6a4cd24
Merge remote-tracking branch 'detsys/parallel-mark' into multithreade…
edolstra 1f55bed
Fix eval-cores = 0
edolstra 95a1a07
Less aggressive initial heap size
edolstra 43d6737
Use -DINITIAL_MARK_STACK_SIZE
edolstra f78c858
Merge remote-tracking branch 'detsys/parallel-mark' into multithreade…
edolstra 80c1139
Restore fixupBoehmStackPointer
edolstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not related to this file, just left here so it can be marked resolved later)
This PR could also use some (very brief) docs on what things are currently affected by this -- reading the code and based on (spotty, tbf) recollection of past conversation, I believe this is currently limited to:
nix flake show
nix flake check
Did I miss any?
It would also be nice to add a list of commands that this does not currently affect (but will in the future, as we iron out issues and whatnot).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also speeds up
nix search
nix eval --json
(used by flake-regressions)