From nobody Mon Sep 15 04:16:09 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cQBY31Z6yz6818l for ; Mon, 15 Sep 2025 04:16:07 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [50.1.20.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "pelorus.zefox.org", Issuer "pelorus.zefox.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQBY24DSMz450p for ; Mon, 15 Sep 2025 04:16:06 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Authentication-Results: mx1.freebsd.org; none Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.18.1/8.18.1) with ESMTPS id 58F4G9wA027352 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 14 Sep 2025 21:16:10 -0700 (PDT) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.18.1/8.18.1/Submit) id 58F4G9LN027351; Sun, 14 Sep 2025 21:16:09 -0700 (PDT) (envelope-from fbsd) Date: Sun, 14 Sep 2025 21:16:09 -0700 From: bob prohaska To: Mark Millard Cc: FreeBSD Current Subject: Re: Git and buildworld running at the same time Message-ID: References: List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7065, ipnet:50.1.16.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cQBY24DSMz450p On Sun, Sep 14, 2025 at 02:50:03PM -0700, Mark Millard wrote: > > >> At the moment git occupies 1.3 GB RAM, 505 MB swap and 10-15% CPU. > > The above "1.3 GB RAM" seems odd for a RPi2B with > only 1 GiByte of RAM. The ps columns are: > > USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND > > RSS is a RAM usage figure (768984); VSZ is Virtual > SiZe (1346480). VSZ can be bigger than RAM+SWAP for > the process, as I understand. (Making simple > arithmetic problematical.) > > Was the "505 MB" system level swap usage, instead > of process specific swap usage? > The numbers came from top's SIZE and RES columns, thinking SIZE was total memory and RES was in ram. In hindsight, I've no evidence for that interpretation. > > If I gather correctly, it looks like at times, when it > > will be a notable time before activity like building > > software, something like: > > > > git -C /usr/src/ gc --no-detach --auto > > > > would be appropriate. The "--no-detach" avoids it > > running in the background so you know when it is > > running vs. when it finishes. You would want to do > > this often enough to avoid fetch/merge --ff-only > > or pull from doing such automatically or having > > a lot of accumulated pending work to do. > > Knowing that a git pull will be followed by some background work it isn't really a problem. I was fooled into starting buildworld before git finished, now I know enough to let it finish. However, for a script the --no-detach is a useful addition, at least when confident git will finish successfully. > > There is: > > > > gc.autoDetach > > Make git gc --auto return immediately and run in the background if > > the system supports it. Default is true. This config variable acts as > > a fallback in case maintenance.autoDetach is not set. > > > > and also: > > > > maintenance.autoDetach > > Many Git commands trigger automatic maintenance after they have > > written data into the repository. This boolean config option controls > > whether this automatic maintenance shall happen in the foreground or > > whether the maintenance process shall detach and continue to run in > > the background. > > > > If unset, the value of gc.autoDetach is used as a fallback. Defaults > > to true if both are unset, meaning that the maintenance process will > > detach. > > > > So you can force it to not detach automatically. > > But, then, you might have a long wait for the > > command that added data to complete: > > > > # git -C /usr/src/ config maintenance.autoDetach false > > # git -C /usr/src/ config gc.autoDetach false I'm a little confused here: are the two commands above equivalent in action to git -C /usr/src/ gc --no-detach --auto when used in a one-line script? Thanks for writing! bob prohaska