Message-ID: <4DIalh$BiD@bbs.ustc.edu.cn>
Subject: freebsd-current Digest, Vol 69, Issue 4
Date: Tue, 20 Jul 2004 05:26:19 +0000
From: Galoisz.bbs@bbs.ustc.edu.cn (���博士)
Path: 74.82.202.154!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-cn.bbs.comp.unix.mbox.zip!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!newshosting.com!nx02.iad01.newshosting.com!feed2.newsreader.com!newsreader.com!maily.cic.tsinghua.edu.cn!netnews.sdu.edu.cn!USTC
Newsgroups: cn.bbs.comp.unix
Organization: 嫺�����
X-Filename: Unix/M.1090301179.A
Xref: 74.82.202.154 cn.bbs.comp.unix:1365


Send freebsd-current mailing list submissions to
	freebsd-current@freebsd.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.freebsd.org/mailman/listinfo/freebsd-current
or, via email, send a message with subject or body 'help' to
	freebsd-current-request@freebsd.org

You can reach the person managing the list at
	freebsd-current-owner@freebsd.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of freebsd-current digest..."


Today's Topics:

   1. HEADS UP [Re: thread+preemption stability improvement]
      (Scott Long)
   2. Re: Obtaining a kernel dump is not possible (Thomas Quinot)
   3. [amd64] System lockups still continuing (Conrad J. Sabatier)
   4. Re: Unloading USB driver while device is attached.
      (M. Warner Losh)
   5. Re: Unloading USB driver while device is attached.
      (M. Warner Losh)
   6. Re: Unloading USB driver while device is attached.
      (M. Warner Losh)
   7. Re: Unloading USB driver while device is attached. 
      (M. Warner Losh)
   8. Re: Unloading USB driver while device is attached. (Scott Long)
   9. Re: [amd64] System lockups still continuing (Drew Broadley)
  10. Re: Unloading USB driver while device is attached. 
      (M. Warner Losh)
  11. Re: [amd64] System lockups still continuing (Drew Broadley)
  12. Re: [amd64] System lockups still continuing (Conrad J. Sabatier)
  13. Re: Hang on boot - "ATAPI_RESET no interrupt" with DVD+RW
      (Brian Rogers)
  14. Re: Unloading USB driver while device is attached.  (Ian Dowse)
  15. Re: sendfile problem (Re: Network related procs hang in
      unusual	sfpbsy state) (David O'Brien)
  16. cvs-src summary for July 12-19 (Mark Johnston)
  17. Re: Unloading USB driver while device is attached. 
      (M. Warner Losh)
  18. Re: Excellent job on the firewire support! (Daniel O'Connor)
  19. Re: Excellent job on the firewire support! (Hidetoshi Shimokawa)
  20. Re: Excellent job on the firewire support! (Hidetoshi Shimokawa)
  21. Re: Unloading USB driver while device is attached.
      (Craig Rodrigues)
  22. Re: HEADS UP [Re: thread+preemption stability improvement]
      (Maxim Maximov)
  23. Re: Excellent job on the firewire support! (Norikatsu Shigemura)
  24. Re: panic at turnstile_wait (Re: panic at sched_add_internal)
      (Norikatsu Shigemura)
  25. Re: edquota -t broken? (Sven Willenberger)
  26. Re: HEADS UP [Re: thread+preemption stability improvement]
      (John Birrell)
  27. Re: HEADS UP [Re: thread+preemption stability improvement]
      (Eric Anderson)
  28. Re: NEW TAR (Tim Kientzle)


----------------------------------------------------------------------

Message: 1
Date: Mon, 19 Jul 2004 14:35:28 -0600
From: Scott Long <scottl@freebsd.org>
Subject: HEADS UP [Re: thread+preemption stability improvement]
To: freebsd-current@freebsd.org
Message-ID: <40FC3090.9060305@freebsd.org>
Content-Type: text/plain; charset=us-ascii; format=flowed

All,

Initial testing of this patch looks very promising.  For those that
aren't comfortable with patching their sources by hand, note that it
was committed to CVS a few hours ago and should be showing up on CVSup
very shortly (rev 1.8 of sys/i386/i386/intr_machdep.c is what you want
if you are running i386).  Please go out and test this as much as 
possible so that we can determine if futher action is needed.

Scott

Robert Watson wrote:

> On Wed, 30 Jun 2004, John Baldwin wrote:
> 
> 
>>Try this patch.  It fixed all my lockups with xmms in KDE on Friday: 
> 
> 
> This patch causes my SMP and UP tests to succeed with PREEMPTION enabled,
> whereas before they rapidly hung.  On SMP I see a small (just under 1%) 
> but consistent improvement in query throughput with MySQL, and on UP I see
> a small (just under 1%) but inconsistent decrease in query throughput with
> MySQL.  The standard deviation on the UP case is almost the same size as
> the change, but in the SMP case it's 1/4-1/3 the size of the change, FWIW.
> 
> Can't speak to the latency as the test I'm currently running isn't very
> latency sensitive, but was very sensitive to the stability issue.  I think
> this patch is definitely worth committing ASAP :-).
> 
> Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
> robert@fledge.watson.org      Principal Research Scientist, McAfee Research

> 
> 
> 
>>--- //depot/projects/smpng/sys/i386/i386/intr_machdep.c	2004/07/02 20:28:06

>>+++ //depot/user/jhb/preemption/i386/i386/intr_machdep.c	2004/07/16 20:14:26

>>@@ -204,6 +204,8 @@
>> 		}
>> 		isrc->is_pic->pic_eoi_source(isrc);
>> 		error = 0;
>>+		/* XXX */
>>+		td->td_pflags &= ~TDP_OWEPREEMPT;
>> 		critical_exit();
>> 	} else {
>> 		/*
>>
>>-- 
>>John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
>>"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
>>
> 
> 
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


------------------------------

Message: 2
Date: Mon, 19 Jul 2004 23:03:11 +0200
From: Thomas Quinot <thomas@FreeBSD.ORG>
Subject: Re: Obtaining a kernel dump is not possible
To: "Oliver B. Fischer" <ofischer@snafu.de>
Cc: current@freebsd.org
Message-ID: <20040719210311.GA72395@melusine.cuivre.fr.eu.org>
Content-Type: text/plain; charset=us-ascii

* Oliver B. Fischer, 2004-06-28 :

> my ThinkPad gets a kernel panic if I boot a kernel with atapicam 
> enabled. So I try to obtain a crash dump to get a backtrace. 

If dumping does not work, can you try to obtain a backtrace from DDB?

Thomas.

-- 
    Thomas.Quinot@Cuivre.FR.EU.ORG

------------------------------

Message: 3
Date: Mon, 19 Jul 2004 16:09:19 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: [amd64] System lockups still continuing
To: Kevin Oberman <oberman@es.net>
Cc: freebsd-current@freebsd.org
Message-ID: <XFMail.20040719160919.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii


On 19-Jul-2004 Kevin Oberman wrote:
>> 
>> On 18-Jul-2004 Conrad J. Sabatier wrote:
>> > I had posted several weeks ago about constant hard lockups of my
>> > amd64 box.  At first, I attributed the problem to GNOME, then to
>> > my kernel config, but now it appears to me that the problem
>> > really lies with Mozilla/Firefox.
>> 
>> Well, another theory bites the dust.  I tried running GNOME
>> yesterday, never touched Mozilla or Firefox, and the system locked
>> up while doing some file management chores in Nautilus.
>> 
>> It must be something low-level in GNOME, some shared library,
>> probably, but I have yet to track it down.
> 
> I have lost track of the full thread and this mail list is not
> tracked by google :-(, so this may have been ruled out. Are you sure
> that it's not the preemption problem that is biting you? This applies
> to CURRENT systems only, so may not be applicable to what you are
> seeing, the symptoms are a match.

Hmm, you may be right.  Is there any workaround for this?  I've tried
both SCHED_ULE and SCHED_4BSD, both producing the same results.

What's strange is that this only seems to occur when either running a
full-blown GNOME desktop or using some GNOME-related app under another
environment.

I'm currently working under KDE, just for comparison, and no such
problems have occurred, unless I try using, say, Mozilla or Firefox.

I'll Cc: this to current and see what they think.

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"


------------------------------

Message: 4
Date: Mon, 19 Jul 2004 16:33:55 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached.
To: pjd@FreeBSD.ORG
Cc: freebsd-current@FreeBSD.ORG
Message-ID: <20040719.163355.111547661.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <20040719145745.GH57678@darkness.comp.waw.pl>
            Pawel Jakub Dawidek <pjd@freebsd.org> writes:
: Hello.
: 
: Could someone investigate what's going on for the situation from the
: subject? This panic is trivial to reproduce:
: 
: 	# kldload umass.ko
: 	<plug in your USB bar>
: 	# kldunload umass
: 	# kldload umass
: 	<panic>
: 
: It is not umass related! I think this problem is in our USB implementation.

: 
: One more note with could be helpful.
: When device is already inserted and I load USB driver, <drvname>_match
: isn't called, but when driver was unloaded while device was in and it is
: loaded again (as in my example) <drvname>_match is called and we have
: a problem, because there are some stale data, I think (not everything
: is cleaned up on kldunload?).
: Ok, one more note.
: You can also set 'break <drvname>_match' in DDB and try to compare
: backtraces when device is removed while driver is loaded and when you
: unload USB driver.

I do know that loading the driver won't attach umass unless you remove
and insert it again.

Warner

------------------------------

Message: 5
Date: Mon, 19 Jul 2004 16:35:36 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached.
To: pjd@FreeBSD.ORG
Cc: freebsd-current@FreeBSD.ORG
Message-ID: <20040719.163536.81896269.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <20040719173819.GI57678@darkness.comp.waw.pl>
            Pawel Jakub Dawidek <pjd@freebsd.org> writes:
: On Mon, Jul 19, 2004 at 10:23:16AM -0700, Doug White wrote:
: +> Theres a discussion going on in -arch about making kldunload a bit more
: +> careful about cleaning up before detaching.  In the interim adding a
: +> method that just vetos any unload request would prevent this from
: +> occuring, but also preclude unloading the driver. :)
: 
: Yeah, but even on 'kldunload -f' it should be possible to clean up
: and avoid panic on next load.

kldunload -f isn't supported at this point :-) Or more accurately,
there's no hook into the driver system (newbus).  And even if there
was, usb has been poorly integrated into newbus in the past, so it
likely still would do bad things.  Eg, -f isn't going to save you.
umass should be fixed.

Warner

------------------------------

Message: 6
Date: Mon, 19 Jul 2004 16:36:58 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached.
To: pjd@freebsd.org
Cc: freebsd-current@freebsd.org
Message-ID: <20040719.163658.97851603.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <20040719175241.GJ57678@darkness.comp.waw.pl>
            Pawel Jakub Dawidek <pjd@freebsd.org> writes:
: On Mon, Jul 19, 2004 at 11:43:14AM -0600, Scott Long wrote:
: +> >Yeah, but even on 'kldunload -f' it should be possible to clean up
: +> >and avoid panic on next load.
: +> >
: +> 
: +> What usually happens in that a timeout happens and the driver handler no

: +> longer exists (i.e. forgot to call untimeout), or an interrupt happens
: +> and the driver forgot to deregister the interrupt.  There are also a lot

: +> of rase possibilities in here even if the driver attempts to do the
: +> right thing.  There really isn't a 'one size fits all' way to deal with
: +> this kind of thing.  The driver author needs to build quiesce and
: +> shutdown semantics into the driver design.
: 
: If your device is inserted and you load a driver everything is ok,
: because no driver is attached to this device.
: So, as I see it, device should be totally detached before unload and
: I susspect that something is missing in USB layer, not in all drivers.
: That's why when I load a driver again, USB thinks it is somehow connected
: to existing device, but it isn't.

Actually, usb won't reattach on kldload.  That's definitely missing
from the usb layer.  This has been noted many times in the past.
However, its missing shouldn't cause the panic.  That's likely a
different bug.

Warner

------------------------------

Message: 7
Date: Mon, 19 Jul 2004 16:37:51 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached. 
To: iedowse@maths.tcd.ie
Cc: scottl@freebsd.org
Message-ID: <20040719.163751.16873514.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <200407191950.aa12733@salmon.maths.tcd.ie>
            Ian Dowse <iedowse@maths.tcd.ie> writes:
: In message <20040719175241.GJ57678@darkness.comp.waw.pl>, Pawel Jakub Dawi..
: rites:
: >So, as I see it, device should be totally detached before unload and
: >I susspect that something is missing in USB layer, not in all drivers.
: >That's why when I load a driver again, USB thinks it is somehow connected
: >to existing device, but it isn't.
: 
: I'm not sure if it will help in this particular case, but I have a
: lot of local cleanups and improvements in the USB code. There's a
: large patch at
: 
: 	http://people.freebsd.org/~iedowse/usb.diff
: 
: but unfortunately I haven't had time to work on this lately (and
: there are all the problems of divergence from NetBSD etc. if bits
: of this get committed). The (small) uhub.c changes look like they
: might possibly help in your case. With the full patch I was able
: to `kldunload usb' without crashes a while ago, but there were still
: memory leaks.

Personally, I think that divergence from NetBSD is less of a problem
than it not working at all.

Warner

------------------------------

Message: 8
Date: Mon, 19 Jul 2004 16:41:16 -0600
From: Scott Long <scottl@freebsd.org>
Subject: Re: Unloading USB driver while device is attached.
To: "M. Warner Losh" <imp@bsdimp.com>
Cc: iedowse@maths.tcd.ie
Message-ID: <40FC4E0C.1040404@freebsd.org>
Content-Type: text/plain; charset=us-ascii; format=flowed

M. Warner Losh wrote:

> In message: <200407191950.aa12733@salmon.maths.tcd.ie>
>             Ian Dowse <iedowse@maths.tcd.ie> writes:
> : In message <20040719175241.GJ57678@darkness.comp.waw.pl>, Pawel Jakub Dawi
dek w
> : rites:
> : >So, as I see it, device should be totally detached before unload and
> : >I susspect that something is missing in USB layer, not in all drivers.
> : >That's why when I load a driver again, USB thinks it is somehow connected

> : >to existing device, but it isn't.
> : 
> : I'm not sure if it will help in this particular case, but I have a
> : lot of local cleanups and improvements in the USB code. There's a
> : large patch at
> : 
> : 	http://people.freebsd.org/~iedowse/usb.diff
> : 
> : but unfortunately I haven't had time to work on this lately (and
> : there are all the problems of divergence from NetBSD etc. if bits
> : of this get committed). The (small) uhub.c changes look like they
> : might possibly help in your case. With the full patch I was able
> : to `kldunload usb' without crashes a while ago, but there were still
> : memory leaks.
> 
> Personally, I think that divergence from NetBSD is less of a problem
> than it not working at all.
> 
> Warner

We've been fighting the NetBSD divergence issue for a lot of years.  I
think that we have to start accepting that there are places where
divergence gives us large net gains.  Probably the best goal to keep
going forward is to keep the intra-stack APIs as similar as possible so
that new modules can be added without much porting work.

Scott

------------------------------

Message: 9
Date: Tue, 20 Jul 2004 10:53:44 +1200
From: Drew Broadley <drew@corrupt.co.nz>
Subject: Re: [amd64] System lockups still continuing
To: conrads@cox.net
Cc: freebsd-current@freebsd.org
Message-ID: <40FC50F8.3060403@corrupt.co.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Conrad J. Sabatier wrote:

>On 19-Jul-2004 Kevin Oberman wrote:
>  
>
>>>On 18-Jul-2004 Conrad J. Sabatier wrote:
>>>      
>>>
>>>>I had posted several weeks ago about constant hard lockups of my
>>>>amd64 box.  At first, I attributed the problem to GNOME, then to
>>>>my kernel config, but now it appears to me that the problem
>>>>really lies with Mozilla/Firefox.
>>>>        
>>>>
>>>Well, another theory bites the dust.  I tried running GNOME
>>>yesterday, never touched Mozilla or Firefox, and the system locked
>>>up while doing some file management chores in Nautilus.
>>>
>>>It must be something low-level in GNOME, some shared library,
>>>probably, but I have yet to track it down.
>>>      
>>>
>>I have lost track of the full thread and this mail list is not
>>tracked by google :-(, so this may have been ruled out. Are you sure
>>that it's not the preemption problem that is biting you? This applies
>>to CURRENT systems only, so may not be applicable to what you are
>>seeing, the symptoms are a match.
>>    
>>
>
>Hmm, you may be right.  Is there any workaround for this?  I've tried
>both SCHED_ULE and SCHED_4BSD, both producing the same results.
>
>What's strange is that this only seems to occur when either running a
>full-blown GNOME desktop or using some GNOME-related app under another
>environment.
>
>I'm currently working under KDE, just for comparison, and no such
>problems have occurred, unless I try using, say, Mozilla or Firefox.
>
>I'll Cc: this to current and see what they think.
>  
>
My fix (and this doesn't produce a laggy system for my Evon800v Laptop) 
and hasn't hung since. I stream music/tv and do compiling at the same 
time and discovered no pops or high CPU usage on the system.

Im currently streaming a 128bkps TV stream + various other things:

    $ uptime
    10:51AM  up  1:11, 6 users, load averages: 0.27, 0.22, 0.18

    $ top | less
    last pid:  1463;  load averages:  0.16,  0.19,  0.17  up 
0+01:11:39    10:52:25 115 processes: 1 running, 114 sleeping

    Mem: 346M Active, 47M Inact, 79M Wired, 20M Cache, 60M Buf, 1096K 
Free Swap: 998M Total, 998M Free


      PID USERNAME   PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU 
COMMAND
      791 drew        20    0 73796K 62696K kserel   1:20  9.81%  9.81% 
thunderbird-bin
      656 drew        96    0   106M 97240K select   1:45  0.93%  0.93% 
XFree86
      926 drew         8    0 18544K  8236K nanslp   1:00  0.73%  0.73% 
mplayer
      772 drew        96    0 15788K 10724K select   0:41  0.05%  0.05% 
battstat-applet-2
      738 drew        96    0 22592K 16060K select   0:33  0.05%  0.05% 
python
      724 drew        96    0 13428K  9232K select   0:10  0.05%  0.05% 
metacity


Here is the FIX:

$ cp /usr/src/sys/<arch>/include/param.h /tmp/param.h && perl -ple 
's/#define PREEMPTIVE.+\n$//i' /tmp/param.h > 
/usr/src/sys/<arch>/include/param.h /tmp/param.h

Add/Update this option in your kernel

    HZ=2000

$ make buildworld && make buildkernel && make installkernel && make 
installworld && reboot

FWIW

- Drew

------------------------------

Message: 10
Date: Mon, 19 Jul 2004 17:01:32 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached. 
To: iedowse@maths.tcd.ie
Cc: scottl@freebsd.org
Message-ID: <20040719.170132.52458790.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <200407191950.aa12733@salmon.maths.tcd.ie>
            Ian Dowse <iedowse@maths.tcd.ie> writes:
: In message <20040719175241.GJ57678@darkness.comp.waw.pl>, Pawel Jakub Dawi..
: rites:
: >So, as I see it, device should be totally detached before unload and
: >I susspect that something is missing in USB layer, not in all drivers.
: >That's why when I load a driver again, USB thinks it is somehow connected
: >to existing device, but it isn't.
: 
: I'm not sure if it will help in this particular case, but I have a
: lot of local cleanups and improvements in the USB code. There's a
: large patch at
: 
: 	http://people.freebsd.org/~iedowse/usb.diff
: 
: but unfortunately I haven't had time to work on this lately (and
: there are all the problems of divergence from NetBSD etc. if bits
: of this get committed). The (small) uhub.c changes look like they
: might possibly help in your case. With the full patch I was able
: to `kldunload usb' without crashes a while ago, but there were still
: memory leaks.

I'm going to start merging in some of these changes, if you don't
mind.

Warner

------------------------------

Message: 11
Date: Tue, 20 Jul 2004 11:00:53 +1200
From: Drew Broadley <drew@corrupt.co.nz>
Subject: Re: [amd64] System lockups still continuing
To: Drew Broadley <drew@corrupt.co.nz>
Cc: freebsd-current@freebsd.org
Message-ID: <40FC52A5.6010803@corrupt.co.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Sorry this line:
 >>>>>>>>>>>>>
$ cp /usr/src/sys/<arch>/include/param.h /tmp/param.h && perl -ple 
's/#define PREEMPTIVE.+\n$//i' /tmp/param.h > 
/usr/src/sys/<arch>/include/param.h /tmp/param.h
 >>>>>>>>>>>>>

Should read:
 >>>>>>>>>>>>>
$ cp /usr/src/sys/<arch>/include/param.h /tmp/param.h &&  perl -ple 
's/^#define[\t\s]+PREEMPTION//i' /tmp/param.h > 
/usr/src/sys/<arch>/include/param.h
 >>>>>>>>>>>>>

- Drew

------------------------------

Message: 12
Date: Mon, 19 Jul 2004 18:22:18 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Subject: Re: [amd64] System lockups still continuing
To: Drew Broadley <drew@corrupt.co.nz>
Cc: freebsd-current@freebsd.org
Message-ID: <XFMail.20040719182218.conrads@cox.net>
Content-Type: text/plain; charset=us-ascii


On 19-Jul-2004 Drew Broadley wrote:
> Sorry this line:
>  >>>>>>>>>>>>>
> $ cp /usr/src/sys/<arch>/include/param.h /tmp/param.h && perl -ple 
> 's/#define PREEMPTIVE.+\n$//i' /tmp/param.h > 
> /usr/src/sys/<arch>/include/param.h /tmp/param.h
>  >>>>>>>>>>>>>
> 
> Should read:
>  >>>>>>>>>>>>>
> $ cp /usr/src/sys/<arch>/include/param.h /tmp/param.h &&  perl -ple 
> 's/^#define[\t\s]+PREEMPTION//i' /tmp/param.h > 
> /usr/src/sys/<arch>/include/param.h
>  >>>>>>>>>>>>>
> 
> - Drew

Thanks, I may try that.  For now, though, I just noticed a new commit
(see the thread "HEADS UP [Re: thread+preemption stability improvement]"
in current) that may help with the preemption problems.  Running a new
kernel with it now, and so far so good.  <crossing fingers>  :-)

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"

------------------------------

Message: 13
Date: Mon, 19 Jul 2004 16:33:21 -0700
From: Brian Rogers <burpmaster@truffula.net>
Subject: Re: Hang on boot - "ATAPI_RESET no interrupt" with DVD+RW
To: Brian Fundakowski Feldman <green@freebsd.org>
Cc: freebsd-current@freebsd.org
Message-ID: <40FC5A41.2070309@truffula.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Brian Fundakowski Feldman wrote:

>On Wed, Jul 14, 2004 at 04:57:03AM -0700, Brian Rogers wrote:
>  
>
>>Brian Fundakowski Feldman wrote:
>>    
>>
>>>On Tue, Jul 13, 2004 at 03:19:51PM -0700, Brian Rogers wrote:
>>>      
>>>
>>>>Since last night and continuing today, the kernel from -CURRENT usually 
>>>>hangs during boot.  Safe mode worked once, but the second time it didn't 

>>>>work.  I now got in through single-user mode, so it appears to just work 

>>>>every once in a while, randomly.
>>>>
>>>>I have a dmesg from the booted system below.  When it hangs, it stops 
>>>>one line after "ata1-slave: FAILURE - ATAPI_RESET no interrupt", in 
>>>>other words it hangs after detecting ata1-master but before detecting 
>>>>ata1-slave, my DVD+RW drive.
>>>>
>>>>        
>>>>
>>>Try using these diffs to src/sys/dev/ata; they fixed it for me.
>>>      
>>>
>>I think I stayed a bit too current.  That didn't apply cleanly.
>>    
>>
>There should be very few changes; it should be relatively easy to
>fix the few conflicts.
>  
>
I tried that...  It doesn't resolve the issue.


------------------------------

Message: 14
Date: Tue, 20 Jul 2004 00:45:08 +0100
From: Ian Dowse <iedowse@maths.tcd.ie>
Subject: Re: Unloading USB driver while device is attached. 
To: "M. Warner Losh" <imp@bsdimp.com>
Cc: scottl@freebsd.org
Message-ID: <200407200045.aa99979@salmon.maths.tcd.ie>

In message <20040719.170132.52458790.imp@bsdimp.com>, "M. Warner Losh" writes:

>In message: <200407191950.aa12733@salmon.maths.tcd.ie>
>            Ian Dowse <iedowse@maths.tcd.ie> writes:
>: 	http://people.freebsd.org/~iedowse/usb.diff
>: 
>: but unfortunately I haven't had time to work on this lately (and
>: there are all the problems of divergence from NetBSD etc. if bits
>: of this get committed). The (small) uhub.c changes look like they
>: might possibly help in your case. With the full patch I was able
>: to `kldunload usb' without crashes a while ago, but there were still
>: memory leaks.
>
>I'm going to start merging in some of these changes, if you don't
>mind.

If you have the time that would be great! FYI, here is a rough
summary of the changes in no particular order:

  o Beginnings of interrupt pipe support for EHCI (very little done)
  o Support for unloading the usb driver (leaks some memory)
  o Support for removing cardbus USB controllers (also leaks memory)
  o Avoid most (but not all) uses of contigmalloc and data buffer
    copies by using bus_dmamap_load() and a new `struct usb_dma_mapping'.
    A few places marked `XXX' need to be checked for crossing DMA
    segment boundaries. This is probably the most important change,
    as it makes USB work much more reliably on low memory machines.
  o Attempt to follow the correct procedure for synchronising with
    the BIOS via SMM to take over control of the EHCI controller.
    This may fix problems when the BIOS is configured to emulate
    legacy devices, but is untested on any affected machines.
  o Try to make transfers reusable from the completion callback (some
    related changes went into NetBSD recently, but I haven't checked
    the overlap).

There are probably a few other changes in there too - let me know if
you find any stuff that doesn't make sense.

Ian

------------------------------

Message: 15
Date: Mon, 19 Jul 2004 17:34:26 -0700
From: "David O'Brien" <obrien@freebsd.org>
Subject: Re: sendfile problem (Re: Network related procs hang in
	unusual	sfpbsy state)
To: Andrew Gallatin <gallatin@cs.duke.edu>
Cc: alc@freebsd.org
Message-ID: <20040720003426.GN1070@dragon.nuxi.com>
Content-Type: text/plain; charset=us-ascii

On Tue, Jul 13, 2004 at 09:05:16AM -0400, Andrew Gallatin wrote:
> still busy.  Do you have a gdb which can do kernel debugging?
> (apparently ports/dev/gdb53 can..)

As can ports/dev/gdb6

-- 
-- David  (obrien@FreeBSD.org)

------------------------------

Message: 16
Date: Mon, 19 Jul 2004 20:47:48 -0500
From: Mark Johnston <mjohnston@skyweb.ca>
Subject: cvs-src summary for July 12-19
To: current@freebsd.org
Message-ID: <200407192047.48729.mjohnston@skyweb.ca>
Content-Type: text/plain;  charset="us-ascii"

FreeBSD cvs-src summary for 12/07/04 to 19/07/04
++++++++++++++++++++++++++++++++++++++++++++++++
This is a regular weekly summary of FreeBSD's cutting-edge development.
It is intended to help the FreeBSD community keep up with the fast-paced
work going on in FreeBSD-CURRENT by distilling the deluge of data from
the CVS mailing list into a (hopefully) easy-to-read newsletter.  This
newsletter is marked up in reStructuredText_, so any odd punctuation
that you see is likely intended for the reST parser.

. _reStructuredText: http://docutils.sourceforge.net/rst.html

You can get old summaries, and an HTML version of this one, at
http://www.xl0.org/FreeBSD/.  Please send any comments to Mark Johnston
(mark at xl0.org).

For Lukasz Dudek and Szymon Roczniak's Polish translations of these
summaries, which may lag the English ones slightly, please see
http://mocart.pinco.pl/FreeBSD/.

. contents::

============
New features
============
libthread_db thread debugging library added
-------------------------------------------
David Xu (davidxu) added libthread_db, a library for debugging threaded
processes with GDB.  Currently, it supports only libpthread, but Marcel
Moolenaar (marcel) will be working to add support for libthr and libc_r,
the other threading libraries.

http://www.freebsd.org/cgi/mid.cgi?200407150336.i6F3aZIw036415

bsdtar becomes the default system tar
-------------------------------------
Tim Kientzle (kientzle) changed the system tar from the old GNU tar to
his new bsdtar program.  You can use the old GNU tar as gtar, or define
WITH_GTAR when building and installing the world to make gtar the default.

bsdtar is built on Tim's libarchive, which supports many different
streaming archive formats, auto-detecting what format you're trying to
extract.  It also supports file flags, ACLs, and arbitrary device numbers.

For more information on libarchive and bsdtar, you can visit `the
libarchive page`_.

. _`the libarchive page`: http://people.freebsd.org/~kientzle/libarchive/

http://www.freebsd.org/cgi/mid.cgi?200407170603.i6H63lkv029158

Adaptive mutexes enabled
------------------------
Scott Long (scottl) enabled the code supporting adaptive mutexes, which
improve performance when locking in many circumstances.  It has been
enabled by default on AMD64, but it is now enabled everywhere.  This
also removes the kernel option ADAPTIVE_MUTEXES and creates one for
NO_ADAPTIVE_MUTEXES in its place.

http://www.freebsd.org/cgi/mid.cgi?200407181559.i6IFx42N094234

ACPI support for floppy drives added
------------------------------------
Nate Lawson (njl) committed ACPI support for floppy disk drives.

http://www.freebsd.org/cgi/mid.cgi?200407151638.i6FGc7Sb061577

RADIUS accounting support in PPP enhanced
-----------------------------------------
Brian Somers (brian) committed a patch to PPP to improve the RADIUS
accounting support.  There is now a "set rad_alive N" command that enables
periodic reports of RADIUS accounting data to the server.  The code for
this was mostly submitted by alx@sm.ukrtel.net.

http://www.freebsd.org/cgi/mid.cgi?200407170107.i6H17rub019304

===============
Notable changes
===============
fla driver for M-Systems DiskOnChip removed
-------------------------------------------
Poul-Henning Kamp (phk) removed the fla driver for M-Systems DiskOnChip
devices.

http://www.freebsd.org/cgi/mid.cgi?200407081638.i68GcbMo019165

Biba and MLS MAC _single labels renamed to _effective
-----------------------------------------------------
Robert Watson (rwatson) renamed the label _single to _effective in the
code implementing the Biba and MLS mandatory access control policies.  The
new _effective label is similar to the use of "effective" in traditional
UNIX access control.

http://www.freebsd.org/cgi/mid.cgi?200407160203.i6G23oaR078694

Sound device drivers renamed
----------------------------
Seigo Tanimura (tanimura) renamed the sound drivers to make them more
consistent, with "sound" being the generic sound driver, and "snd_*" being
device-specific drivers.  He has also renamed the "snd_pcm" kernel module
to "sound" for consistency.

http://www.freebsd.org/cgi/mid.cgi?200407160358.i6G3wPIl082809

make world now requires DESTDIR
-------------------------------
Marcel Moolenaar (marcel) committed a patch to the system Makefile that
requires a DESTDIR variable, for destination directory, to be specified
when using the "make world" command.  This is to protect people who
unknowingly try to use "make world" to upgrade their system, instead of
following the instructions in /usr/src/UPDATING, since make world does not
upgrade the kernel and can leave the system in an unusable or unbootable
state.

http://www.freebsd.org/cgi/mid.cgi?200407160251.i6G2pSts080488

=================
Discussion topics
=================
kldunload and Newbus
--------------------
Poul-Henning Kamp (phk) made a commit to "Give kldunload a -f(orce)
argument."  This adds new semantics for modules to be asked whether they
can unload (called "quiesce") and then unloaded forcefully.

Nate Lawson (njl) replied, "Have you kept up on the newbus discussions?
The tentative plan was to add quiesce functionality to it as part of
device_detach(). [ . . . ] I think duplicating this at multiple layers is
not a good idea and the module level is not the right layer to implement
it."

Scott Long (scottl) said, " It typically won't be duplicated.  This
particular work is good for things like GEOM modules that don't fit into
newbus."

Poul-Henning replied, "I wish I could grasp from where this 'newbus fits
all' attiude comes, I certainly see nothing anywhere that could explain
it."

Scott answered, "NetBSD has most things under newbus."

Poul-Henning replied, "It is not realistic to expect us to ever tie
netgraph modules, tty linedisciplines, network protocols, filesystems, vm
objects, vnodes and geom classes together with newbus. [ . . . ] And since
all of these things are involved in loadable modules, I think we should
stop wasting time dreaming about the day the world will be one bit tangle
of newbus."

Scott said, "My original statement was just a hypothetical and nothing
more. The newbus cabal/bikeshed/whatever is not about to come crashing
down on your head.", to which Poul-Henning answered "I know it isn't, and
that's was my point."

M. Warner Losh (imp) also replied to Poul-Henning's previous post, saying,
"I think you should spent less time attacking newbus."  Doug Rabson (dfr)
added, "And besides, newbus isn't going to take over the world, kobj is
;-)"

In another branch, Warner responded to Poul-Henning's question about
"newbus fits all", saying, "Too many years of having weird, odd-ball
attachments maybe? [ . . . ] Frankly, I dislike your obstructionist
attitudes towards newbus."

Poul-Henning answered, "Obstructionist ? That's a pretty harsh word for
somebody who has wasted a couple of months trying to write a newbus-ified
GEOM."

Warner clarified, "It just seems that whenever the topic of newbus comes
up, you don't want to use it."

Poul-Henning responded, "having tried it out [ . . . ], I appreciate the
size of the gap between what newbus can today and what it needs to learn
before the fully newbusified kernel can be a realistic dream.  That is not
obstructionist, that is being realistic."

Nate followed up to Poul-Henning's post about the newbus-ified GEOM,
saying, "I'll happily help review patches/designs for this."

Poul-Henning responded, "No need to.  It doesn't work because newbus
doesn't support multiple interitance."

Some highly-technical discussion of newbus between Poul-Henning and Warner
followed, in which they concluded that the multiple inheritance added a
few months ago would meet Poul-Henning's needs.  Robert Watson (rwatson)
added a suggestion at the end that further discussion of the Newbus
architecture would be well-suited to the arch@ list.

A second, shorter thread also spawned from Nate's original post, with
Poul-Henning explaining that the quiesce functionality is needed at the
module layer because "one kld can contain multiple modules, and since the
modules get to veto an unload with MOD_UNLOAD, I don't really see how you
can come up with something that doesn't have a MOD_QUIESCE."

Nate answered ,"there doesn't have to be MOD_QUIESCE.  The normal
MOD_UNLOAD request will trigger (multiple calls to) device_detach via a
TBD kernel interface."

Poul-Henning replied, "This is not about 'eject ed0', this is about 'evict
the ed driver'.  There is only one sane way to implement that:  Pass the
flag to the module and have the module decided if it is possible."

Colin Percival (cperciva) observed, "this will be useful from the point of
view of security as well.  When there is a security advisory concerning
an optional module (compat/linux being the most recent example) it would
be nice to have a more effective workaround than 'well, you can try
`kldunload linux`, but it probably won't work... if it doesn't work,
you'll have to reboot the system'."

Brian Fundakowski Feldman (green) pointed out, "'Well, you can try
'kldunload -f linux', but it probably won't work... if it doesn't work, I
guess a crash isn't really much worse than a reboot.'"

http://www.freebsd.org/cgi/mid.cgi?200407131936.i6DJaxrp074391

=================
Committer changes
=================
Julian Elischer (julian) introduced Gleb Smirnov (glebius) as a new src
committer.

http://www.freebsd.org/cgi/mid.cgi?200407140650.i6E6om5m093425

Murray Stokely (murray) retired Valentino Vaschetto (logo)'s commit bit
for safekeeping.

http://www.freebsd.org/cgi/mid.cgi?200407150845.i6F8j5gH047574

===================
Important bug fixes
===================
Several rpc.lockd bugs fixed
----------------------------
Michael Reifenberger (mr) committed a patch from Bjorn Gronvall that fixes
some lockups and crashes within rpc.lockd, the NFS locking server.  This
closes `PR 61718`_.

. _`PR 61718`: http://www.freebsd.org/cgi/query-pr.cgi?pr=61718

http://www.freebsd.org/cgi/mid.cgi?200407161930.16GJUxuw009400

===============
Other bug fixes
===============
Christian S. J. Peron (csjp) applied a patch to the file descriptor
allocation code to prevent a jailed root user from using up the last few
file descriptors, which are reserved for root.

http://www.freebsd.org/cgi/mid.cgi?200407141904.i6EJ4VKD016422

Max Laier (mlaier) committed a fix to the pf packet filter, which
improves routing loop detection.  The fix was written by Daniel Hartmeier
(dhartmei) and imported from OpenBSD.

http://www.freebsd.org/cgi/mid.cgi?200407171715.i6HHFGXJ052457

Soeren Schmidt (sos) committed a fix for newer VIA IDE hard drive
controllers, which would hang when their timing setting was reprogrammed
to a higher speed than UDMA33.  This close `PR 69180`_, although he didn't
use the included patch.

. _`PR 69180`: http://www.freebsd.org/cgi/query-pr.cgi?pr=69180

http://www.freebsd.org/cgi/mid.cgi?200407171448.i6HEmkMp044631

Brian Somers (brian) fixed the "set ifaddr" command, which had previously
been doing nothing, in ppp.  This closes `PR 62050`_.

. _`PR 62050`: http://www.freebsd.org/cgi/query-pr.cgi?pr=62050

http://www.freebsd.org/cgi/mid.cgi?200407150942.i6F9gH1Y049408

------------------------------

Message: 17
Date: Mon, 19 Jul 2004 19:50:56 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: Unloading USB driver while device is attached. 
To: iedowse@maths.tcd.ie
Cc: mycroft@NetBSD.org
Message-ID: <20040719.195056.35662742.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <200407200045.aa99979@salmon.maths.tcd.ie>
            Ian Dowse <iedowse@maths.tcd.ie> writes:
: In message <20040719.170132.52458790.imp@bsdimp.com>, "M. Warner Losh" wri..
: >In message: <200407191950.aa12733@salmon.maths.tcd.ie>
: >            Ian Dowse <iedowse@maths.tcd.ie> writes:
: >: 	http://people.freebsd.org/~iedowse/usb.diff
: >: 
: >: but unfortunately I haven't had time to work on this lately (and
: >: there are all the problems of divergence from NetBSD etc. if bits
: >: of this get committed). The (small) uhub.c changes look like they
: >: might possibly help in your case. With the full patch I was able
: >: to `kldunload usb' without crashes a while ago, but there were still
: >: memory leaks.
: >
: >I'm going to start merging in some of these changes, if you don't
: >mind.
: 
: If you have the time that would be great! FYI, here is a rough
: summary of the changes in no particular order:
: 
:   o Beginnings of interrupt pipe support for EHCI (very little done)

cool.

:   o Support for unloading the usb driver (leaks some memory)
:   o Support for removing cardbus USB controllers (also leaks memory)

These are my biggest goals of the moment.

:   o Avoid most (but not all) uses of contigmalloc and data buffer
:     copies by using bus_dmamap_load() and a new `struct usb_dma_mapping'.
:     A few places marked `XXX' need to be checked for crossing DMA
:     segment boundaries. This is probably the most important change,
:     as it makes USB work much more reliably on low memory machines.

This would be nice.

:   o Attempt to follow the correct procedure for synchronising with
:     the BIOS via SMM to take over control of the EHCI controller.
:     This may fix problems when the BIOS is configured to emulate
:     legacy devices, but is untested on any affected machines.

Docs on how to do this?  I've not seen this info...

:   o Try to make transfers reusable from the completion callback (some
:     related changes went into NetBSD recently, but I haven't checked
:     the overlap).

I saw that.

: There are probably a few other changes in there too - let me know if
: you find any stuff that doesn't make sense.

OK.  Will do.

I think we need to look at radically updating the way we do
compatibility between the different systems that the usb code runs
on.  But that's a good way to freak people out by saying such things
in public :-)

Warner

------------------------------

Message: 18
Date: Tue, 20 Jul 2004 12:03:17 +0930
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
Subject: Re: Excellent job on the firewire support!
To: freebsd-current@freebsd.org
Cc: simokawa@freebsd.org
Message-ID: <200407201203.17629.doconnor@gsoft.com.au>
Content-Type: Text/Plain;  charset="iso-8859-1"

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 20 Jul 2004 04:07, Doug Rabson wrote:
> > I compiled it in with the latest kernel at 17 July, but the box
> > cannot ping with a M$ & linux box.
>
> I have that fixed locally but I want to fix some other problems with the
> firewire driver - mainly that my freebsd boxes often go haywire when I
> plug a windows box into the bus. I also want to finish writing the code
> for freebsd to be a fully functional isochronous bus manager.

I couldn't get fwip to work either, but my FreeBSD box doesn't go nuts when 
connected to a Windows PC..

If you need a tester I'd be more than happy :)

- -- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFA/IRt5ZPcIHs/zowRAheTAJ9DOD9aPAuHTegGzewhhbQS/gX8/ACdEcAv
8O7tE5QbeeNl6lwwIpqazKM=
=JIKw
-----END PGP SIGNATURE-----

------------------------------

Message: 19
Date: Tue, 20 Jul 2004 11:41:52 +0900
From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Subject: Re: Excellent job on the firewire support!
To: Doug Rabson <dfr@nlsystems.com>
Cc: simokawa@freebsd.org
Message-ID: <87hds3pfgv.wl@tora.nunu.org>
Content-Type: text/plain; charset=US-ASCII

(sorry for resending)

At Sun, 18 Jul 2004 21:04:53 +0100,
Doug Rabson wrote:
> > It would be nice to remove my Comtrol Rocketport serial card, and the
> > 8 serial cables leading across the middle of the room to my shelf of
> > machines and replace it with one firewire cable leading to a firewire
> > hub. But, as a firewire newbie, I have some questions:
> >
> > 1) Is any firewire PCI adapter just as good as any other in terms of
> >    performance, and FreeBSD support? (prices seem to range from $10
> > to $100)
> 
> Any should do about as well as any other. I probably wouldn't want to 
> spend more than ~$50 on one.

I got some bad report about Lucent chip(some Mac's have it)
but I haven't heard any other compatibility issue.
I think the price of the adapter doesn't matter but you may
have trouble with some bad cables. If have some problem,
use lower speed(S100) or change cables.

> >
> > 2) Is dcons usable after a panic (ie, DDB or KDB_TRACE)?  Or is it
> >    only usable for remote-gdb?
> 
> Dcons provides two full duplex streams - one for console and one for 
> gdb. You can use DDB on the console just like normal.

It's designed for such panic/debugging situation.
Actually, it's rather inefficient for usual situation
but the speed of FireWire hide the problem ;-)

> >
> > 3) Is dcons endian and pointer-size agonstic?  Can I run consoles to
> >    an amd64 and a powerpc box from an x86?
> 
> I haven't actually tried that and I imagine that there might be issues 
> here and there. Any problems are likely to be in the dconschat program 
> but that should be pretty easy to fix since its entirely userland.

I should have no problem with 64bit arch and big endian.
I have tested with sparc64, powerpc and amd64.

> >
> > 4) Does the loader know about dcons?  Eg, can I do "unload <ret> boot
> >    kernel.test" using dcons?
> 
> Actually thats the only downside of dcons. It doesn't cut in until the 
> firewire controller attaches. It relies on the fact that the fwohci 
> driver allows access to physical memory from any node on the bus 
> (implemeted in hardware so you can examine the memory of a hung 
> machine). The dconschat program uses this feature to access the dcons 
> ring buffers in the target machine.
> 
> I could imagine a dcons driver in the loader which just enabled physical 
> access and used some kind of loader trick to hand off the ring buffers 
> to the kernel dcons driver. It doesn't exist though - say nice things 

You are right.

> to the author and he might find the time for it :-)

It is not enough :-< I lack the knowledge of BIOS/PCI(and ACPI?).
Once we can access the OHCI register via PCI in the loader,
the remaining part is relatively easy as you described.
I need some help for this part. I suppose that implementing dcons 
in the loader is architecture dependent.

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html



------------------------------

Message: 20
Date: Tue, 20 Jul 2004 11:42:12 +0900
From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Subject: Re: Excellent job on the firewire support!
To: Shizuka Kudo <shizukakudo_99@yahoo.com>
Cc: simokawa@freebsd.org
Message-ID: <87fz7npfgb.wl@tora.nunu.org>
Content-Type: text/plain; charset=US-ASCII

(sorry for resending)

At Mon, 19 Jul 2004 19:37:04 +0100,
Doug Rabson wrote:
> 
> On Monday 19 July 2004 17:19, Shizuka Kudo wrote:
> > Hi,
> >
> > Anyone has experience with the newly added IP over 1394 support, i.e.
> > fwip?
> >
> > I compiled it in with the latest kernel at 17 July, but the box
> > cannot ping with a M$ & linux box.
> 
> I have that fixed locally but I want to fix some other problems with the 
> firewire driver - mainly that my freebsd boxes often go haywire when I 
> plug a windows box into the bus. I also want to finish writing the code 
> for freebsd to be a fully functional isochronous bus manager.

Try this patch for temporary fix.

--- //depot/vendor/freebsd/src/sys/dev/firewire/if_fwip.c	2004/06/14 09:36:01

+++ //depot/user/simokawa/firewire/sys/dev/firewire/if_fwip.c	2004/07/11 06:47
:39
@@ -91,7 +91,7 @@
 static void fwip_unicast_input(struct fw_xfer *);
 
 static int fwipdebug = 0;
-static int broadcast_channel = 31; /* XXX */
+static int broadcast_channel = 0xc0 | 0x1f; /*  tag | channel(XXX) */
 static int tx_speed = 2;
 static int rx_queue_len = FWMAXQUEUE;
 

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html

------------------------------

Message: 21
Date: Mon, 19 Jul 2004 23:19:18 -0400
From: Craig Rodrigues <rodrigc@crodrigues.org>
Subject: Re: Unloading USB driver while device is attached.
To: Ian Dowse <iedowse@maths.tcd.ie>
Cc: freebsd-current@freebsd.org
Message-ID: <20040720031918.GA692@crodrigues.org>
Content-Type: text/plain; charset=us-ascii

On Tue, Jul 20, 2004 at 12:45:08AM +0100, Ian Dowse wrote:
> In message <20040719.170132.52458790.imp@bsdimp.com>, "M. Warner Losh" write
s:
> >In message: <200407191950.aa12733@salmon.maths.tcd.ie>
> >            Ian Dowse <iedowse@maths.tcd.ie> writes:
> >: 	http://people.freebsd.org/~iedowse/usb.diff


This patch doesn't solve my EHCI problems
( see: http://lists.freebsd.org/pipermail/freebsd-current/2004-July/031838.htm
l )
but it seems like a step in the right direction.
For one thing, I don't panic in EHCI when I reboot my system
after using my Creative Nomad.

I had to change your patch a bit so that it would work against
version 1.86 of usbdi.c:


Index: usbdi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/usbdi.c,v
retrieving revision 1.86
diff -u -r1.86 usbdi.c
--- usbdi.c	19 Jul 2004 20:49:02 -0000	1.86
+++ usbdi.c	20 Jul 2004 03:16:46 -0000
@@ -85,6 +85,10 @@
 Static usbd_status usbd_open_pipe_ival
 	(usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int);
 Static int usbd_xfer_isread(usbd_xfer_handle xfer);
+Static void usbd_start_transfer(void *arg, bus_dma_segment_t *segs, int nseg,

+    int error);
+Static void usbd_alloc_callback(void *arg, bus_dma_segment_t *segs, int nseg,

+    int error);
 
 Static int usbd_nbuses = 0;
 
@@ -281,7 +285,7 @@
 usbd_transfer(usbd_xfer_handle xfer)
 {
 	usbd_pipe_handle pipe = xfer->pipe;
-	usb_dma_t *dmap = &xfer->dmabuf;
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
 	usbd_status err;
 	u_int size;
 	int s;
@@ -300,43 +304,36 @@
 	size = xfer->length;
 	/* If there is no buffer, allocate one. */
 	if (!(xfer->rqflags & URQ_DEV_DMABUF) && size != 0) {
-		struct usbd_bus *bus = pipe->device->bus;
+		bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag;
 
 #ifdef DIAGNOSTIC
 		if (xfer->rqflags & URQ_AUTO_DMABUF)
 			printf("usbd_transfer: has old buffer!\n");
 #endif
-		err = bus->methods->allocm(bus, dmap, size);
+		err = bus_dmamap_create(tag, 0, &dmap->map);
 		if (err)
-			return (err);
-		xfer->rqflags |= URQ_AUTO_DMABUF;
-	}
-
-	/* Copy data if going out. */
-	if (!(xfer->flags & USBD_NO_COPY) && size != 0 &&
-	    !usbd_xfer_isread(xfer))
-		memcpy(KERNADDR(dmap, 0), xfer->buffer, size);
-
-	err = pipe->methods->transfer(xfer);
+			return (USBD_NOMEM);
 
-	if (err != USBD_IN_PROGRESS && err) {
-		/* The transfer has not been queued, so free buffer. */
-		if (xfer->rqflags & URQ_AUTO_DMABUF) {
-			struct usbd_bus *bus = pipe->device->bus;
-
-			bus->methods->freem(bus, &xfer->dmabuf);
+		xfer->rqflags |= URQ_AUTO_DMABUF;
+		err = bus_dmamap_load(tag, dmap->map, xfer->buffer, size,
+		    usbd_start_transfer, xfer, 0);
+		if (err != 0 && err != EINPROGRESS) {
 			xfer->rqflags &= ~URQ_AUTO_DMABUF;
+			bus_dmamap_destroy(tag, dmap->map);
+			return (USBD_INVAL);
 		}
+	} else if (size != 0) {
+		usbd_start_transfer(xfer, dmap->segs, dmap->nsegs, 0);
+	} else {
+		usbd_start_transfer(xfer, NULL, 0, 0);
 	}
 
 	if (!(xfer->flags & USBD_SYNCHRONOUS))
-		return (err);
+		return (xfer->done ? 0 : USBD_IN_PROGRESS);
 
 	/* Sync transfer, wait for completion. */
-	if (err != USBD_IN_PROGRESS)
-		return (err);
 	s = splusb();
-	if (!xfer->done) {
+	while (!xfer->done) {
 		if (pipe->device->bus->use_polling)
 			panic("usbd_transfer: not done");
 		tsleep(xfer, PRIBIO, "usbsyn", 0);
@@ -345,6 +342,51 @@
 	return (xfer->status);
 }
 
+Static void
+usbd_start_transfer(void *arg, bus_dma_segment_t *segs, int nseg, int error)

+{
+	usbd_xfer_handle xfer = arg;
+	usbd_pipe_handle pipe = xfer->pipe;
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
+	bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag;
+	int err, i;
+
+	if (error != 0) {
+		KASSERT(xfer->rqflags & URQ_AUTO_DMABUF,
+		    ("usbd_start_transfer: error with non-auto buf"));
+		if (nseg > 0)
+			bus_dmamap_unload(tag, dmap->map);
+		bus_dmamap_destroy(tag, dmap->map);
+		/* XXX */
+		usb_insert_transfer(xfer);
+		xfer->status = USBD_IOERROR;
+		usb_transfer_complete(xfer);
+		return;
+	}
+
+	if (segs != dmap->segs) {
+		for (i = 0; i < nseg; i++)
+			dmap->segs[i] = segs[i];
+		dmap->nsegs = nseg;
+	}
+
+	if (segs > 0 && !usbd_xfer_isread(xfer))
+		bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_PREREAD);
+	err = pipe->methods->transfer(xfer);
+	if (err != USBD_IN_PROGRESS && err) {
+		if (xfer->rqflags & URQ_AUTO_DMABUF) {
+			bus_dmamap_unload(tag, dmap->map);
+			bus_dmamap_destroy(tag, dmap->map);
+			xfer->rqflags &= ~URQ_AUTO_DMABUF;
+		}
+		/* XXX */
+		usb_insert_transfer(xfer);
+		xfer->status = err;
+		usb_transfer_complete(xfer);
+		return;
+	}
+}
+
 /* Like usbd_transfer(), but waits for completion. */
 usbd_status
 usbd_sync_transfer(usbd_xfer_handle xfer)
@@ -353,42 +395,103 @@
 	return (usbd_transfer(xfer));
 }
 
+struct usbd_allocstate {
+	usbd_xfer_handle xfer;
+	int done;
+	int error;
+	int waiting;
+};
+
 void *
 usbd_alloc_buffer(usbd_xfer_handle xfer, u_int32_t size)
 {
-	struct usbd_bus *bus = xfer->device->bus;
+	struct usbd_allocstate allocstate;
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
+	bus_dma_tag_t tag = xfer->device->bus->buffer_dmatag;
+	void *buf;
 	usbd_status err;
+	int error, s;
 
-#ifdef DIAGNOSTIC
-	if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))
-		printf("usbd_alloc_buffer: xfer already has a buffer\n");
-#endif
-	err = bus->methods->allocm(bus, &xfer->dmabuf, size);
+	KASSERT((xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) == 0,
+	    ("usbd_alloc_buffer: xfer already has a buffer"));
+	err = bus_dmamap_create(tag, 0, &dmap->map);
 	if (err)
 		return (NULL);
+	buf = malloc(size, M_USB, M_WAITOK);
+
+	allocstate.xfer = xfer;
+	allocstate.done = 0;
+	allocstate.error = 0;
+	allocstate.waiting = 0;
+	error = bus_dmamap_load(tag, dmap->map, buf, size, usbd_alloc_callback,
+	    &allocstate, 0);
+	if (error && error != EINPROGRESS) {
+		bus_dmamap_destroy(tag, dmap->map);
+		free(buf, M_USB);
+		return (NULL);
+	}
+	if (error == EINPROGRESS) {
+		/* Wait for completion. */
+		s = splusb();
+		allocstate.waiting = 1;
+		while (!allocstate.done)
+			tsleep(&allocstate, PRIBIO, "usbdab", 0);
+		splx(s);
+		error = allocstate.error;
+	}
+	if (error) {
+		bus_dmamap_unload(tag, dmap->map);
+		bus_dmamap_destroy(tag, dmap->map);
+		free(buf, M_USB);
+		return (NULL);
+	}
+
+	xfer->allocbuf = buf;
 	xfer->rqflags |= URQ_DEV_DMABUF;
-	return (KERNADDR(&xfer->dmabuf, 0));
+	return (buf);
 }
 
 void
 usbd_free_buffer(usbd_xfer_handle xfer)
 {
-#ifdef DIAGNOSTIC
-	if (!(xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF))) {
-		printf("usbd_free_buffer: no buffer\n");
-		return;
-	}
-#endif
-	xfer->rqflags &= ~(URQ_DEV_DMABUF | URQ_AUTO_DMABUF);
-	xfer->device->bus->methods->freem(xfer->device->bus, &xfer->dmabuf);
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
+	bus_dma_tag_t tag = xfer->device->bus->buffer_dmatag;
+
+	KASSERT((xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) ==
+	    URQ_DEV_DMABUF, ("usbd_free_buffer: no/auto buffer"));
+
+	xfer->rqflags &= ~URQ_DEV_DMABUF;
+	bus_dmamap_unload(tag, dmap->map);
+	bus_dmamap_destroy(tag, dmap->map);
+	free(xfer->allocbuf, M_USB);
+	xfer->allocbuf = NULL;
 }
 
 void *
 usbd_get_buffer(usbd_xfer_handle xfer)
 {
 	if (!(xfer->rqflags & URQ_DEV_DMABUF))
-		return (0);
-	return (KERNADDR(&xfer->dmabuf, 0));
+		return (NULL);
+	return (xfer->allocbuf);
+}
+
+Static void
+usbd_alloc_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error)

