unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Guix to participate in the Google Summer of Code
Date: Wed, 21 Feb 2018 07:23:22 +0100	[thread overview]
Message-ID: <87sh9u3lph.fsf@gmail.com> (raw)
In-Reply-To: <874lmey4ki.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 18 Feb 2018 11:28:45 +0100")

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Ricardo Wurmus <rekado@elephly.net> writes:

> Garbage collection in the context of Guix is not very difficult to
> understand.  The garbage collector may remove any item that has zero
> users; the link count on a store item is indicative of the number of
> users that item has.  For garbage collection you essentially go through
> all items and check if the link count is zero.

Is this correct?  My understanding is that the link count of a store
path (i.e., the count of hard links for a given file in the store) is
unrelated to whether or not that store path is live.  It looks like, in
nix/libstore/gc.cc, we basically walk the references graph starting from
the GC roots and delete anything that can't be reached from a root.
This makes sense, since anything that can be reached from a root is live
and must not be deleted, and anything that can't be reached from any
root can be deleted.  Link counts (e.g., the number of hard links) do
not seem to play a role here.

In addition to the C++ code, the Nix thesis has a good discussion of the
garbage collection algorithm.  I don't know if it's accurate, but it
helps shed light on the intent.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2018-02-21  6:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 23:47 Guix to participate in the Google Summer of Code Ludovic Courtès
2018-02-18  7:23 ` Alex Vong
2018-02-18 10:28   ` Ricardo Wurmus
2018-02-19 16:02     ` Alex Vong
2018-02-21  9:10       ` Ricardo Wurmus
2018-02-21  6:23     ` Chris Marusich [this message]
2018-02-21  8:25       ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh9u3lph.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).