Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2000 12:00:24 -0700 (PDT)
From:      Jin Guojun (FTG staff) <jin@george.lbl.gov>
To:        hackers@freebsd.org
Subject:   How to make system Sync
Message-ID:  <200005171900.MAA05337@george.lbl.gov>

next in thread | raw e-mail | index | archive | help
I had a couple of system out of sync problems.

(1) PCI sync problem:
	ATM adapter updates a buffer return pointer and generates intr, 
	but when driver pulls out the information that updated by adapter,
	some memory in the last piece of the pool is garbage.
e.g.
	head -> c0100000
	tail -> c0100400

	c0100000 -> buf0
	c0100004 -> buf1
	...
	c0100100 -> bufn
	...
	c0100160 -> bad address or 0
	...

If I let driver tsleep() for a while, the problem can be improved.
So, it looks like that adapter pushed (DMA) the data into memory,
but not been seen by CPU right way due to the DMA sync issue.
How can we sync the DMA transaction in BSD?


(2)
page fault trap does not show up right way:
at #7, lock_ObtainSpin is defined as simple_lock(). Before this line,
I put a line code --
char*   psp = panicstr;

to save the panicstr status, and we can see psp is NULL; i.e., "page fault"
has not been trapped yet. Where a few instructions down to tsleep(),
the panicstr is set to "page fault", but there is no code in the function
_simple_lock() can cause page fault. So, the page should be happened at
earlier time somewhere.
For this problem, how can we enforce the page trap show up at right spot
to catch the problem?

	-Jin

---------- core information ------
gdb -k kernel.4 vmcore.4

#0  boot (howto=256) at ../../kern/kern_shutdown.c:304
#1  0xc0193059 in panic (fmt=0xc03646ef "page fault")
    at ../../kern/kern_shutdown.c:554
#2  0xc02c3b4a in trap_fatal (frame=0xc0380fa8, eva=112)
    at ../../i386/i386/trap.c:924
#3  0xc02c37fd in trap_pfault (frame=0xc0380fa8, usermode=0, eva=112)
    at ../../i386/i386/trap.c:817
#4  0xc02c3383 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, 
      tf_edi = 256, tf_esi = -1070028992, tf_ebp = -1070067700, 
      tf_isp = -1070067756, tf_ebx = 0, tf_edx = 1073741824, 
      tf_ecx = -1069825280, tf_eax = 1074236058, tf_trapno = 12, tf_err = 0, 
      tf_eip = -1072080212, tf_cs = 8, tf_eflags = 66118, tf_esp = 768, 
      tf_ss = -1070133429}) at ../../i386/i386/trap.c:423
#5  0xc0195aac in tsleep (ident=0xc038a740, priority=296, 
    wmesg=0xc033f121 "slock", timo=200) at ../../kern/kern_synch.c:425
#6  0xc018e45e in _simple_lock (alp=0xc03e2e74, 
    id=0xc0370f4b "../sdapi_streams.c", l=768) at ../../kern/kern_lock.c:604
#7  0xc02f7d60 in sd_stream_dispatch (apip=0xc0ec28c0, rockp=0xc03e2280, 
    bufp=0xc0a58200, eventp=0xc0ee2400) at ../sdapi_streams.c:768
#8  0xc02f251b in sd_UpcallEvent (vcp=0xc0ec3200, eventp=0xc0ee2400, 
    bufp=0xc0a58200) at sdapi.c:973
#9  0xc02f2630 in sd_DataCallback (vc_cookie=0xc0ec3100, contextp=0xc0ec3200, 
    bufp=0xc0a58200, packet_arg=0x0) at sdapi.c:1024
#10 0xc02df683 in bcd_service_rbrq (rbrqi=0xc0d7cba8) at ../bcd_rx.c:1560
#11 0xc02e3a3e in bcd_he_intr (bu=0xc0d7b000) at ../FreeBSDK/bcd_he.c:632
(kgdb) up 6
#6  0xc018e45e in _simple_lock (alp=0xc03e2e74, 
    id=0xc0370f4b "../sdapi_streams.c", l=768) at ../../kern/kern_lock.c:604
604                             tsleep(&lockpausetime, PCATCH | PPAUSE, "slock",
(kgdb) up
#7  0xc02f7d60 in sd_stream_dispatch (apip=0xc0ec28c0, rockp=0xc03e2280, 
    bufp=0xc0a58200, eventp=0xc0ee2400) at ../sdapi_streams.c:768
768         lock_ObtainSpin(&sd_user_lock);
(kgdb) p psp
$1 = 0x0
(kgdb) p panicstr
$2 = 0xc03accc0 "page fault"



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?200005171900.MAA05337>