+{
+	struct usbd_allocstate *allocstate = arg;
+	usbd_xfer_handle xfer = allocstate->xfer;
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
+	int i;
+
+	allocstate->error = error;
+	if (error == 0) {
+		for (i = 0; i < nseg; i++)
+			dmap->segs[i] = segs[i];
+		dmap->nsegs = nseg;
+	}
+	allocstate->done = 1;
+	if (allocstate->waiting)
+		wakeup(&allocstate);
 }
 
 usbd_xfer_handle
@@ -746,6 +849,7 @@
 			    pipe, xfer, pipe->methods));
 		/* Make the HC abort it (and invoke the callback). */
 		pipe->methods->abort(xfer);
+		KASSERT(SIMPLEQ_FIRST(&pipe->queue) != xfer, ("usbd_ar_pipe"));
 		/* XXX only for non-0 usbd_clear_endpoint_stall(pipe); */
 	}
 	pipe->aborting = 0;
@@ -757,12 +861,14 @@
 usb_transfer_complete(usbd_xfer_handle xfer)
 {
 	usbd_pipe_handle pipe = xfer->pipe;
-	usb_dma_t *dmap = &xfer->dmabuf;
+	struct usb_dma_mapping *dmap = &xfer->dmamap;
+	bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag;
+	usbd_status status;
 	int sync = xfer->flags & USBD_SYNCHRONOUS;
 	int erred = xfer->status == USBD_CANCELLED ||
-	    xfer->status == USBD_TIMEOUT;
+	     xfer->status == USBD_TIMEOUT;
 	int repeat = pipe->repeat;
-	int polling;
+	int polling, xfer_flags;
 
 	SPLUSBCHECK;
 
@@ -787,23 +893,14 @@
 	if (polling)
 		pipe->running = 0;
 
-	if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 &&
-	    usbd_xfer_isread(xfer)) {
-#ifdef DIAGNOSTIC
-		if (xfer->actlen > xfer->length) {
-			printf("usb_transfer_complete: actlen > len %d > %d\n",
-			       xfer->actlen, xfer->length);
-			xfer->actlen = xfer->length;
-		}
-#endif
-		memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen);
-	}
+	if (xfer->actlen != 0 && usbd_xfer_isread(xfer))
+		bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_POSTWRITE);
 
