Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 1998 20:57:36 +0100
From:      Tor Egge <Tor.Egge@idi.ntnu.no>
To:        toor@dyson.iquest.net
Cc:        freebsd@isvara.net, hackers@FreeBSD.ORG
Subject:   Re: VM messed: vm_page_free panic problem
Message-ID:  <199802161957.UAA07226@pat.idi.ntnu.no>
In-Reply-To: Your message of "Sat, 14 Feb 1998 12:35:13 -0500 (EST)"
References:  <199802141735.MAA06202@dyson.iquest.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> freebsd@isvara.net said:
> > Hi,
> >     I'm experiencing a problem with the freebsd-current bootdisks since
> > a weeks ago. I get the error:
> >     vm_page_free: pindex(12), busy(0), PG_BUSY(0), hold(0)
> >     panic: vm_page_free: freeing page
> > 
> > There is clearly a problem with the VM subsystem, and there have been a
> > few messages posted here with people pointing this out. Since this stops
> > people installing the latest freebsd-current, it could be considered
> > quite important.
> > 
> I'll try to look at it, but I am going to be very busy again next week.
> If someone else gets a chance to look into it, it would be helpful.

vnode_pager_getpages first called ffs_getpages. ffs_getpages assumes
that the underlying device has a getpages operation, and performes
some operations (e.g. freeing the 4 last pages passed to ffs_getpages).
Then the VOP_GETPAGES routine returns EOPNOTSUPP, and ffs_getpages
returns this error code.

vnode_pager_getpages assumes that the call to VOP_GETPAGES had no
side effects, and proceeds to call vnode_pager_leaf_getpages which
attempts to free the last 4 pages once more (with a panic as the
result).

I suggest adding a getpages operation to mfs, e.g. applying the
appended patch.

---
#0  boot (howto=260) at ../../kern/kern_shutdown.c:285
(kgdb) where
#0  boot (howto=260) at ../../kern/kern_shutdown.c:285
#1  0xf0118847 in panic (fmt=0xf01013f8 "from debugger")
    at ../../kern/kern_shutdown.c:425
#2  0xf0101415 in db_panic (addr=-264640668, have_addr=0, count=-1, 
    modif=0xf61bab58 "") at ../../ddb/db_command.c:432
#3  0xf01012f5 in db_command (last_cmdp=0xf0226aa4, cmd_table=0xf0226904, 
    aux_cmd_tablep=0xf039ecb0) at ../../ddb/db_command.c:332
#4  0xf0101482 in db_command_loop () at ../../ddb/db_command.c:454
#5  0xf0103b43 in db_trap (type=3, code=0) at ../../ddb/db_trap.c:71
#6  0xf01bb921 in kdb_trap (type=3, code=0, regs=0xf61bac44)
    at ../../i386/i386/db_interface.c:157
#7  0xf01c8e38 in trap (frame={tf_es = 16, tf_ds = 16, tf_edi = 0, 
      tf_esi = -266674698, tf_ebp = -165958520, tf_isp = -165958548, 
      tf_ebx = 256, tf_edx = -266618091, tf_ecx = 0, tf_eax = 18, 
      tf_trapno = 3, tf_err = 0, tf_eip = -266618035, tf_cs = 8, 
      tf_eflags = 598, tf_esp = -266618107, tf_ss = -267286564})
    at ../../i386/i386/trap.c:474
#8  0xf01bbb4d in Debugger (msg=0xf01187dc "panic")
    at ../../i386/i386/db_interface.c:316
#9  0xf011883e in panic (fmt=0xf01addf6 "vm_page_free: freeing free page")
    at ../../kern/kern_shutdown.c:423
#10 0xf01adecd in vm_page_freechk_and_unqueue (m=0xf093ed98)
    at ../../vm/vm_page.c:1048
#11 0xf01adfc4 in vm_page_free (m=0xf093ed98) at ../../vm/vm_page.c:1135
#12 0xf01b15ff in vnode_pager_freepage (m=0xf093ed98)
    at ../../vm/vnode_pager.c:318
#13 0xf01b1e63 in vnode_pager_leaf_getpages (object=0xf03afda4, m=0xf61badb4, 
    count=16, reqpage=0) at ../../vm/vnode_pager.c:656
