From nobody Thu Jun 09 08:23:00 2022 X-Original-To: freebsd-hackers@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 D6F46844612 for ; Thu, 9 Jun 2022 08:23:04 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJcY45Vqtz4Zlm; Thu, 9 Jun 2022 08:23:04 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654762984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yoZs6aZBlTZprWF9Bkpb3YXNGNjkpOBx4db8+qhLIlQ=; b=EOZCdC8C01UWWRdXH2WGIekv3/Gx/xKojVumga1zFRaZHLOiV00tSF3VgyFqTH7KitWPPU tQvkEZfvJ7Uhnlz0nBsHPry8QSCksKmqnds+ODIZxTGie4nT2UmqBOMbWHXGbfPLXkq6jd I4umsmUMt38l1AChxE/FBwozYTSOG49sLD/L1FmLLCyk20O1MB4zjQ3tZXmOWpm0YJEyOL eGxiEiNGTxRQ81/DyK1RX93KTuHeK++wnSCgZJJ2ZZsJYN58tcUNggP/l/WLJaWK6OJYMK xbI+poexPExywiYDU9dXl0ZE0dPOCawyp7YfyEh5A5sBQrCR2YDxGu5NDzoKUg== Received: from [IPV6:2003:cd:5f17:8800:7c28:a844:b85e:7f82] (p200300cd5f1788007c28a844b85e7f82.dip0.t-ipconnect.de [IPv6:2003:cd:5f17:8800:7c28:a844:b85e:7f82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2F4BEDD36; Thu, 9 Jun 2022 08:23:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <24c79e23-a715-6222-452f-24a9186dce89@FreeBSD.org> Date: Thu, 9 Jun 2022 10:23:00 +0200 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Any clue why "df -m" vs. "du -xsAm" get such different results for the tmpfs in question (403 MiBytes vs. 101 MiBytes)? Content-Language: en-US To: Mark Millard References: <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325.ref@yahoo.com> <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325@yahoo.com> From: Stefan Esser Cc: FreeBSD Hackers In-Reply-To: <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325@yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------zwlWQj06LewrfD4iZ0BQH2h4" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654762984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yoZs6aZBlTZprWF9Bkpb3YXNGNjkpOBx4db8+qhLIlQ=; b=gMzL8aqMP7nmBVLZmKxDu4ARLrCOBI/OMlHDgc5kmfNugiz3hJNB7/iDkmkswlw2p5Pm+w aNSPY9rTrFdRYMsQtvJvDEBSMh18/3yb12I9WItzdDTb6JD3CctdNcoGlqCxeGuoYvn6Vw U8GgOZHj/qUF5hctTB5FolwLFNs6NtzI3t7deQaweB7CKkoMK3TyGSDEQLOcyGzUeF8Us+ t+Cx5YdP8mOSLGBvX7PIUwukP6jwozMboAJwbIEYUgMkx9kxIyVimY/jQoH0wGvVizSnYC nJrW4gTUoAd+o009VsAhtblLPE1zbxz8wMJAqxK3wKGaAjZen/nF8eG7Pmy0Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654762984; a=rsa-sha256; cv=none; b=nhZNBPbknwL2J10agcV0nLACD7SiN6xmJvsAYM3bdbod0hC38yaDPWGDKKFJHQst+o7A5b bVnR2oeStwz9GXTr5WgfwyFVuV7q20PJUPOy9TKilh2sMvNLY4Uxz0FFI+kJxFHBnLsBwY sBzkWmFw5JP+tqriI37/AKd497ZrNhju7rBEytubm9BsW6OT1G3xbnbcpwOrr3hiBQjyaC 2WLKRJz7GF3WHMemvXuKnjWTnB2up/S3tP17E4EcySLcc811l2Nmb3AcRXguDDiXlLPHPQ 1P16UD52VEam7Qj5qrqY+5vaz70UiLdcLRO0gl5uIAzLtJewyl9j0p/1nK0OZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------zwlWQj06LewrfD4iZ0BQH2h4 Content-Type: multipart/mixed; boundary="------------YGsBCTzS0SSPbzwlEvB9UgVy"; protected-headers="v1" From: Stefan Esser To: Mark Millard Cc: FreeBSD Hackers Message-ID: <24c79e23-a715-6222-452f-24a9186dce89@FreeBSD.org> Subject: Re: Any clue why "df -m" vs. "du -xsAm" get such different results for the tmpfs in question (403 MiBytes vs. 101 MiBytes)? References: <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325.ref@yahoo.com> <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325@yahoo.com> In-Reply-To: <4997AB05-8CD4-4A2C-AAB3-34F6DB2CE325@yahoo.com> --------------YGsBCTzS0SSPbzwlEvB9UgVy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 08.06.22 um 21:54 schrieb Mark Millard: > # df -m | egrep "(^Filesystem|^tmpfs)" > Filesystem 1M-blocks Used Avail Capacity Mounted on=20 > tmpfs 1024 403 620 39% /usr/local/poudriere/dat= a/.m/main-CA7-bulk_a-default > So the comparison is with the line that lists Used as 403 (MiBytes): > # du -xsAm /usr/local/poudriere/data/.m/main-CA7-bulk_a-default/ref/.p > 101 /usr/local/poudriere/data/.m/main-CA7-bulk_a-default/ref/.p > # du -xsm /usr/local/poudriere/data/.m/main-CA7-bulk_a-default/ref/.p > 68 /usr/local/poudriere/data/.m/main-CA7-bulk_a-default/ref/.p > Why 403 vs. 101 ? Hi Mark, have you checked for unlinked but still open files on that tmpfs? My quick test with /tmp on tmpfs did not show any anomalies: # du -xsm /tmp 730 /tmp # df -m /tmp Filesystem 1M-blocks Used Avail Capacity Mounted on tmpfs 16384 733 15650 4% /tmp I do not know of a simple way to check for blocks allocated by files that are open but have been unlinked, though. (I did not get any usable results from lsof, fstat, and pstat - may be I have missed a tool that grabs that information from the kernel.) The best I could get is this pstat output: se sleep 89643 text / 25349 -r-xr-xr-x 8592 r se sleep 89643 ctty /dev 157 crw--w---- pts/0 rw se sleep 89643 wd /tmp 2 drwxrwxrwt 51584 r se sleep 89643 root / 4 drwxr-xr-x 47 r se sleep 89643 0 /dev 67 crw-rw-rw- null r se sleep 89643 1 - 137245 -rw-r--r-- 5 w se sleep 89643 2 /dev 157 crw--w---- pts/0 rw This is for a sleep with stdout redirected to a file on tmpfs and the file then deleted while the sleep command has it open. As long as it had not been deleted, pstat showed that it resided in /tmp: se sleep 89643 1 /tmp 137245 -rw-r--r-- 5 w But you can compare the number of inodes reported by "df -i ." and the number of files found by "find . | wc". Run these commands as root in order to not miss files that are not accessible to a non-privileged user ... Regards, STefan --------------YGsBCTzS0SSPbzwlEvB9UgVy-- --------------zwlWQj06LewrfD4iZ0BQH2h4 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmKhreQFAwAAAAAACgkQR+u171r99UTQ 3gf+OXnslrRsBkxAngHlTZ89OUNcyWEkvC+fCFvZgq2k8rgOaFbpOkCaohtsgrzB9yWAt0Mgy3IE VhLe5ASIcWAVNKSCuwcY21dKwrmKrcMP2E8Gt795wQmzYSxMwdxfBdWawMea8JI56xbx0ZzIS97a 6EGOQkwH22TqdQx2OfY6Xpr3lhoKEHGrKLJoO7nwqF7OZkBisWN4x1bZKFyBbLHuHINSYyFuR0bm j7xRO8Zsa539yw4Sex/NcODI+pw/aMlQJhnCkUAvDfEhZHo8XH/2p4umG2EASVlKNBzG9UjyRPWB 6KBy4mXpzWCyu6gTgOS10q49c+bCz+2zE/eGJruTFw== =MoN8 -----END PGP SIGNATURE----- --------------zwlWQj06LewrfD4iZ0BQH2h4--