-	/* if we allocated the buffer in usbd_transfer() we free it here. */
+	/* if we mapped the buffer in usbd_transfer() we unmap it here. */
 	if (xfer->rqflags & URQ_AUTO_DMABUF) {
 		if (!repeat) {
-			struct usbd_bus *bus = pipe->device->bus;
-			bus->methods->freem(bus, dmap);
+			bus_dmamap_unload(tag, dmap->map);
+			bus_dmamap_destroy(tag, dmap->map);
 			xfer->rqflags &= ~URQ_AUTO_DMABUF;
 		}
 	}
@@ -833,28 +930,32 @@
 		xfer->status = USBD_SHORT_XFER;
 	}
 
-	if (xfer->callback)
-		xfer->callback(xfer, xfer->priv, xfer->status);
-
-#ifdef DIAGNOSTIC
-	if (pipe->methods->done != NULL)
+	/* Copy any xfer fields in case the xfer goes away in the callback. */
+	status = xfer->status;
+	xfer_flags = xfer->flags;
+	/*
+	 * For repeat operations, call the callback first, as the xfer
+	 * will not go away and the "done" method may modify it. Otherwise
+	 * reverse the order in case the callback wants to free or reuse
+	 * the xfer.
+	 */
+	if (repeat) {
+		if (xfer->callback)
+			xfer->callback(xfer, xfer->priv, status);
 		pipe->methods->done(xfer);
-	else
-		printf("usb_transfer_complete: pipe->methods->done == NULL\n");
-#else
-	pipe->methods->done(xfer);
-#endif
-
-	if (sync && !polling)
-		wakeup(xfer);
+	} else {
+		pipe->methods->done(xfer);
+		if (xfer->callback)
+			xfer->callback(xfer, xfer->priv, status);
 
-	if (!repeat) {
 		/* XXX should we stop the queue on all errors? */
 		if (erred && pipe->iface != NULL)	/* not control pipe */
 			pipe->running = 0;
 		else
 			usbd_start_next(pipe);
 	}
+	if (sync && !polling)
+		wakeup(xfer);
 }
 
 usbd_status
