From 117670be570d775a18e4e35db3dae00abc24f729 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 26 Mar 2012 20:43:33 +0200 Subject: Make the garbage collector more concurrent Make the garbage collector more concurrent by deleting valid paths outside the region where we're holding the global GC lock. This should greatly reduce the time during which new builds are blocked, since the deletion accounts for the vast majority of the time spent in the GC. To ensure that this is safe, the valid paths are invalidated and renamed to some arbitrary path while we're holding the lock. This ensures that we when we finally delete the path, it's not a (newly) valid or locked path. --- src/libstore/local-store.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index f3b779dd0..1ab9d15eb 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1380,11 +1380,8 @@ Paths LocalStore::importPaths(bool requireSignature, Source & source) } -void LocalStore::deleteFromStore(const Path & path, unsigned long long & bytesFreed, - unsigned long long & blocksFreed) +void LocalStore::invalidatePathChecked(const Path & path) { - bytesFreed = 0; - assertStorePath(path); while (1) { @@ -1404,8 +1401,6 @@ void LocalStore::deleteFromStore(const Path & path, unsigned long long & bytesFr break; } catch (SQLiteBusy & e) { }; } - - deletePathWrapped(path, bytesFreed, blocksFreed); } -- cgit v1.2.3