#14 0xf01b1b55 in vnode_pager_getpages (object=0xf03afda4, m=0xf61badb4, 
    count=16, reqpage=0) at ../../vm/vnode_pager.c:542
#15 0xf01b08a3 in vm_pager_get_pages (object=0xf03afda4, m=0xf61badb4, 
    count=16, reqpage=0) at ../../vm/vm_pager.c:182
#16 0xf01118ea in exec_map_first_page (imgp=0xf61bae90)
    at ../../kern/kern_exec.c:394

#17 0xf011140e in execve (p=0xf61b4ec0, uap=0xf61baf98)
    at ../../kern/kern_exec.c:173
#18 0xf010d128 in start_init (p=0xf61b4ec0) at ../../kern/init_main.c:639
#19 0xf010cf56 in kthread_init (dummy=0x0) at ../../kern/init_main.c:532
#20 0xf01bcbe3 in fork_trampoline ()
Cannot access memory at address 0x1ffff000.
(kgdb) up 15
#15 0xf01b08a3 in vm_pager_get_pages (object=0xf03afda4, m=0xf61badb4, 
    count=16, reqpage=0) at ../../vm/vm_pager.c:182
(kgdb) down
#14 0xf01b1b55 in vnode_pager_getpages (object=0xf03afda4, m=0xf61badb4, 
    count=16, reqpage=0) at ../../vm/vnode_pager.c:542
(kgdb) list
537		struct vnode *vp;
538	
539		vp = object->handle;
540		rtval = VOP_GETPAGES(vp, m, count*PAGE_SIZE, reqpage, 0);
541		if (rtval == EOPNOTSUPP)
542			return vnode_pager_leaf_getpages(object, m, count, reqpage);
543		else
544			return rtval;
545	}
546	
(kgdb) print vop_getpages_desc
$1 = {vdesc_offset = 40, vdesc_name = 0xf01006c4 "vop_getpages", 
  vdesc_flags = 0, vdesc_vp_offsets = 0xf0226728, vdesc_vpp_offset = -1, 
  vdesc_cred_offset = -1, vdesc_proc_offset = -1, 
  vdesc_componentname_offset = -1, vdesc_transports = 0x0}
(kgdb) print vp
$2 = (struct vnode *) 0x0
(kgdb) print ((struct vnode *) object->handle)->v_op[40]
$3 = (int (*)()) 0xf019c17c <ffs_getpages>
(kgdb)
-----

Index: mfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/mfs/mfs_vnops.c,v
retrieving revision 1.34
diff -u -r1.34 mfs_vnops.c
--- mfs_vnops.c	1998/01/01 12:40:25	1.34
+++ mfs_vnops.c	1998/02/16 18:57:06
@@ -56,6 +56,7 @@
 static int	mfs_reclaim __P((struct vop_reclaim_args *)); /* XXX */
 static int	mfs_print __P((struct vop_print_args *)); /* XXX */
 static int	mfs_strategy __P((struct vop_strategy_args *)); /* XXX */
+static int	mfs_getpages __P((struct vop_getpages_args *)); /* XXX */
 /*
  * mfs vnode operations.
  */
@@ -66,7 +67,7 @@
 	{ &vop_bwrite_desc,		(vop_t *) vop_defaultop },
 	{ &vop_close_desc,		(vop_t *) mfs_close },
 	{ &vop_fsync_desc,		(vop_t *) mfs_fsync },
-	{ &vop_getpages_desc,		(vop_t *) vop_defaultop },
+	{ &vop_getpages_desc,		(vop_t *) mfs_getpages },
 	{ &vop_inactive_desc,		(vop_t *) mfs_inactive },
 	{ &vop_ioctl_desc,		(vop_t *) vop_enotty },
 	{ &vop_islocked_desc,		(vop_t *) vop_defaultop },
@@ -310,4 +311,13 @@
 	i = vop_defaultop(ap);
 	printf("mfs_badop[%s] = %d\n", ap->a_desc->vdesc_name,i);
 	return (i);
+}
+
+
+static int
+mfs_getpages(ap)
+	struct vop_getpages_args *ap;
+{
+
+	return (VOCALL(spec_vnodeop_p, VOFFSET(vop_getpages), ap));
 }


- Tor Egge

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802161957.UAA07226>