@@ -875,6 +976,7 @@
 	xfer->busy_free = XFER_ONQU;
 #endif
 	s = splusb();
+	KASSERT(SIMPLEQ_FIRST(&pipe->queue) != xfer, ("usb_insert_transfer"));
 	SIMPLEQ_INSERT_TAIL(&pipe->queue, xfer, next);
 	if (pipe->running)
 		err = USBD_IN_PROGRESS;



-- 
Craig Rodrigues        
http://crodrigues.org
rodrigc@crodrigues.org

------------------------------

Message: 22
Date: Tue, 20 Jul 2004 07:34:32 +0400
From: Maxim Maximov <mcsi@mcsi.pp.ru>
Subject: Re: HEADS UP [Re: thread+preemption stability improvement]
To: freebsd-current@freebsd.org
Message-ID: <40FC92C8.50604@mcsi.pp.ru>
Content-Type: text/plain; charset=us-ascii; format=flowed

Scott Long wrote:
> All,
> 
> Initial testing of this patch looks very promising.  For those that
> aren't comfortable with patching their sources by hand, note that it
> was committed to CVS a few hours ago and should be showing up on CVSup
> very shortly (rev 1.8 of sys/i386/i386/intr_machdep.c is what you want
> if you are running i386).  Please go out and test this as much as 
> possible so that we can determine if futher action is needed.

	I think it is needed :( Things actually get _much_ better, now I've 
been able to use my big IMAP folders, but still after applying the patch 
and working about an hour mozilla freezes with the same sympthoms (cpu 
fan gets spinning faster and faster as if cpu temperature is raising). 
Are there any ways I can help track this down further?
	Preemption is enabled, of course. My kernel's config is latest GENERIC 
with these additions:

######
device		pf
device		pflog
options         ALTQ
options         ALTQ_CBQ        # Class Bases Queueing
options         ALTQ_RED        # Random Early Drop
options         ALTQ_RIO        # RED In/Out
options         ALTQ_HFSC       # Hierarchical Packet Scheduler
options         ALTQ_CDNR       # Traffic conditioner
options         ALTQ_PRIQ       # Priority Queueing
options         ALTQ_NOPCC      # Required for SMP build
options         ALTQ_DEBUG
device		radeondrm
device          acpi_asus
device		sound
device		snd_ich
options		ALT_BREAK_TO_DEBUGGER
options		MSGBUF_SIZE=245760

	My system is the notebook ASUS L5Ga. At boot I'm getting many witness 
messages like these and I turned on debug.mpsafenet=1. Can this be a 
problem?

malloc(M_WAITOK) of "16", forcing M_NOWAIT with the following 
non-sleepable locks held:
exclusive sleep mutex skc0 (network driver) r = 0 (0xc1aa6ec0) locked @ 
/usr/src/sys/pci/if_sk.c:673
KDB: stack backtrace:
kdb_backtrace(c09e225c,c0c2170c,1,c094ba5c,10) at kdb_backtrace+0x2e
witness_warn(5,0,c0904908,c08cb429,c094d020) at witness_warn+0x1b5
uma_zalloc_arg(c10352c0,0,2,c10458c0,c1ace74c) at uma_zalloc_arg+0x4c
malloc(c,c094d020,2,c1ae7c80,9) at malloc+0xd6
sysctl_ctx_entry_add(c1ace74c,c1ab9a00,2,8,c1ace74c) at 
sysctl_ctx_entry_add+0x3d
sysctl_add_oid(c1ace74c,c1ae7d10,ffffffff,c08ecd32,80000000) at 
sysctl_add_oid+0x1a6
device_sysctl_init(c1ace700,c1a29430,c19ce6c0,c1ace700,c1ace700) at 
device_sysctl_init+0x1c0
device_attach(c1ace700,c1ace700,c08f9f99,c1acf7e0,c1ace700) at 
device_attach+0x13
device_probe_and_attach(c1ace700,c1ace380,c0c21838,c05b5679,c1ace380) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1ace380,f0000000,c07d2d20,c07d2d60,c1ace380) at 
bus_generic_attach+0x28
miibus_attach(c1ace380,c1a0b84c,c0916570,c1ace380,c1ace380) at 
miibus_attach+0x59
device_attach(c1ace380,c1ace380,1,0,c1ace380) at device_attach+0x6a
device_probe_and_attach(c1ace380,0,c0c218ac,c05b5adb,c1ace000) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1ace000,0,1,0,c1ae3000) at bus_generic_attach+0x28
mii_phy_probe(c1ace000,c1ae3220,c07d2d20,c07d2d60,ffffffff) at 
mii_phy_probe+0x11b
sk_attach(c1ace000,c1a3784c,c0916570,c1ace000,c1ace000) at sk_attach+0x3a2
device_attach(c1ace000,c1ace000,c0c2193c,c069c0ef,c1ace000) at 
device_attach+0x6a
device_probe_and_attach(c1ace000,c1aa6680,c0c21978,c07d3ba5,c1aa6780) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1aa6780,11a,1,c0c21964,ffffffff) at 
bus_generic_attach+0x28
skc_attach(c1aa6780,c1a3804c,c0916570,c1aa6780,c1aa6780) at skc_attach+0x495
device_attach(c1aa6780,c1aa6780,c1974c00,1,c1aa6780) at device_attach+0x6a
device_probe_and_attach(c1aa6780,c1aa6280,c0c21a00,c0b120db,c1aa6680) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1aa6680,c1974c00,1,c0b11dc0,c1aa6680) at 
bus_generic_attach+0x28
acpi_pci_attach(c1aa6680,c1aa6680,c19ff100,c1aa6680,c1aa6680) at 
acpi_pci_attach+0x13b
device_attach(c1aa6680,c1aa6680,c1aa0780,c1aa6280,c1aa6680) at 
device_attach+0x6a
device_probe_and_attach(c1aa6680,c1aa0780,c0c21a84,c0b1228e,c1aa6280) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1aa6280,c1ad4f30,2,c0c21a74,c0c21a7c) at 
bus_generic_attach+0x28
acpi_pcib_attach(c1aa6280,c1ad4f30,2,c0c21aa0,c1aa6280) at 
acpi_pcib_attach+0x19e
acpi_pcib_pci_attach(c1aa6280,c1aa6280,0,c1aa6280,c1aa6280) at 
acpi_pcib_pci_attach+0x9f
device_attach(c1aa6280,c1aa6280,c1968480,c1aa6100,c1aa6280) at 
device_attach+0x6a
device_probe_and_attach(c1aa6280,c19d2c00,c0c21b38,c0b120db,c1aa0780) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1aa0780,c1968480,1,c0b11dc0,c1aa0780) at 
bus_generic_attach+0x28
acpi_pci_attach(c1aa0780,c1a7904c,c0916570,c1aa0780,c1aa0780) at 
acpi_pci_attach+0x13b
device_attach(c1aa0780,c1aa0780,c1a83800,c19d2c00,c1aa0780) at 
device_attach+0x6a
device_probe_and_attach(c1aa0780,c1a83800,c0c21bbc,c0b1228e,c19d2c00) at 
device_probe_and_attach+0xd1
bus_generic_attach(c19d2c00,c1a92ed4,0,c0c21bac,0) at 
bus_generic_attach+0x28
acpi_pcib_attach(c19d2c00,c1a92ed4,0,c0c21be4,c0916570) at 
acpi_pcib_attach+0x19e
acpi_pcib_acpi_attach(c19d2c00,c1a7884c,c0916570,c19d2c00,c19d2c00) at 
acpi_pcib_acpi_attach+0x270
device_attach(c19d2c00,c19d2c00,c0b2a488,c0c21c48,c19d2c00) at 
device_attach+0x6a
device_probe_and_attach(c19d2c00,4,c0c21c74,c0b0e96b,c1a83800) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1a83800,c1968e40,64,c0b0ea30,c1a83800) at 
bus_generic_attach+0x28
acpi_probe_children(c1a83800,c0b10f60,c1a83780,0,1a4) at 
acpi_probe_children+0x9b
acpi_attach(c1a83800,c1a6b04c,c0916570,c1a83800,c1a83800) at 
acpi_attach+0x732
device_attach(c1a83800,c1a83800,c1a295c0,c0c21d08,c1a83800) at 
device_attach+0x6a
device_probe_and_attach(c1a83800,c1a83980,c0c21d18,c087310c,c1a83980) at 
device_probe_and_attach+0xd1
bus_generic_attach(c1a83980,c1a83980,c0c21d38,c06c039a,c1a83980) at 
bus_generic_attach+0x28
nexus_attach(c1a83980,c1a5b84c,c0916570,c1a83980,c1a83980) at 
nexus_attach+0x1c
device_attach(c1a83980,c1a83980,c1969af8,c0985050,c1a83980) at 
device_attach+0x6a
device_probe_and_attach(c1a83980,c1969af8,c0c21d80,c0860619,c197ca00) at 
device_probe_and_attach+0xd1
root_bus_configure(c197ca00,c090a3c2,0,c0c21d98,c067d045) at 
root_bus_configure+0x28
configure(0,c1e000,c1ec00,c1e000,0) at configure+0x29
mi_startup() at mi_startup+0xb5
begin() at begin+0x2c


