Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Mar 1998 18:51:06 -0800
From:      Julian Elischer <julian@whistle.com>
To:        Ollivier Robert <roberto@keltia.freenix.fr>, current@FreeBSD.ORG, mckusick@mcKusick.com
Subject:   Re: page fault (-current && softupdates)
Message-ID:  <3504AA9A.7566F4CF@whistle.com>
References:  <19980308230222.A9458@keltia.freenix.fr> <13409.889399148@critter.freebsd.dk> <19980309233834.A297@keltia.freenix.fr> <35048708.6201DD56@whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--------------4DAA423A3359056542877E5C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Julian Elischer wrote:
> 
> Here's a bit more info on teh Soft Update problem..
> 
>
And here's another dump:

--------------4DAA423A3359056542877E5C
Content-Type: text/plain; charset=iso-8859-1; name="gdb3"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="gdb3"

 Once again.. note that:
 BC == bcopy that makes a stack frame.

Script started on Tue Mar 10 02:06:49 1998
phaser2# gdb
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc.
Debugger (msg=0xf01195ec "panic") at ../../i386/i386/db_interface.c:319
319	}
(gdb) wg here
#0  Debugger (msg=0xf01195ec "panic") at ../../i386/i386/db_interface.c:319
#1  0xf011964e in panic (
    fmt=0xf01cc297 "vm_fault: fault on nofault entry, addr: %lx")
    at ../../kern/kern_shutdown.c:434
#2  0xf01cc42e in vm_fault (map=0xf0265adc, vaddr=4052631552, 
    fault_type=3 '\003', fault_flags=0) at ../../vm/vm_fault.c:233
#3  0xf01ecf48 in trap_pfault (frame=0xf2c66c80, usermode=0)
    at ../../i386/i386/trap.c:724
#4  0xf01ecbc7 in trap (frame={tf_es = 16, tf_ds = -222429168, 
      tf_edi = -242335744, tf_esi = -242575360, tf_ebp = -221877036, 
      tf_isp = -221877080, tf_ebx = -248785580, tf_edx = 0, tf_ecx = 512, 
      tf_eax = 239616, tf_trapno = 12, tf_err = 2, tf_eip = -266421574, 
      tf_cs = 8, tf_eflags = 66054, tf_esp = -259861696, tf_ss = -260514784})
    at ../../i386/i386/trap.c:363
#5  0xf01e3901 in calltrap ()
#6  0xf01bc2b6 in setup_allocindir_phase2 (bp=0xf12bd554, ip=0xf0866400, 
    aip=0xf082d340) at ../../ufs/ffs/ffs_softdep.c:1537
#7  0xf01bbf7b in softdep_setup_allocindir_page (ip=0xf0866400, lbn=45, 
    bp=0xf12bd554, ptrno=33, newblkno=230792, oldblkno=0, nbp=0xf12c3094)
    at ../../ufs/ffs/ffs_softdep.c:1419
#8  0xf01b94ed in ffs_balloc (ap=0xf2c66ea4) at ../../ufs/ffs/ffs_balloc.c:302
#9  0xf01c2d0c in ffs_write (ap=0xf2c66ef8) at vnode_if.h:995
#10 0xf013de97 in vn_write (fp=0xf08c6e40, uio=0xf2c66f40, cred=0xf0706800)
    at vnode_if.h:331
---Type <return> to continue, or q <return> to quit---up 6    
#11 0xf012122b in write (p=0xf2bf2f80, uap=0xf2c66f94)
    at ../../kern/sys_generic.c:268
#12 0xf01ed7af in syscall (frame={tf_es = -272695257, tf_ds = -221904857, 
      tf_edi = 123588, tf_esi = 888832, tf_ebp = -272649576, 
      tf_isp = -221876252, tf_ebx = 123588, tf_edx = 0, tf_ecx = 0, 
      tf_eax = 4, tf_trapno = 12, tf_err = 7, tf_eip = 116357, tf_cs = 31, 
      tf_eflags = 518, tf_esp = -272649596, tf_ss = 39})
    at ../../i386/i386/trap.c:994
#13 0xf01e3955 in Xsyscall ()
#14 0x1a5b6 in ?? ()
#15 0x1a566 in ?? ()
#16 0x17720 in ?? ()
#17 0xf729 in ?? ()
#18 0x71e2 in ?? ()
#19 0xb5d2 in ?? ()
#20 0xbc55 in ?? ()
#21 0x5183 in ?? ()
#22 0x1459 in ?? ()
#23 0x107e in ?? ()
(gdb) up 6
#6  0xf01bc2b6 in setup_allocindir_phase2 (bp=0xf12bd554, ip=0xf0866400, 
    aip=0xf082d340) at ../../ufs/ffs/ffs_softdep.c:1537
