From owner-freebsd-current@FreeBSD.ORG Sun Jun 15 10:48:12 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2AD81065672; Sun, 15 Jun 2008 10:48:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 3200A8FC1B; Sun, 15 Jun 2008 10:48:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m5FANdXs012564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Jun 2008 13:23:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m5FAJJMe046756; Sun, 15 Jun 2008 13:19:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m5FAJJlT046755; Sun, 15 Jun 2008 13:19:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 15 Jun 2008 13:19:18 +0300 From: Kostik Belousov To: Dmitry Morozovsky Message-ID: <20080615101918.GA94309@deviant.kiev.zoral.com.ua> References: <20080615130037.J43777@woozle.rinet.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bLzFIlwpOfW+4Y/z" Content-Disposition: inline In-Reply-To: <20080615130037.J43777@woozle.rinet.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua Cc: delphij@freebsd.org, current@freebsd.org Subject: Re: tmpfs panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2008 10:48:12 -0000 --bLzFIlwpOfW+4Y/z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 15, 2008 at 01:06:24PM +0400, Dmitry Morozovsky wrote: > Hi there, >=20 > at contemporary RELENG_7/amd64 >=20 > panic at umount phase (shutdown -r in progress): >=20 > (kgdb) bt > #0 doadump () at pcpu.h:194 > #1 0x0000000000000010 in ?? () > #2 0xffffffff8021f530 in boot (howto=3D260) at=20 > /usr/src/sys/kern/kern_shutdown.c:418 > #3 0xffffffff8021f94d in panic (fmt=3D0x104
) at=20 > /usr/src/sys/kern/kern_shutdown.c:572 > #4 0xffffffff80394a64 in trap_fatal (frame=3D0xffffff00012129c0,=20 > eva=3D18446742974216866000) at /usr/src/sys/amd64/amd64/trap.c:724 > #5 0xffffffff80394e35 in trap_pfault (frame=3D0xffffffffd517e8d0, usermo= de=3D0) at=20 > /usr/src/sys/amd64/amd64/trap.c:641 > #6 0xffffffff803957db in trap (frame=3D0xffffffffd517e8d0) at=20 > /usr/src/sys/amd64/amd64/trap.c:410 > #7 0xffffffff8037b54e in calltrap () at=20 > /usr/src/sys/amd64/amd64/exception.S:169 > #8 0xffffffff802138dd in _mtx_lock_sleep (m=3D0xffffff00b41cbe78,=20 > tid=3D18446742974216874432, opts=3DVariable "opts" is not available. > ) at /usr/src/sys/kern/kern_mutex.c:335 > #9 0xffffffff80297b25 in vgone (vp=3D0xffffff00b41cbd90) at=20 > /usr/src/sys/kern/vfs_subr.c:2471 > #10 0xffffffff8074d10e in tmpfs_alloc_vp (mp=3D0xffffff000933c978,=20 > node=3D0xffffff00cef55000, lkflag=3D4098, vpp=3D0xffffffffd517ea98,=20 > td=3D0xffffff00012129c0) > at /usr/src/sys/modules/tmpfs/../../fs/tmpfs/tmpfs_subr.c:396 > #11 0xffffffff8074c868 in tmpfs_root (mp=3DVariable "mp" is not available. > ) at /usr/src/sys/modules/tmpfs/../../fs/tmpfs/tmpfs_vfsops.c:388 > #12 0xffffffff80294b27 in dounmount (mp=3D0xffffff000933c978, flags=3D524= 288,=20 > td=3D0xffffff00012129c0) at /usr/src/sys/kern/vfs_mount.c:1273 > #13 0xffffffff80297ecc in vfs_unmountall () at=20 > /usr/src/sys/kern/vfs_subr.c:2936 > #14 0xffffffff8021f7c9 in boot (howto=3D0) at=20 > /usr/src/sys/kern/kern_shutdown.c:400 > #15 0xffffffff8021fab9 in reboot (td=3DVariable "td" is not available. > ) at /usr/src/sys/kern/kern_shutdown.c:172 > #16 0xffffffff803950ba in syscall (frame=3D0xffffffffd517ec70) at=20 > /usr/src/sys/amd64/amd64/trap.c:852 > #17 0xffffffff8037b75b in Xfast_syscall () at=20 > /usr/src/sys/amd64/amd64/exception.S:290 > #18 0x00000000004084ec in ?? () > Previous frame inner to this frame (corrupt stack?) I suspect this may be my mistake. IN case you can reproduce it, please, try the patch below. diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index cc1b75f..0c537c4 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -391,11 +391,8 @@ loop: =20 vnode_pager_setsize(vp, node->tn_size); error =3D insmntque(vp, mp); - if (error) { - vgone(vp); - vput(vp); + if (error) vp =3D NULL; - } =20 unlock: TMPFS_NODE_LOCK(node); >=20 > Also, active tmpfs usage easy leads to "swap zone exhausted, increase > kern.maxswzone", even with 2G RAM + 4G swap and approx 2-3G of tmpfs > in use -- any hints? I think the message is pretty much self-explanatory. Kernel tried to allocate the meatadata to track the swap metadata, and zone appears exhausted. It is not the swap space shortage. Instead, this is kernel zone used to track swap allocation shortage. It is quite non-obvious how to automatically tune this limit, since zone is allocated before swap is configured. --bLzFIlwpOfW+4Y/z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkhU7KYACgkQC3+MBN1Mb4joRgCggXksCusJhxlpzy6UOqplxrXr OvkAn1EKbyPvYsMWiDrYEGxJYQ9AQGbg =30S8 -----END PGP SIGNATURE----- --bLzFIlwpOfW+4Y/z--