From owner-freebsd-stable@freebsd.org Fri Apr 2 14:53:21 2021 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 943E857A240 for ; Fri, 2 Apr 2021 14:53:21 +0000 (UTC) (envelope-from warlock@phouka1.phouka.net) Received: from phouka1.phouka.net (phouka1.phouka.net [107.170.196.116]) (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 "phouka.net", Issuer "Go Daddy Secure Certificate Authority - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBjjD5cMJz3GYw for ; Fri, 2 Apr 2021 14:53:20 +0000 (UTC) (envelope-from warlock@phouka1.phouka.net) Received: from phouka1.phouka.net (localhost [127.0.0.1]) by phouka1.phouka.net (8.16.1/8.16.1) with ESMTPS id 132Epvnp081290 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 2 Apr 2021 07:51:57 -0700 (PDT) (envelope-from warlock@phouka1.phouka.net) Received: (from warlock@localhost) by phouka1.phouka.net (8.16.1/8.16.1/Submit) id 132EpvEJ081289; Fri, 2 Apr 2021 07:51:57 -0700 (PDT) (envelope-from warlock) Date: Fri, 2 Apr 2021 07:51:57 -0700 From: John Kennedy To: parv/freebsd Cc: freebsd-stable@freebsd.org Subject: Re: ZFS (in virtual machine): $HOME being a dataset causes xauth to timeout- access delays? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4FBjjD5cMJz3GYw X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of warlock@phouka1.phouka.net has no SPF policy when checking 107.170.196.116) smtp.mailfrom=warlock@phouka1.phouka.net X-Spamd-Result: default: False [0.21 / 15.00]; TO_DN_SOME(0.00)[]; SUBJECT_HAS_CURRENCY(1.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[warlock@phouka.net,warlock@phouka1.phouka.net]; R_DKIM_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[107.170.196.116:from]; ASN(0.00)[asn:14061, ipnet:107.170.192.0/18, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; FROM_NEQ_ENVFROM(0.00)[warlock@phouka.net,warlock@phouka1.phouka.net]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[phouka.net]; SPAMHAUS_ZRD(0.00)[107.170.196.116:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 14:53:21 -0000 On Thu, Apr 01, 2021 at 07:18:56PM -1000, parv/freebsd wrote: > On Thu, Apr 1, 2021 at 3:38 PM parv/freebsd wrote: > > I am wondering if $SRC_BASE, $MAKEOBJDIRPREFIX, & $WRKDIRPREFIX being > ZFS datasets now would increase compile time. I will found that out in > few weeks (in case of buildworld & kernel) as earlier I had both $SRC_BASE & > $MAKEOBJDIRPREFIX as plain directories & took ~5--6 hours. > > I have FreeBSD 12-STABLE in VirtualBox 5.2.44 on Windows 10. All the "disks" > > are file-backed virtual disks. > > > > I noticed that after making $HOME a ZFS dataset, there were delays ... > > - generally in start of Xorg; > > - exhibited by xauth (after using "startx") error messages about timeout > > with authority files. > > > > After reverting back $HOME not being a dataset on its own as before, there > > are no delays in start of Xorg; nor are any timeout message from xauth as > > before. > > > > Has anybody else noticed that? I can't say that I've noticed any slowness. I normally don't use xauth unless I'm doing something exotic (like su to another user but want to have them able to use my X display), so probably not the best example. I've also been using zfs on FreeBSD in favor of any other filesystem since it was an option, so I'm probably probably totally worthless for speed comparison. That being said... I often feel like I'm rocking the 1986 X vibes because, while I like eye candy, that eye candy is coming with a lot of baggage. Gnome/KDE? Hah! I'm using ctwm. But if you've got said eye candy that wants to walk your file system tree and you've got a /home/$USER/.zfs/snapshot with lots of backups that is magnifying your tree, something might be doing a lot more work than the designer was originally expecting. As far as ZFS datasets go, I keep stock+ to keep my snapshot space low. I added a few things onto the stock ZFS partitioning: zfs create -o canmount=off zroot/usr/home/$USER zfs create zroot/usr/home/$USER/.cache zfs create zroot/usr/home/$USER/.mozilla zfs create zroot/usr/ports/distfiles zfs create -o canmount=off zroot/usr/obj zfs create zroot/usr/obj/usr zfs create zroot/poudriere So /home -> /usr/home is a dataset by default, /home/$USER isn't (I'm the only user, so I wasn't worried there), but because I like doing snapshot backups of things and I noticed that my snapshots were pretty damn big for what I was working on, I decided to strip out the browser droppings by making a dataset for .cache and .mozilla. Doesn't scale, but just me. To keep my zroot/ROOT/default and boot environments clean, I created the datasets for /usr/obj (kernel objects) because that is generally disposable (except when I was doing RPI work and that was precious gold since it took days to rebuild and I might want it to match a kernel I reverted to). I added oen for /usr/ports/distfiles to keep it from bloating out /usr/ports, which is also easily reconstructed (vs the tarballs, which sometimes go AWOL). In any case, for /usr/obj, some variation of this is what I was looking at: # df -h / /usr/obj/usr Filesystem Size Used Avail Capacity Mounted on zroot/ROOT/default 67G 4.2G 63G 6% / zroot/usr/obj/usr 72G 8.6G 63G 12% /usr/obj/usr I do not need 8G of stuff that I'll probably never use again snapshotted with my root filesystem that I may keep around for extended periods of time. On disk, each of the roots generally seems to use ~1.2G of space with what they have in common, but I wasn't going to get that with /usr/obj. Now, I've got a pretty beefy box, so my compiling pain points may not match yours but you can do things like tune the datasets. For example, if you're CPU bound and you have a lot of compression on /usr/obj, you may want to turn that off (while being able to leave it on for the root partition).