From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#24937: "deleting unused links" GC phase is too slow Date: Sun, 13 Nov 2016 18:41:01 +0100 Message-ID: <87wpg7ffbm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5yn7-0000hw-R9 for bug-guix@gnu.org; Sun, 13 Nov 2016 12:42:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5yn4-0007dL-PM for bug-guix@gnu.org; Sun, 13 Nov 2016 12:42:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5yn4-0007dF-MV for bug-guix@gnu.org; Sun, 13 Nov 2016 12:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c5yn4-0001jL-EB for bug-guix@gnu.org; Sun, 13 Nov 2016 12:42:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5ymB-0000gB-HC for bug-guix@gnu.org; Sun, 13 Nov 2016 12:41:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5ym8-0007Q6-EK for bug-guix@gnu.org; Sun, 13 Nov 2016 12:41:07 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5ym8-0007Q2-BK for bug-guix@gnu.org; Sun, 13 Nov 2016 12:41:04 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:50852 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1c5ym7-000132-Mq for bug-guix@gnu.org; Sun, 13 Nov 2016 12:41:04 -0500 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 24937@debbugs.gnu.org =E2=80=98LocalStore::removeUnusedLinks=E2=80=99 traverses all the entries in /gnu/store/.links and calls lstat(2) on each one of them and checks =E2=80=98st_nlink=E2=80=99 to determine whether they can be deleted. There are two problems: lstat(2) can be slow on spinning disks as found on hydra.gnu.org, and the algorithm is proportional in the number of entries in /gnu/store/.links, which is a lot on hydra.gnu.org. Ludo=E2=80=99.