--
Maxim Maximov

------------------------------

Message: 23
Date: Tue, 20 Jul 2004 12:42:00 +0900
From: Norikatsu Shigemura <nork@FreeBSD.org>
Subject: Re: Excellent job on the firewire support!
To: freebsd-current@FreeBSD.org
Cc: simokawa@FreeBSD.org
Message-ID: <20040720124200.03ce0672.nork@FreeBSD.org>
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Jul 2004 11:41:52 +0900
Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp> wrote:
> > to the author and he might find the time for it :-)
> It is not enough :-< I lack the knowledge of BIOS/PCI(and ACPI?).
> Once we can access the OHCI register via PCI in the loader,
> the remaining part is relatively easy as you described.
> I need some help for this part. I suppose that implementing dcons 
> in the loader is architecture dependent.

	I want it! :-)  Anyone, do you try to support dcons on BOOT?
	If someone do it, we will be able to change serial console -
	sio to fwohci.

------------------------------

Message: 24
Date: Tue, 20 Jul 2004 12:54:57 +0900
From: Norikatsu Shigemura <nork@FreeBSD.org>
Subject: Re: panic at turnstile_wait (Re: panic at sched_add_internal)
To: John Baldwin <jhb@FreeBSD.org>
Cc: freebsd-current@FreeBSD.org
Message-ID: <20040720125457.3a378f6b.nork@FreeBSD.org>
Content-Type: text/plain; charset=US-ASCII

