Date: Sun, 15 Jun 2008 13:19:18 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Dmitry Morozovsky <marck@rinet.ru> Cc: delphij@freebsd.org, current@freebsd.org Subject: Re: tmpfs panic Message-ID: <20080615101918.GA94309@deviant.kiev.zoral.com.ua> In-Reply-To: <20080615130037.J43777@woozle.rinet.ru> References: <20080615130037.J43777@woozle.rinet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <Address 0x104 out of bounds= >) 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080615101918.GA94309>