1537			BC((caddr_t)newindirdep->ir_saveddata,
(gdb) list setup_allocindir_phase2
1447	static void 
1448	setup_allocindir_phase2(bp, ip, aip)
1449		struct buf *bp;		/* in-memory copy of the indirect block */
1450		struct inode *ip;	/* inode for file being extended */
1451		struct allocindir *aip;	/* allocindir allocated by the above routines */
1452	{
1453		struct worklist *wk;
1454		struct indirdep *indirdep, *newindirdep;
1455		struct bmsafemap *bmsafemap;
1456		struct allocindir *oldaip;
(gdb) 
1457		struct freefrag *freefrag;
1458		struct newblk *newblk;
1459	
1460		if (bp->b_lblkno >= 0)
1461			panic("setup_allocindir_phase2: not indir blk");
1462		for (indirdep = NULL, newindirdep = NULL; ; ) {
1463			ACQUIRE_LOCK(&lk);
1464			for (wk = LIST_FIRST(&bp->b_dep); wk;
1465			     wk = LIST_NEXT(wk, wk_list)) {
1466				if (wk->wk_type != D_INDIRDEP)
(gdb) 
1467					continue;
1468				indirdep = WK_INDIRDEP(wk);
1469				break;
1470			}
1471			if (indirdep == NULL && newindirdep) {
1472				indirdep = newindirdep;
1473				WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list);
1474				newindirdep = NULL;
1475			}
1476			FREE_LOCK(&lk);
(gdb) 
1477			if (indirdep) {
1478				if (newblk_lookup(ip->i_fs, aip->ai_newblkno, 0,
1479				    &newblk) == 0)
1480					panic("setup_allocindir: lost block");
1481				ACQUIRE_LOCK(&lk);
1482				if (newblk->nb_state == DEPCOMPLETE) {
1483					aip->ai_state |= DEPCOMPLETE;
1484					aip->ai_buf = NULL;
1485				} else {
1486					bmsafemap = newblk->nb_bmsafemap;
(gdb) 
1487					aip->ai_buf = bmsafemap->sm_buf;
1488					LIST_REMOVE(newblk, nb_deps);
1489					LIST_INSERT_HEAD(&bmsafemap->sm_allocindirhd,
1490					    aip, ai_deps);
1491				}
1492				LIST_REMOVE(newblk, nb_hash);
1493				FREE(newblk, M_NEWBLK);
1494				aip->ai_indirdep = indirdep;
1495				/*
1496				 * Check to see if there is an existing dependency
(gdb) 
1497				 * for this block. If there is, merge the old
1498				 * dependency into the new one.
1499				 */
1500				if (aip->ai_oldblkno == 0)
1501					oldaip = NULL;
1502				else
1503					for (oldaip=LIST_FIRST(&indirdep->ir_deplisthd);
1504					    oldaip; oldaip = LIST_NEXT(oldaip, ai_next))
1505						if (oldaip->ai_offset == aip->ai_offset)
1506							break;
(gdb) 
1507				if (oldaip != NULL) {
1508					if (oldaip->ai_newblkno != aip->ai_oldblkno)
1509						panic("setup_allocindir_phase2: blkno");
1510					aip->ai_oldblkno = oldaip->ai_oldblkno;
1511					freefrag = oldaip->ai_freefrag;
1512					oldaip->ai_freefrag = aip->ai_freefrag;
1513					aip->ai_freefrag = freefrag;
1514					free_allocindir(oldaip, NULL);
1515				}
1516				LIST_INSERT_HEAD(&indirdep->ir_deplisthd, aip, ai_next);
(gdb) 
1517				((ufs_daddr_t *)indirdep->ir_savebp->b_data)
1518				    [aip->ai_offset] = aip->ai_oldblkno;
1519				FREE_LOCK(&lk);
1520			}
1521			if (newindirdep) {
1522				if (indirdep->ir_savebp != NULL)
1523					brelse(newindirdep->ir_savebp);
1524				WORKITEM_FREE((caddr_t)newindirdep, D_INDIRDEP);
1525			}
1526			if (indirdep)
(gdb) 
1527				break;
1528			MALLOC(newindirdep, struct indirdep *, sizeof(struct indirdep),
1529				M_INDIRDEP, M_WAITOK);
1530			newindirdep->ir_list.wk_type = D_INDIRDEP;
1531			newindirdep->ir_state = ATTACHED;
1532			LIST_INIT(&newindirdep->ir_deplisthd);
1533			LIST_INIT(&newindirdep->ir_donehd);
1534			newindirdep->ir_saveddata = (ufs_daddr_t *)bp->b_data;
1535			newindirdep->ir_savebp =
1536			    getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0);
(gdb) 
1537			BC((caddr_t)newindirdep->ir_saveddata,
1538			    newindirdep->ir_savebp->b_data, bp->b_bcount);
1539		}
1540	}
1541	
1542	/*
1543	 * Block de-allocation dependencies.
1544	 * 
1545	 * When blocks are de-allocated, the on-disk pointers must be nullified before
1546	 * the blocks are made available for use by other files.  (The true
(gdb) up
#7  0xf01bbf7b in softdep_setup_allocindir_page (ip=0xf0866400, lbn=45, 
    bp=0xf12bd554, ptrno=33, newblkno=230792, oldblkno=0, nbp=0xf12c3094)
    at ../../ufs/ffs/ffs_softdep.c:1419
1419		setup_allocindir_phase2(bp, ip, aip);
(gdb) p *bp
$1 = {b_hash = {le_next = 0x0, le_prev = 0xf025f4dc}, b_vnbufs = {
    le_next = 0x0, le_prev = 0xf128fda4}, b_freelist = {tqe_next = 0xf12a7604, 
    tqe_prev = 0xf128fdac}, b_act = {tqe_next = 0xf128eb5c, 
    tqe_prev = 0xf0681dd4}, b_proc = 0x0, b_flags = 536870960, b_qindex = 0, 
  b_usecount = 12 '\f', b_error = 0, b_bufsize = 8192, b_bcount = 8192, 
  b_resid = 0, b_dev = 4294967295, b_data = 0xf18a8000 "ð\203\003", 
  b_kvabase = 0xf18a8000 "ð\203\003", b_kvasize = 8192, b_lblkno = -12, 
  b_blkno = -12, b_iodone = 0, b_iodone_chain = 0x0, b_vp = 0xf2c4d360, 
  b_dirtyoff = 0, b_dirtyend = 0, b_generation = 967, b_rcred = 0x0, 
  b_wcred = 0x0, b_validoff = 0, b_validend = 0, b_pblkno = 2430313, 
  b_saveaddr = 0x0, b_savekva = 0x0, b_driver1 = 0x0, b_driver2 = 0x0, 
  b_spc = 0x0, b_cluster = {cluster_head = {tqh_first = 0xf12b17fc, 
      tqh_last = 0xf1287674}, cluster_entry = {tqe_next = 0xf12b17fc, 
      tqe_prev = 0xf1287674}}, b_pages = {0xf0439ed8, 0xf046d20c, 
    0x0 <repeats 30 times>}, b_npages = 2, b_dep = {lh_first = 0x0}}
(gdb) p *ip
$2 = {i_lock = {lk_interlock = {lock_data = 0}, lk_flags = 1024, 
    lk_sharecount = 0, lk_waitcount = 0, lk_exclusivecount = 1, lk_prio = 8, 
    lk_wmesg = 0xf01c1e2b "inode", lk_timo = 0, lk_lockholder = 2867}, 
  i_hash = {le_next = 0x0, le_prev = 0xf06a4d7c}, i_vnode = 0xf2c4d360, 
  i_devvp = 0xf2bef060, i_flag = 142, i_dev = 132102, i_number = 46937, 
  i_effnlink = 1, inode_u = {fs = 0xf06b5000, e2fs = 0xf06b5000}, i_dquot = {
    0x0, 0x0}, i_modrev = 0x35049bb806112e8c, i_lockf = 0x0, i_count = 0, 
  i_endoff = 0, i_diroff = 0, i_offset = 0, i_ino = 0, i_reclen = 0, 
  i_spare = {0, 0, 0, 0, 0}, i_din = {di_mode = 33188, di_nlink = 1, di_u = {
      oldids = {0, 0}, inumber = 0}, di_size = 458279, di_atime = 889494456, 
    di_atimensec = 0, di_mtime = 889494493, di_mtimensec = 0, 
    di_ctime = 889494493, di_ctimensec = 0, di_db = {200392, 200456, 200488, 
      200496, 200504, 200512, 200520, 200528, 200536, 200544, 200552, 200560}, 
    di_ib = {230376, 0, 0}, di_flags = 0, di_blocks = 832, di_gen = 836009892, 
    di_uid = 0, di_gid = 0, di_spare = {0, 0}}}
(gdb) p aip
$3 = (struct allocindir *) 0xf082d340
(gdb) p *aip
$4 = {ai_list = {wk_list = {le_next = 0x0, le_prev = 0xf12c31b4}, wk_type = 6, 
    wk_state = 32769}, ai_next = {le_next = 0x0, le_prev = 0x0}, 
  ai_offset = 33, ai_newblkno = 230792, ai_oldblkno = 0, ai_freefrag = 0x0, 
  ai_indirdep = 0x0, ai_deps = {le_next = 0x0, le_prev = 0x0}, ai_buf = 0x0}
(gdb) list
1414		if ((ip->i_mode & IFMT) == IFDIR &&
1415		    pagedep_lookup(ip, lbn, DEPALLOC, &pagedep) == 0)
1416			WORKLIST_INSERT(&nbp->b_dep, &pagedep->pd_list);
1417		WORKLIST_INSERT(&nbp->b_dep, &aip->ai_list);
1418		FREE_LOCK(&lk);
1419		setup_allocindir_phase2(bp, ip, aip);
1420	}
1421	
1422	/*
1423	 * Called just before setting an indirect block pointer to a
(gdb) p *nbp
$5 = {b_hash = {le_next = 0xf129d89c, le_prev = 0xf025f5c0}, b_vnbufs = {
    le_next = 0xf12969f8, le_prev = 0xf2c4d390}, b_freelist = {
    tqe_next = 0xf129d2e8, tqe_prev = 0xf024be40}, b_act = {tqe_next = 0x0, 
    tqe_prev = 0xf0681dd4}, b_proc = 0x0, b_flags = 536870928, b_qindex = 0, 
  b_usecount = 5 '\005', b_error = 0, b_bufsize = 8192, b_bcount = 8192, 
  b_resid = 0, b_dev = 4294967295, b_data = 0xf1948000 "", 
  b_kvabase = 0xf1948000 "", b_kvasize = 8192, b_lblkno = 45, 
  b_blkno = 461584, b_iodone = 0, b_iodone_chain = 0x0, b_vp = 0xf2c4d360, 
  b_dirtyoff = 0, b_dirtyend = 0, b_generation = 961, b_rcred = 0x0, 
  b_wcred = 0x0, b_validoff = 0, b_validend = 0, b_pblkno = 2067583, 
  b_saveaddr = 0x0, b_savekva = 0x0, b_driver1 = 0x0, b_driver2 = 0x0, 
  b_spc = 0x0, b_cluster = {cluster_head = {tqh_first = 0xf12c2c04, 
      tqh_last = 0xf12b1524}, cluster_entry = {tqe_next = 0xf12c2c04, 
      tqe_prev = 0xf12b1524}}, b_pages = {0xf043dd00, 0xf0438234, 
    0x0 <repeats 30 times>}, b_npages = 2, b_dep = {lh_first = 0xf082d340}}
(gdb) p lbn
$6 = 45
(gdb) list
1424	 * newly allocated indirect block.
1425	 */
1426	void
1427	softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
1428		struct buf *nbp;	/* newly allocated indirect block */
1429		struct inode *ip;	/* inode for file being extended */
1430		struct buf *bp;		/* indirect block referencing allocated block */
1431		int ptrno;		/* offset of pointer in indirect block */
1432		ufs_daddr_t newblkno;	/* disk block number being added */
1433	{
(gdb) down
#6  0xf01bc2b6 in setup_allocindir_phase2 (bp=0xf12bd554, ip=0xf0866400, 
    aip=0xf082d340) at ../../ufs/ffs/ffs_softdep.c:1537
1537			BC((caddr_t)newindirdep->ir_saveddata,
(gdb) list
1532			LIST_INIT(&newindirdep->ir_deplisthd);
1533			LIST_INIT(&newindirdep->ir_donehd);
1534			newindirdep->ir_saveddata = (ufs_daddr_t *)bp->b_data;
1535			newindirdep->ir_savebp =
1536			    getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0);
1537			BC((caddr_t)newindirdep->ir_saveddata,
1538			    newindirdep->ir_savebp->b_data, bp->b_bcount);
1539		}
1540	}
1541	
(gdb) p newindirdep
$7 = (struct indirdep *) 0xf18a9800
(gdb) p *$7
$8 = {ir_list = {wk_list = {le_next = 0x0, le_prev = 0x0}, wk_type = 0, 
    wk_state = 0}, ir_saveddata = 0x0, ir_savebp = 0x0, ir_donehd = {
    lh_first = 0x0}, ir_deplisthd = {lh_first = 0x0}}
(gdb) list      quit
The program is running.  Quit anyway (and kill it)? (y or n) y
phaser2# exit

Script done on Tue Mar 10 02:09:50 1998

--------------4DAA423A3359056542877E5C--


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3504AA9A.7566F4CF>