On Wed, 30 Jun 2004 11:24:22 -0400
John Baldwin <jhb@FreeBSD.org> wrote:
> > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-
> > > - - [thread 100124]
> > > Stopped at      turnstile_wait+0x17a:   movl    %eax,0x10(%edx)
> > > db> trace
> > > turnstile_wait(c301e340,c0877f40,c36e4420,c0877f40,f9) at
> > > turnstile_wait+0x17a _mtx_lock_sleep(c0877f40,0,c07bd610,f9,0) at
> > > _mtx_lock_sleep+0x125 _mtx_lock_flags(c0877f40,0,c07bd610,f9,0) at
> > > _mtx_lock_flags+0x64
> > [...]
> > > -->		LIST_INSERT_HEAD(&ts->ts_free, td->td_turnstile, ts_hash);
> > > 		MPASS(owner == ts->ts_owner);
> > > 	}
> > > 	td->td_turnstile = NULL;
> > > [...]
> > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-
> > > - -
> > 	Same panic has happend at same place on new current (+1day).
> Do you have INVARIANTS turned on?  Also, can you capture the actual panic 

	Sorry, I didn't turned on INVARIANTS.  So I turned on INVARIANTS
	and INVARIANT_SUPPORT.  And I confirmed this behavior on more newer
	current.

> message?  If you do have INVARIANTS on, then it seems that pointers are 
> magically changing to NULL after the assertion check.  I'd be worried about 

> bad memory.

	My machine was freezed...  I cannot get more than following 
	message:-(.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-
panic: kse/thread mismatch
cpuid = 1;
KDB: enter: panic
[thread 100124]
Stopped at      kdb_enter+0x30: movl    %ebp,%esp
db> trace
kdb_enter(c072a43e,1,c072aa83,e3de1bdc,100) at kdb_enter+0x30
panic(c072aa83,1,c072aa97,c3317420,c2c1ea20) at panic+0x156
choosethread(c2c1ea20,c2c1ea20,c072b93b,46e,c07d0cc0) at choosethread+0x50
sched_switch(c3317420,0,c072ad0c,123,6da69d09) at sched_switch+0x109
mi_switch(1,0,c072d2e1,20b,c07db4e8) at mi_switch+0x2af
turnstile_wait(0,c07d0d00,c2c1db00,20e,c3317420) at turnstile_wait+0x351
_mtx_lock_sleep(c07d0d00,0,c074b796,3df,0) at _mtx_lock_sleep+0x195
_mtx_lock_flags(c07d0d00,0,c074b796,3df,4) at _mtx_lock_flags+0xb2
syscall(2f,2f,2f,8076500,8076500) at syscall+0x1bd
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (196, FreeBSD ELF32, getdirentries), eip = 0x6822e9df, esp = 0xbfa
dce94, ebp = 0xbfadceb0 ---
db> gdb
Step to enter the remote GDB backend.
db> s
 [freeze]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-

------------------------------

Message: 25
Date: Mon, 19 Jul 2004 23:57:24 -0400
From: Sven Willenberger <sven@dmv.com>
Subject: Re: edquota -t broken?
To: freebsd-stable@freebsd.org
Cc: current@freebsd.org
Message-ID: <40FC9824.9060003@dmv.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed



Sven Willenberger wrote:
> Having never had to concern myself with changing the grace period on
> quota filesystems I never came across this issue before. Using the -t
> flag to edquota to change the grace period on the file system in
> question has utterly no effect. Whether I take someone who was
> overquota, raise their quota and lower it, or cause a new user to go
> overquota, the grace period always starts counting down from 7 days.
> 
> This occurs on 4.7 FreeBSD as well as 5.2.1-P8. The odd thing is that I
> can go into /usr/src/ufs/ufs/quota.h and change the #DEFINE MAX_DQ_TIME
> to equal 30 days instead of 7 days and then recompiling quota.c edquota.
> c and so on.
> 
> When I invoke edquota -t -f /usr/home for example it *does* display:
> 
> Time units may be: days, hours, minutes, or seconds
> Grace period before enforcing soft limits for users:
> /usr/home: block grace period: 30 days, file grace period: 0 days
> 
> But this has utterly no effect on the quota reporting. Just to check if
> maybe it was the quota program misreporting it, I wrote a quick c
> program to check the value of dqb_btime from the structure defined in
> quota.h:
> 
> struct dqblk {
>         u_int32_t dqb_bhardlimit;       /* absolute limit on disk blks
> alloc */
>         u_int32_t dqb_bsoftlimit;       /* preferred limit on disk blks
> */
>         u_int32_t dqb_curblocks;        /* current block count */
>         u_int32_t dqb_ihardlimit;       /* maximum # allocated inodes +
> 1 */
>         u_int32_t dqb_isoftlimit;       /* preferred inode limit */
>         u_int32_t dqb_curinodes;        /* current # allocated inodes */
>         int32_t   dqb_btime;            /* time limit for excessive disk
> use */
>         int32_t   dqb_itime;            /* time limit for excessive
> files */
> };
> 
> After checking the value of that from a freshly overquota user and
> subtracting the current unix time, I was left with 7 days. 
> 
> Any ideas on this one?

Solved it by editing the quota.h in the source tree, rebuilding and 
installing the kernel and rebooting. Seems like a worthless flag to the 
edquota command if one needs to rebuild a kernel to change it. At first 
I thought that maybe the quota.h #DEFINE was for a maximum grace period, 
but that didn't hold water as I could not get the system to use a value 
less than 7 days either. I didn't try to reboot after using edquota -t 
so I don't know if that would have done anything (but I doubt it as I 
ran quotacheck after using that command).

Anyway, perhaps this could be added as a kernel option (options 
QUOTA_GRACE or something along those lines?). I realize that most people 
have gone to virtuser type systems or massive storage where quotas are 
not an issue, but there are still servers (like some of ours) where we 
have actual (/etc/passwd) users that we need to put some constraints on 
(or they will never empty/prune their email boxes for example).

Sven

------------------------------

Message: 26
Date: Tue, 20 Jul 2004 14:01:54 +1000
From: John Birrell <jb@cimlogic.com.au>
Subject: Re: HEADS UP [Re: thread+preemption stability improvement]
To: Maxim Maximov <mcsi@mcsi.pp.ru>
Cc: freebsd-current@freebsd.org
Message-ID: <20040720040153.GA21144@freebsd3.cimlogic.com.au>
Content-Type: text/plain; charset=us-ascii

On Tue, Jul 20, 2004 at 07:34:32AM +0400, Maxim Maximov wrote:
> 	I think it is needed :( Things actually get _much_ better, now I've 
> been able to use my big IMAP folders, but still after applying the patch 
> and working about an hour mozilla freezes with the same sympthoms (cpu 
> fan gets spinning faster and faster as if cpu temperature is raising). 
> Are there any ways I can help track this down further?
> 	Preemption is enabled, of course. My kernel's config is latest 
> 	GENERIC with these additions:

Even with PREEMPTION disabled, current freezes for me with a threaded applicat
ion
with lots of sendfiles in progress. I haven't figured out the set of condition
s
that actually trigger the freeze other than it never freezes if I have no
libpthread application running (and loaded to some degree).

I wonder if anyone has had current under load and if so, in what situations.
It looks like this code base is a long way away from being ready for a stable

branch. Grumble. The gap between 4 and 5 is too big. Not happy. At some point

people need to concentrate on stability. I would concede API changes for 
stability any day. Every day.

-- 
John Birrell

------------------------------

Message: 27
Date: Mon, 19 Jul 2004 23:14:44 -0500
From: Eric Anderson <anderson@centtech.com>
Subject: Re: HEADS UP [Re: thread+preemption stability improvement]
To: John Birrell <jb@cimlogic.com.au>
Cc: Maxim Maximov <mcsi@mcsi.pp.ru>
Message-ID: <40FC9C34.7030700@centtech.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

John Birrell wrote:

>On Tue, Jul 20, 2004 at 07:34:32AM +0400, Maxim Maximov wrote:
>  
>
>>	I think it is needed :( Things actually get _much_ better, now I've 
>>been able to use my big IMAP folders, but still after applying the patch 
>>and working about an hour mozilla freezes with the same sympthoms (cpu 
>>fan gets spinning faster and faster as if cpu temperature is raising). 
>>Are there any ways I can help track this down further?
>>	Preemption is enabled, of course. My kernel's config is latest 
>>	GENERIC with these additions:
>>    
>>
>
>Even with PREEMPTION disabled, current freezes for me with a threaded applica
tion
>with lots of sendfiles in progress. I haven't figured out the set of conditio
ns
>that actually trigger the freeze other than it never freezes if I have no
>libpthread application running (and loaded to some degree).
>
>I wonder if anyone has had current under load and if so, in what situations.

>It looks like this code base is a long way away from being ready for a stable

>branch. Grumble. The gap between 4 and 5 is too big. Not happy. At some point

>people need to concentrate on stability. I would concede API changes for 
>stability any day. Every day.
>  
>

I have used it under load - compiling, NFS serving, SQL serving, etc.  
I'm sure many others have too.  -current has never (that I recall) been 
suggested to be used in production environments, and it is prone to 
having issues like this, which is why it is important that we DO stress 
it, test it, and then try to help debug it by giving the most useful 
information about the problem to those that can help.  If it isn't 
working well for you right now, cvsup back to about 06/01/04 and see if 
it's any better..

Eric


-- 
------------------------------------------------------------------
Eric Anderson     Sr. Systems Administrator    Centaur Technology
Talk sense to a fool and he calls you foolish.
------------------------------------------------------------------


------------------------------

Message: 28
Date: Mon, 19 Jul 2004 21:29:54 -0700
From: Tim Kientzle <tim@kientzle.com>
Subject: Re: NEW TAR
To: Andrey Chernov <ache@nagual.pp.ru>
Cc: ports@FreeBSD.ORG
Message-ID: <40FC9FC2.8050400@kientzle.com>
Content-Type: text/plain; charset=us-ascii; format=flowed

Andrey Chernov wrote:
> On Sat, Jul 17, 2004 at 10:37:28AM -0700, Tim Kientzle wrote:
>
>> * File format: bsdtar can read gtar files, including
>>   long file names, long link names, and sparse files.
>>   bsdtar can also read many other formats that gtar
>>   does not support.
>
> Addition:
> bsdtar can't write sparse archives (Yet?).

gtar has to be better at something!  ;-)

I have some ideas about sparse file handling,
but they're not gtar-compatible.  (The gtar
approach has a number of drawbacks.  The primary
one being that on many systems it requires reading
the entire file twice, once to find holes and again
to actually archive the file.  It is possible to
do both in one pass if you store the sparse file
data in a different fashion.)

Tim




------------------------------

_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

End of freebsd-current Digest, Vol 69, Issue 4
**********************************************


--
Evariste Galois:
    �����呛��樱������蔷������,����直前......


�� ��源:������� bbs.ustc.edu.cn [FROM: 210.45.72.234]