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. Re: speeding up ugen by an order of magnitude. (Bernd Walter)
   2. Re: sockstat broken (Jul-1 current) (David Malone)
   3. Re: Any way to debug a hard lockup? (Robert Watson)
   4. Re: bringing /etc/services up to date (Oliver Eikemeier)
   5. Re: speeding up ugen by an order of magnitude. (Bernd Walter)
   6. Re: Query on status of cross-builds (Marcel Moolenaar)
   7. Re: bringing /etc/services up to date (Charles Swiger)
   8. Re: speeding up ugen by an order of magnitude. 
      (Poul-Henning Kamp)
   9. strange ata-hdd error (mikael s?derholm)
  10. Re: LORs with ipfw (Wiktor Niesiobedzki)
  11. Re: speeding up ugen by an order of magnitude.  (Scott Long)
  12. [HEADSUP] bluetooth is about to be marked as non-i386
      specific (Maksim Yevmenkin)
  13. Re: speeding up ugen by an order of magnitude.  (Julian Elischer)
  14. Re: bringing /etc/services up to date (Drew Broadley)
  15. Re: strange ata-hdd error (Daniel O'Connor)
  16. Re: Rewrite cvsup & portupgrade in C (Wesley Morgan)
  17. Re: Rewrite cvsup & portupgrade in C (Steve Kargl)
  18. Re: LORs with ipfw (Robert Watson)
  19. 5.2.1  using heaps of memory for Perl Process (Andrew Nelson)
  20. Re: speeding up ugen by an order of magnitude. (Kenneth D. Merry)
  21. Re: speeding up ugen by an order of magnitude. (M. Warner Losh)
  22. Re: 5.2.1  using heaps of memory for Perl Process (Drew Broadley)
  23. Re: speeding up ugen by an order of magnitude. (Scott Long)
  24. Re: Rewrite cvsup & portupgrade in C (Jon Noack)
  25. Re: 5.2.1  using heaps of memory for Perl Process
      (Michael Nottebrock)
  26. Re: bringing /etc/services up to date (Harti Brandt)
  27. Re: bringing /etc/services up to date (Denis Antrushin)
  28. Re: speeding up ugen by an order of magnitude. (Julian Elischer)
  29. Re: panic: arithmetic trap in fpurstor() in
      sys/i386/isa/npx.c (Bruce Evans)
  30. Re: Rewrite cvsup & portupgrade in C (Hajimu UMEMOTO)
  31. Re: speeding up ugen by an order of magnitude. (Bernd Walter)
  32. Re: today's CURRENT lockups (Don Lewis)


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

Message: 1
Date: Wed, 7 Jul 2004 22:12:17 +0200
From: Bernd Walter <ticso@cicely12.cicely.de>
Subject: Re: speeding up ugen by an order of magnitude.
To: Julian Elischer <julian@elischer.org>
Cc: mycroft@netbsd.org
Message-ID: <20040707201216.GT12877@cicely12.cicely.de>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 11:22:15AM -0700, Julian Elischer wrote:
> 
> 
> On Wed, 7 Jul 2004, Bernd Walter wrote:
> 
> > On Tue, Jul 06, 2004 at 04:32:28PM -0700, Julian Elischer wrote:
> > > 
> > > So, we had a device that we access through ugen.
> > > 
> > > the manufacturer said we should get the transaction in 3 seconds 
> > > and wiindows and linux did, but FreeBSD got it in 15 seconds.
> > > I suspect since the code is the same, NetBSD would get the same result..

> > > 
> > > lokking at it I noticed that ugen does everything in 1K bits,
> > > which is ok for USB1, but a bit silly for USB2.
> > 
> > Mmm - 128k is very big - consider that you may have hundrets of
> > ugen bulk pipes open - all with outstanding reads.
> > This would eat up kernel memory quite fast.
> 
> Yes that's why I brought it up here.
> That was only a "proof-of-concept" that showed that teh slowdown was
> coming from the fact that the ugen was only pushing
> one KB of data per frame (1mSec) interrupt. (it was pinned at 1MB/sec)
> The correct answer may be to do what pould-henning suggested and use teh
> physio facility to do this. I considerred that originally but there is
> overhead in that too, and it is  also possible that the NetBSD and
> FreeBSD physio facilities have diverged enough to make this non trivial
> as far as keeping diffs to a minimum. (It is after all NetBSD code).

Well - as I already wrote - I can't argue with physio.
What are the pros?

> It would be possibel to modulate teh malloc per xfer by only malloccing
> a buffer large enough for the transfer, but the malloc per transfer
> seems a lot of overhead. Alternatively it may be possible to malloc once
> for every endpoint on teh client device, but I'm not clear on whether it
> is possible to have multiple outstanding requests per endpoint. If so
> then how many buffers DO we malloc, and how big? What if there are a lot
> of endpoints?

You can have multiple xfers per endpoint - each endpoint has a queue
for it.
In fact a 128k xfer may be split by the controller driver if the
memory is physicxally too fragmented.
The controller will schedule requests to the bus as long as there is
any outstanding request.
More precisely the controller driver disable processing an endpoint
to modify the queue.
Maybe you could reach a similar speed gain by interleaving two 8k
xfers.

> > The problem is lost bus time between finishing an xfer and issuing
> > the next one - consider that part of this lost time is OS dependend
> > latency and in fact might be limited to FreeBSD.
> 
> No, the lost time is I believe due to something in the way that the ehci
> driver is setting things up. I believe from empirical evidence that 
> we are getting one transfer per frame (8 uframes). I don't believe OS
> response time is a key factor. 
> 
> 
> > 
> > What about those options:
> > - limit the allocated memory to the user request so we don't take the
> >   whole 128k if not reuired.
> 
> this requires a separate malloc per xfer. it;s a valid option but 
> is it acceptable?

Why - if someone is doing 160k then mallocing 128k can be done and
used twice - unless interleaving is done of course.
The win is if an application only does 64 bytes or 8 bytes.
64 bytes is the maximum allowed packet size for bulk endpoints and
small requests are not uncommon if the application needs control about
every packet.

I'm producing rs485 devices that do xfers in the 8-258 byte range.
Most xfers are only 10 bytes.
Well I did a special kernel driver for it.

> > - Do interleaving with 2 or more xfers if the read request is known to
> >   take more xfers.
> 
> You still need to malloc enough data for all outstanding data.
> better to do it with ONE request than multiple..

Interleaving with two 8k xfers would only require 16k.
Why do you think that one xfer is better?
On the USB it's done with 64 byte or, depending on the device, even
much smaller packets - the difference is just communcation with the
host controller.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de


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

Message: 2
Date: Wed, 7 Jul 2004 21:13:44 +0100
From: David Malone <dwmalone@maths.tcd.ie>
Subject: Re: sockstat broken (Jul-1 current)
To: Alex K <lesha@intercaf.ru>
Cc: freebsd-current@freebsd.org
Message-ID: <20040707201344.GA1581@walton.maths.tcd.ie>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 10:41:30PM +0400, Alex K wrote:
> $ sockstat
> sockstat: struct xtcpcb size mismatch
> sockstat: struct xfile size mismatch

That propbably means that your kernel is out of sync with your world.

	David.

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

Message: 3
Date: Wed, 7 Jul 2004 16:25:29 -0400 (EDT)
From: Robert Watson <rwatson@freebsd.org>
Subject: Re: Any way to debug a hard lockup?
To: "Conrad J. Sabatier" <conrads@cox.net>
Cc: freebsd-current@freebsd.org
Message-ID:
	<Pine.NEB.3.96L.1040707162354.37929T-100000@fledge.watson.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII

(Trimmed a slightly long CC list)

On Wed, 7 Jul 2004, Conrad J. Sabatier wrote:

> For the last few days, my amd64 box (Athlon 64 3200+, 5.2-CURRENT,
> updating just about daily lately) has been locking up hard fairly often,
> and I have no clue as to why. 
> 
> Checking the logs after rebooting reveals nothing at all out of the
> ordinary.  The box just "seizes up" and that's that.  Only thing to do
> is a power-down and restart. 
> 
> Changing from SCHED_ULE to SCHED_4BSD appears to make no difference at
> all. 
> 
> My other box, an older (32-bit) Athlon, has been rock stable.  I've been
> keeping both machines updated simultaneously to exactly the same
> revisions, using as near-identical system settings as possible also, the
> main difference being I'm running X.org/GNOME on the amd64 box and no X
> on the i386 box. 
> 
> Any suggestions?  Instinct tells me it may be a problem with some of the
> ports I'm running (X.org/GNOME, hence the Cc:s), but how to verify? 
> Sure, I could run without X a while and see how it goes, but that still
> won't help to isolate the problem, if it is, in fact, port-related. 

As already has been pointed out by others in this thread, a serial console
with BREAK_TO_DEBUGGER enabled is invaluable when debugging hangs, and
even more so when X11 may be involved.  If you're still unable to get into
a debugger using a serial break, much new server hardware supports
generating an NMI, sometimes using a nice web interface or IPMI.  This
will often be able to drop you into a debugger even when nothing else
works.  You can find a pretty decent chapter on setting up serial console,
serial port debugging, etc, in the handbook.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Principal Research Scientist, McAfee Research



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

Message: 4
Date: Wed, 7 Jul 2004 22:29:27 +0200
From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Subject: Re: bringing /etc/services up to date
To: Drew Broadley <drew@corrupt.co.nz>
Cc: current@freebsd.org
Message-ID: <57C54530-D054-11D8-8006-00039312D914@fillmore-labs.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Drew Broadley wrote:

> Colin Percival wrote:
>
>>  I've put together a patch to bring /etc/services up to date with
>> almost a decade of IANA port assignments.  Unfortunately, this
>> turned out to be rather larger than I expected: It adds 6400 lines,
>> and increases the size of /etc/services from 73 kB to 327 kB.
>>  Is anyone going to be very unhappy if I go ahead and commit this?
>>
>> Colin Percival
>>
> What are the netstat calls to /etc/services like with the update, any 
> performance decrease ?
>
> (I cannot think of any other application that uses them off the top of 
> my head)

inetd(8) for example.

-Oliver


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

Message: 5
Date: Wed, 7 Jul 2004 22:38:33 +0200
From: Bernd Walter <ticso@cicely12.cicely.de>
Subject: Re: speeding up ugen by an order of magnitude.
To: Julian Elischer <julian@elischer.org>
Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>
Message-ID: <20040707203832.GU12877@cicely12.cicely.de>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 12:20:35PM -0700, Julian Elischer wrote:
> 
> 
> On Wed, 7 Jul 2004, Bernd Walter wrote:
> 
> > On Wed, Jul 07, 2004 at 11:16:14AM +0200, Poul-Henning Kamp wrote:
> > > In message <20040707091311.GE12877@cicely12.cicely.de>, Bernd Walter wri
tes:
> > > >On Tue, Jul 06, 2004 at 04:32:28PM -0700, Julian Elischer wrote:
> > > 
> > > >What about those options:
> > > >- limit the allocated memory to the user request so we don't take the
> > > >  whole 128k if not reuired.
> > > >- Do interleaving with 2 or more xfers if the read request is known to

> > > >  take more xfers.
> > > 
> > > I would consider ugen to be a primary candidate to use physio like
> > > I belive scsi-tape drives do ?
> > 
> > I don't really know the points between physio and the current way.
> > The story with USB bulk transfers is that legal transfers can have a
> > data size of even down to 0 bytes and a lot a typical clients do
> > small transfers - just depends on the designers needs.
> 
> I might add that the INTERRUPT mode code for ugen
> does things in turn of 128 byte chunks, but for USB2
> devices it is now permissable to use chunks of up to 1024 bytes.
> we should probably make that adjustable depending on whether the device
> is a USB 2 one or not..

The number of bytes for interrupt endpoints is controlled by the
endpoint descriptor of the device - high speed or not.
An USB2 device shouldn't define 1024 byte interrupt endpoints when
only running full speed.
It's also legal for a USB2 device to be full speed only - not to
speak from attaching a high speed capable device to a full speed
controller.
You can sanity check the allowable size for interupt endpoints but
you are not allowed to do transfers of any other size then the
endpoint descriptor tells.
I did devices with 8 byte interrupt endpoints myself and had no
problems with ugen - are you shure about the 128 bytes?

>  Ther eis a lot to be done here to make this code really USB-2 code
> as opposed to USB-2 "aware" code.
> 
> 
> > In the current code it seems that short transfers are already broken
> > at least I don't see where short transfers can break out of the while
> > loop so the knowledge about the real transfers size is lost.
> > Under normal conditions we should break out on short transfers and
> > return the so far transfered size.
> > We should also be able to do interleaving some day.
> > If you think that the requirements wouldn't collide with physio then
> > OK.
> 
> Physio simply transforms a transfer into user space in a way that the
> transfers don't require a buffer, but rather, use the user's buffer
> pages as the direct target of the transfer. You need to supply a 
> "strategy" routine that does both read and write to the mapped buffers
> on behalf of physio and it tends to use system "buf" structs.

OK - that really sounds like a great idea.

> > Nevertheless I see ugen more as a quick and dirty way to test drive a
> > device from userland with all it's great debugging capabilities before
> > writing a specific kernel driver.
> > The requirement that ugen has to be generic is often bad for
> > performance sensitive applications.
> 
> Ugen is used in production all over the place where people have to used
> devices there is no specific support for, and where there is no
> kernel expertise.

Yes - and not all usage of bulk endpoints is for high bandwidth
transfers.
USB is polling as you know - so every application that waits for data
on an endpoint has an outstanding read transfer.
However - physio invalidates the whole malloc size discussion.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de


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

Message: 6
Date: Wed, 7 Jul 2004 13:45:01 -0700
From: Marcel Moolenaar <marcel@xcllnt.net>
Subject: Re: Query on status of cross-builds
To: Marius Strobl <marius@alchemy.franken.de>
Cc: kan@freebsd.org
Message-ID: <20040707204501.GA63627@ns1.xcllnt.net>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 10:05:36PM +0200, Marius Strobl wrote:
> 
> I hit this bug also with a native compilation on sparc64 trying to
> build nmap. The patch below fixes both the cross-buildworlds and
> the nmap build. It's taken from the GCC gcc-3_3-branch branch
> (sparc.h revision 1.215.4.4) so it can be committed to the FSF
> branch in FreeBSD. It's also part of GCC 3.4 and 3.4.1.

Excellent! If you didn't pester kan@ yet, feel free to start now. (kan@
cc'd). The sooner we get these tinderbox failures fixed the better...

> I have no idea why GNU tar trigged the bug only when cross building
> for sparc64.

I noticed the code generated for the native compilation and the cross
compilation differed. Probably some optimization/transformation did
not happen or happened differently for one and therefore avoided (or
triggered) the bug. It cannot be a 32-bit crossbuild bug if you saw
it natively as well, so it must be a second order effect (of which
the root cause may be that we're cross-building)...

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

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

Message: 7
Date: Wed, 7 Jul 2004 16:49:17 -0400
From: Charles Swiger <cswiger@mac.com>
Subject: Re: bringing /etc/services up to date
To: current@freebsd.org
Cc: Colin Percival <colin.percival@wadham.ox.ac.uk>
Message-ID: <1CDCA4DE-D057-11D8-9FB6-003065ABFD92@mac.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Jul 7, 2004, at 2:13 PM, Matthew D. Fuller wrote:
> On Wed, Jul 07, 2004 at 10:25:58AM -0700 I heard the voice of
> Brooks Davis, and lo! it spake thus:
[ ...with regard to Colin's proposal to make /etc/services much 
larger... ]
>> Can you check how much this change slows down inetd startup with a
>> few services enabled?  The traditional argument against this is that
>> reading the whole IANA service file takes too long.  If the
>> difference isn't measurable, the the argument is bogus, but I'm not
>> sure that's the case.

Oh, the difference is easy to measure: a trivial program which calls 
getservbyport() for the first 1000 ports takes 2.17 seconds to run with 
the 73K /etc/services file.  Using a 106K services file from nmap-3.51 
takes 2.95 seconds.

Using a 587K /etc/services file from 
http://www.iana.org/assignments/port-numbers gives a time of 16.85 
seconds, so the lookup time seems to be closely linear to the file 
size, about 2.8 ms per lookup per 100K worth of /etc/services file, at 
least on the machine I was using to test.  :-)

>> The alternative solution would be to add
>> optional database backing.  That shouldn't be too hard to do, and
>> there are several examples to work from.
>
> In theory, any program reading the data should be using
> getservby{name,port}() and friends, since it avoids code duplication
> and handles NIS and such already.  So, hashing it into a DB and fixing
> those functions to match would probably work.

Matthew is exactly correct, programs should be using getservby*().

Lots of systems implement some external caching system (nscd, lookupd, 
etc) which those library calls access rather than iterating through the 
/etc/services file and related sources directly within each process 
which calls getservby*().  I'm not sure whether the sources for 
Solaris' nscd are handy, but I believe the sources for lookupd and 
friends are at:

http://developer.apple.com/darwin/projects/opendirectory/

-- 
-Chuck

PS: Sources for the trivial program mentioned above:

#include <netdb.h>

int main(int argc, char *argv[]) {
   int port;
   struct servent *se;

   for (port = 1; port <= 1000; port++) {
     se = getservbyport(port, "tcp");
   }
}


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

Message: 8
Date: Wed, 07 Jul 2004 23:34:19 +0200
From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
Subject: Re: speeding up ugen by an order of magnitude. 
To: "Charles M. Hannum" <mycroft@netbsd.org>
Cc: FreeBSD current users <current@freebsd.org>
Message-ID: <1901.1089236059@critter.freebsd.dk>

In message <200407072129.15095.mycroft@netbsd.org>, "Charles M. Hannum" writes
:
>On Wednesday 07 July 2004 20:46, Charles M. Hannum wrote:
>> 1) You'll need to add an interface for assigning pipes for read and write,

>> since there may be more than just bulk pipes (and may be more than one bulk

>> pipe in each direction), and we only have have device node to work with.
>
>Seems I misspoke there.  That part looks fine.
>
>I think you're going to be screwed by the buffer alignment, though.  This als
o 
>causes some issues with umass if you're not using a bounce buffer.

We've already had that issue with ATA for the b�rked Geode controller:
physio does nothing for alignment and relies on userland doing something
sensible.

I think this is pretty reasonable for the kind of hardware-near
work that physio is usually employed in (including if we use it for
ugen).

Obviously, if the alignment is not OK, EINVAL should be returned,
and that means that the driver should explicitly check the alignment.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

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

Message: 9
Date: Thu, 08 Jul 2004 00:43:50 +0300
From: mikael s?derholm<gnarlie@ihku.org>
Subject: strange ata-hdd error
To: freebsd-current@freebsd.org
Message-ID: <opsasencfqyywyt2@punaposki.rauhankatu.lan>
Content-Type: text/plain; format=flowed; delsp=yes;
	charset=iso-8859-15


I get these errors after 2-7days of uptime:

Jun 30 14:04:58 mutka kernel: ad0: TIMEOUT - WRITE_DMA retrying (2 retries lef
t) LBA=3012159
Jun 30 15:40:26 mutka kernel: ad0: FAILURE - WRITE_DMA status=51<READY,DSC,ERR
OR> error=4<ABORTED> LBA=3011071
Jun 30 15:40:31 mutka kernel: ad0: TIMEOUT - WRITE_DMA retrying (2 retries lef
t) LBA=3011199

and then something like: 'removing ad0 from configuration' and I'm forced to r
eboot

and here are some older errors, these don't occur anymore though:

Feb  7 00:19:26 mutka kernel: ad0: WARNING - READ_DMA UDMA ICRC error (retryin
g request) LBA=3592687
Feb  7 00:19:27 mutka kernel: ad0: WARNING - READ_DMA UDMA ICRC error (retryin
g request) LBA=3592687
Feb  7 00:19:27 mutka kernel: ad0: FAILURE - READ_DMA status=51<READY,DSC,ERRO
R> error=84<ICRC,ABORTED> LBA=3592687
Feb  7 00:19:27 mutka kernel: spec_getpages:(ad0s1a) I/O read failure: (error=
5) bp 0xcb51d8e8 vp 0xc63e9000

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

Message: 10
Date: Wed, 7 Jul 2004 23:44:18 +0200
From: Wiktor Niesiobedzki <bsd@w.evip.pl>
Subject: Re: LORs with ipfw
To: current@freebsd.org
Cc: "Bjoern A. Zeeb" <bzeeb+freebsd+lor@zabbadoz.net>
Message-ID: <20040707214417.GF26768@mail.evip.pl>
Content-Type: text/plain; charset=us-ascii

> > > Those two are missing from your list:
> > > lock order reversal
> > >  1st 0xc14d5c84 inp (tcpinp) @ /usr/src/sys/netinet/tcp_syncache.c:1142

> > >  2nd 0xc06d5a08 IPFW static rules (IPFW static rules) @ /usr/src/sys/net
inet/ip_fw2.c:1828
> > > Stack backtrace:
> > > backtrace(0,ffffffff,c05ec8e0,c05eb940,c05c1a9c) at backtrace+0x12
> > > witness_checkorder(c06d5a08,9,c06d3c8c,724) at witness_checkorder+0x53b

> > > _mtx_lock_flags(c06d5a08,0,c06d3c8c,724,cb9689a8) at _mtx_lock_flags+0x5
7
> > > ipfw_chk(cb968a84,cb968a64,cb968ac8,0,0) at ipfw_chk+0x2d8
> > > ip_output(c1388600,0,0,0,0) at ip_output+0x633
> > > syncache_respond(c1707000,c1388600) at syncache_respond+0x2d7
> > > syncache_add(cb968bd8,cb968c38,c14aa02a,cb968bd4,c147d000,c14d7700,cb968
c38,c14aa03e,8,1,c14aa02a) at syncache_add+0x4af
> > > tcp_input(c147d000,14,0,14,100a8c0) at tcp_input+0x768
> > > ip_input(c147d000) at ip_input+0x832
> > > netisr_processqueue(c060ff98,c10d6440,c10dd400,cb968d1c,c048f724) at net
isr_processqueue+0x6e
> > > swi_net(0) at swi_net+0x85
> > > ithread_loop(c10dd400,cb968d48,c10dd400,c048f5f0,0) at ithread_loop+0x13
4
> > > fork_exit(c048f5f0,c10dd400,cb968d48) at fork_exit+0x98
> > > fork_trampoline() at fork_trampoline+0x8
> > > --- trap 0x1, eip = 0, esp = 0xcb968d7c, ebp = 0 ---
> > >
> > >
> > > And:
> > > lock order reversal
> > >  1st 0xc0610d8c tcp (tcp) @ /usr/src/sys/netinet/tcp_input.c:611
> > >  2nd 0xc06d5a08 IPFW static rules (IPFW static rules) @ /usr/src/sys/net
inet/ip_fw2.c:1828
> > > Stack backtrace:
> > > backtrace(0,ffffffff,c05ec908,c05eb940,c05c1a9c) at backtrace+0x12
> > > witness_checkorder(c06d5a08,9,c06d3c8c,724) at witness_checkorder+0x53b

> > > _mtx_lock_flags(c06d5a08,0,c06d3c8c,724,c05ead20) at _mtx_lock_flags+0x5
7
> > > ipfw_chk(cb968acc,0,cb968b10,0,0) at ipfw_chk+0x2d8
> > > ip_output(c1388e00,0,0,0,0) at ip_output+0x633
> > > tcp_respond(0,c1388e40,c1388e54,c1388e00,f1576cfc,0,14) at tcp_respond+0
x2ac
> > > tcp_input(c1388e00,14,0,14,100007f) at tcp_input+0x27b4
> > > ip_input(c1388e00) at ip_input+0x832
> > > netisr_processqueue(c060ff98,c10d6440,c10dd400,cb968d1c,c048f724) at net
isr_processqueue+0x6e
> > > swi_net(0) at swi_net+0x85
> > > ithread_loop(c10dd400,cb968d48,c10dd400,c048f5f0,0) at ithread_loop+0x13
4
> > > fork_exit(c048f5f0,c10dd400,cb968d48) at fork_exit+0x98
> > > fork_trampoline() at fork_trampoline+0x8
> > > --- trap 0x1, eip = 0, esp = 0xcb968d7c, ebp = 0 ---
I may add another one:

lock order reversal
 1st 0xc07287c8 IPFW static rules (IPFW static rules) @ /usr/src/sys/netinet/i
p_fw2.c:1828
 2nd 0xc065cfcc tcp (tcp) @ /usr/src/sys/netinet/ip_fw2.c:1574
Stack backtrace:
backtrace(c05ec5a7,c065cfcc,c05ec12e,c05ec12e,c0726a3c) at backtrace+0x17
witness_checkorder(c065cfcc,9,c0726a3c,626,806) at witness_checkorder+0x678
_mtx_lock_flags(c065cfcc,0,c0726a3c,626,0) at _mtx_lock_flags+0x80
check_uidgid(c15610a4,6,0,e08d1f53,1bd) at check_uidgid+0xd3
ipfw_chk(cb9b6bf4,cb9b6c48,c1189014,1,0) at ipfw_chk+0x9e2
ip_input(c1395c00,0,c071c576,1d0,0) at ip_input+0x375
transmit_event(c1510c00,0,c071c576,300,2) at transmit_event+0x14b
dummynet(0,0,c05ea27a,f6,1) at dummynet+0x1a9
softclock(0,0,c05e6b67,263,c0631d40) at softclock+0x1aa
ithread_loop(c10dd500,cb9b6d48,c05e695e,327,c10dd500) at ithread_loop+0x172
fork_exit(c04a5b80,c10dd500,cb9b6d48) at fork_exit+0xbc
fork_trampoline() at fork_trampoline+0x8

This is from yesterdays CURRENT. I have compiled kernel with
CPUTYPE=athlon-xp and CFLAGS=-O2. Currently I'm not able to reproduce
this messages with CPUTYPE=i686 and empty CFLAGS.

Does anyone has an clue, where the problem may lie here (or is it just
harmless?)

Cheers,

Wiktor Niesiobedzki


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

Message: 11
Date: Wed, 7 Jul 2004 16:17:27 -0600 (MDT)
From: Scott Long <scottl@freebsd.org>
Subject: Re: speeding up ugen by an order of magnitude. 
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc: ticso@cicely.de
Message-ID: <20040707161618.V97786@pooker.samsco.org>
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN

On Wed, 7 Jul 2004, Poul-Henning Kamp wrote:
> In message <200407072129.15095.mycroft@netbsd.org>, "Charles M. Hannum" writ
es:
> >On Wednesday 07 July 2004 20:46, Charles M. Hannum wrote:
> >> 1) You'll need to add an interface for assigning pipes for read and write
,
> >> since there may be more than just bulk pipes (and may be more than one bu
lk
> >> pipe in each direction), and we only have have device node to work with.

> >
> >Seems I misspoke there.  That part looks fine.
> >
> >I think you're going to be screwed by the buffer alignment, though.  This a
lso
> >causes some issues with umass if you're not using a bounce buffer.
>
> We've already had that issue with ATA for the b�rked Geode controller:
> physio does nothing for alignment and relies on userland doing something
> sensible.
>
> I think this is pretty reasonable for the kind of hardware-near
> work that physio is usually employed in (including if we use it for
> ugen).
>
> Obviously, if the alignment is not OK, EINVAL should be returned,
> and that means that the driver should explicitly check the alignment.

Note that busdma can handle alignment now for loaded buffers by using
bounce pages.

Scott

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

Message: 12
Date: Wed, 7 Jul 2004 15:44:58 -0700 (PDT)
From: Maksim Yevmenkin <m_evmenkin@yahoo.com>
Subject: [HEADSUP] bluetooth is about to be marked as non-i386
	specific
To: current@freebsd.org
Message-ID: <20040707224458.92995.qmail@web40302.mail.yahoo.com>
Content-Type: text/plain; charset=us-ascii

Dear Hackers,

in a few minutes i will be committing small changes to a few Makefile's.
these changes will take bluetooth code from ".if ${MACHINE_ARCH} ==
"i386"" section. i did crossbuild on sledge for the tier 1 platforms
(amd64, sparc64) and some of the tier 2 platforms (alpha) and it
worked for me.

i will monitor tinderbox build emails, but if your build failed and
you believe that it is bluetooth related please let me know right
away. please note that it is possible to use NO_BLUETOOTH knob to
disable bluetooth build all together.

thanks,
max


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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

Message: 13
Date: Wed, 7 Jul 2004 16:16:22 -0700 (PDT)
From: Julian Elischer <julian@elischer.org>
Subject: Re: speeding up ugen by an order of magnitude. 
To: Scott Long <scottl@freebsd.org>
Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>
Message-ID:
	<Pine.BSF.4.21.0407071615260.84004-100000@InterJet.elischer.org>
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN



On Wed, 7 Jul 2004, Scott Long wrote:

> On Wed, 7 Jul 2004, Poul-Henning Kamp wrote:
> > In message <200407072129.15095.mycroft@netbsd.org>, "Charles M. Hannum" wr
ites:
> > >On Wednesday 07 July 2004 20:46, Charles M. Hannum wrote:
> > >> 1) You'll need to add an interface for assigning pipes for read and wri
te,
> > >> since there may be more than just bulk pipes (and may be more than one 
bulk
> > >> pipe in each direction), and we only have have device node to work with
..
> > >
> > >Seems I misspoke there.  That part looks fine.
> > >
> > >I think you're going to be screwed by the buffer alignment, though.  This
 also
> > >causes some issues with umass if you're not using a bounce buffer.
> >
> > We've already had that issue with ATA for the b�rked Geode controller:
> > physio does nothing for alignment and relies on userland doing something
> > sensible.
> >
> > I think this is pretty reasonable for the kind of hardware-near
> > work that physio is usually employed in (including if we use it for
> > ugen).
> >
> > Obviously, if the alignment is not OK, EINVAL should be returned,
> > and that means that the driver should explicitly check the alignment.
> 
> Note that busdma can handle alignment now for loaded buffers by using
> bounce pages.

Since we have a relatively highly weighted priority on keeping this 
code common with teh NetBSD version, how does that go for NetBSD?


> 
> Scott
> 


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

Message: 14
Date: Thu, 08 Jul 2004 12:57:38 +1200
From: Drew Broadley <drew@corrupt.co.nz>
Subject: Re: bringing /etc/services up to date
To: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Cc: current@freebsd.org
Message-ID: <40EC9C02.9020107@corrupt.co.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Oliver Eikemeier wrote:

> Drew Broadley wrote:
>
>> Colin Percival wrote:
>>
>>>  I've put together a patch to bring /etc/services up to date with
>>> almost a decade of IANA port assignments.  Unfortunately, this
>>> turned out to be rather larger than I expected: It adds 6400 lines,
>>> and increases the size of /etc/services from 73 kB to 327 kB.
>>>  Is anyone going to be very unhappy if I go ahead and commit this?
>>>
>>> Colin Percival
>>>
>> What are the netstat calls to /etc/services like with the update, any 
>> performance decrease ?
>>
>> (I cannot think of any other application that uses them off the top 
>> of my head)
>
>
> inetd(8) for example.
>
> -Oliver

Posted that STRAIGHT after :)

- Drew

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

Message: 15
Date: Thu, 8 Jul 2004 10:51:07 +0930
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
Subject: Re: strange ata-hdd error
To: freebsd-current@freebsd.org
Cc: mikaels?derholm<gnarlie@ihku.org>
Message-ID: <200407081051.07571.doconnor@gsoft.com.au>
Content-Type: Text/Plain;  charset="iso-8859-15"

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

On Thu, 8 Jul 2004 07:13, mikael s�derholm wrote:
> I get these errors after 2-7days of uptime:
>
> Jun 30 14:04:58 mutka kernel: ad0: TIMEOUT - WRITE_DMA retrying (2 retries
> left) LBA=3012159 Jun 30 15:40:26 mutka kernel: ad0: FAILURE - WRITE_DMA
> status=51<READY,DSC,ERROR> error=4<ABORTED> LBA=3011071 Jun 30 15:40:31
> mutka kernel: ad0: TIMEOUT - WRITE_DMA retrying (2 retries left)
> LBA=3011199
>
> and then something like: 'removing ad0 from configuration' and I'm forced
> to reboot

Kind of sounds like your disk is dying..

What happens if you run smartctl on it 
(from /usr/ports/sysutils/smartmontools)

Run (as root)
smartctl -a ad0

- -- 
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)

iD8DBQFA7KGD5ZPcIHs/zowRAv6cAJ4olty44zHROqDhTLEnTHghYM2TIACgiXhK
T0JinYZvJx4XuC4nqxx6IXA=
=vbXx
-----END PGP SIGNATURE-----

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

Message: 16
Date: Wed, 7 Jul 2004 22:56:17 -0400 (EDT)
From: Wesley Morgan <morganw@chemikals.org>
Subject: Re: Rewrite cvsup & portupgrade in C
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: freebsd-current@freebsd.org
Message-ID: <20040707224510.E18741@volatile.chemikals.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 7 Jul 2004, Steve Kargl wrote:

> My initial argument does not invlove the language.  I don't
> care about the language.  My argument is that neither cvsup
> nor csup belong in the base system.  Both utilities can be
> installed from ports.  If you're going to import csup, then
> I hope csup goes through a security audit and you define a
> NO_CSUP make.conf variable.

Does "csup" belong in the tree more, or less than cvs? A program that I 
have used maybe a handful of times because cvsup is so much better for my 
purposes is rebuilt with every make world unless you explicitly disable it 
(which I would argue that most people do not). It has had security holes 
and other issues. Why is this in the base system at all? Simply so 
developers can make commits from a fresh install? I can imagine a similar 
argument to this one taking place when cvs was imported. I do know that I 
rarely bother upgrading cvsup because of the trouble it gave me. Binaries 
were never available for 5.0-current. I don't even bother to use the port, 
instead I just copy around an old binary that still works for me. It's 
always been a pain to GET cvsup.

I've seen a lot of things go into the tree over the years, some of which I 
question the need for, but hey I just turn it off in make.conf. I can't 
believe how much of a stir this has made. IMO, Bikeshedding at its finest.


WNM

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

Message: 17
Date: Wed, 7 Jul 2004 20:26:39 -0700
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject: Re: Rewrite cvsup & portupgrade in C
To: Wesley Morgan <morganw@chemikals.org>
Cc: freebsd-current@freebsd.org
Message-ID: <20040708032639.GA43737@troutmask.apl.washington.edu>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 10:56:17PM -0400, Wesley Morgan wrote:
> On Wed, 7 Jul 2004, Steve Kargl wrote:
> 
> >My initial argument does not invlove the language.  I don't
> >care about the language.  My argument is that neither cvsup
> >nor csup belong in the base system.  Both utilities can be
> >installed from ports.  If you're going to import csup, then
> >I hope csup goes through a security audit and you define a
> >NO_CSUP make.conf variable.
> 
> Does "csup" belong in the tree more, or less than cvs?

csup does not belong in the base system.  cvs belongs in
the base syste


> A program that I have used maybe a handful of times because cvsup
> is so much better for my purposes is rebuilt with every make world
> unless you explicitly disable it (which I would argue that most
> people do not).

cvsup is built with every make world?

> It has had security holes and other issues.

And csup won't have any issues?

> Why is this in the base system at all?  Simply so developers can make
> commits from a fresh install?

Rhetoric, but correct.

You do realize that you can use cvs to retrieve the FreeBSD sources
via anoncvs.  So, cvsup isn't even needed.

> I've seen a lot of things go into the tree over the years, some of which I 

> question the need for, but hey I just turn it off in make.conf.

You have to have the make.conf knob to turn it off/on.  Note, my request.

> I can't believe how much of a stir this has made.  IMO, Bikeshedding
> at its finest.

Some people are quick to pull out the bikeshed word, when they have
nothing to offer to a discussion.

-- 
Steve

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

Message: 18
Date: Wed, 7 Jul 2004 23:47:30 -0400 (EDT)
From: Robert Watson <rwatson@freebsd.org>
Subject: Re: LORs with ipfw
To: Wiktor Niesiobedzki <bsd@w.evip.pl>
Cc: "Bjoern A. Zeeb" <bzeeb+freebsd+lor@zabbadoz.net>
Message-ID:
	<Pine.NEB.3.96L.1040707234245.56368C-100000@fledge.watson.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII


On Wed, 7 Jul 2004, Wiktor Niesiobedzki wrote:

> lock order reversal
>  1st 0xc07287c8 IPFW static rules (IPFW static rules) @ /usr/src/sys/netinet
/ip_fw2.c:1828
>  2nd 0xc065cfcc tcp (tcp) @ /usr/src/sys/netinet/ip_fw2.c:1574
> Stack backtrace:
> backtrace(c05ec5a7,c065cfcc,c05ec12e,c05ec12e,c0726a3c) at backtrace+0x17
> witness_checkorder(c065cfcc,9,c0726a3c,626,806) at witness_checkorder+0x678

> _mtx_lock_flags(c065cfcc,0,c0726a3c,626,0) at _mtx_lock_flags+0x80
> check_uidgid(c15610a4,6,0,e08d1f53,1bd) at check_uidgid+0xd3
> ipfw_chk(cb9b6bf4,cb9b6c48,c1189014,1,0) at ipfw_chk+0x9e2
> ip_input(c1395c00,0,c071c576,1d0,0) at ip_input+0x375
> transmit_event(c1510c00,0,c071c576,300,2) at transmit_event+0x14b
> dummynet(0,0,c05ea27a,f6,1) at dummynet+0x1a9
> softclock(0,0,c05e6b67,263,c0631d40) at softclock+0x1aa
> ithread_loop(c10dd500,cb9b6d48,c05e695e,327,c10dd500) at ithread_loop+0x172

> fork_exit(c04a5b80,c10dd500,cb9b6d48) at fork_exit+0xbc
> fork_trampoline() at fork_trampoline+0x8
> 
> This is from yesterdays CURRENT. I have compiled kernel with
> CPUTYPE=athlon-xp and CFLAGS=-O2. Currently I'm not able to reproduce
> this messages with CPUTYPE=i686 and empty CFLAGS. 
> 
> Does anyone has an clue, where the problem may lie here (or is it just
> harmless?) 

This is a warning about a potentially harmful, but somewhat harder to fix
issue.  Basically, we currently have what amounts to a subsystem or giant
lock over the ipfw rule set and its evaluation.  Normally, the ipfw lock
will fall "after" most other locks, including protocol control block (pcb)
locks, as it will be called from other protocol code during processing.
However, when using a uid/gid rule, the protocol control block for the
packet is looked up by the ipfw code, which acquires pcb locks after the
ipfw lock.  There are a few things to think about here:

(1) This lock order reversal is really a result of a layering violation --
    the ipfw code is acting on packets at the IP layer, and looking up the
    connection from the IP layer results in cross-layer transitions that
    don't fit the general model.

(2) The lock order reversal occurs in a situation where a race condition
    also occurs -- the pcb may actually be looked up twice for inbound
    packets, once in ipfw, and then again for delivery.  While it's
    somewhat unlikely, the pcb could change in that window.  The window is
    stretched out through the use of functionality like dummynet.

(3) One way to think about fixing this is to avoid the need to hold the
    ipfw lock across the entire execution of ipfw.  I've been thinking
    about reference-counting the rule set, such that each instance of a
    thread entering the ipfw code sees the rule set as read-only and can
    access it lock-free once it has acquired a reference, releasing the
    reference on exit.  For long rule sets, this would help reduce
    contention.  You can imagine various variations on the model, such as
    per-cpu rule set instances, etc.  There are some interesting challengs
    in dynamic state management, however.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Principal Research Scientist, McAfee Research



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

Message: 19
Date: Thu, 08 Jul 2004 13:56:28 +1000
From: "Andrew Nelson" <andrew__nelson@hotmail.com>
Subject: 5.2.1  using heaps of memory for Perl Process
To: freebsd-current@freebsd.org, freebsd-perl@freebsd.org
Message-ID: <BAY18-F32queolj8Jec00019879@hotmail.com>
Content-Type: text/plain; format=flowed

Hi,

I've just upgraded from 4.9 to 5.2.1 and have a perl script
which runs for about 10 minutes roughly 20 times a day.  Since
the upgrade, the same process has started crashing with "Out
of Memory"..  It keeps building up, eating the swap then crashes.
The swap partition is the same size on the old machine but I don't
think it ever needed it.. (exactly the same hardware too).

'top'  shows the process alternating between  STATES: 'piperd',
'swread' and 'RUN'.

All the process does is uncompress some data (using the system
command to flow-tools) and inserts it into a MySQL database.

it's the same version of perl (installed with default FreeBSD install).

Can anyone suggest a fix?
Thanks,
Andrew.

_________________________________________________________________
SEEK: Now with over 50,000 dream jobs! Click here:   
http://ninemsn.seek.com.au?hotmail


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

Message: 20
Date: Wed, 7 Jul 2004 22:58:52 -0600
From: "Kenneth D. Merry" <ken@freebsd.org>
Subject: Re: speeding up ugen by an order of magnitude.
To: Robert Watson <rwatson@freebsd.org>
Cc: FreeBSD current users <current@freebsd.org>
Message-ID: <20040708045852.GA86788@panzer.kdm.org>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 07, 2004 at 14:53:38 -0400, Robert Watson wrote:
> On Wed, 7 Jul 2004, Julian Elischer wrote:
> > Yes that's why I brought it up here.  That was only a "proof-of-concept"
> > that showed that teh slowdown was coming from the fact that the ugen was
> > only pushing one KB of data per frame (1mSec) interrupt. (it was pinned
> > at 1MB/sec)  The correct answer may be to do what pould-henning
> > suggested and use teh physio facility to do this. I considerred that
> > originally but there is overhead in that too, and it is also possible
> > that the NetBSD and FreeBSD physio facilities have diverged enough to
> > make this non trivial as far as keeping diffs to a minimum. (It is after
> > all NetBSD code). 
> 
> You might want to take a look at the ZERO_COPY socket send code, as well
> as the sendfile() code...  FYI, I'm in the process of reformulating some
> of the zero copy send code on the advice of Alan Cox to make it less
> strict about alignment, etc.

That would be pretty cool.  I'm interested to see what you guys have come
up with. :)  The size and alignment restrictions make it less effective than
it could be.  (Depends on the application, obviously.)

The problems are worse on receive, but then most cards can't do the header
splitting necessary for zero copy receive.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

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

Message: 21
Date: Wed, 07 Jul 2004 23:29:16 -0600 (MDT)
From: "M. Warner Losh" <imp@bsdimp.com>
Subject: Re: speeding up ugen by an order of magnitude.
To: julian@elischer.org
Cc: phk@phk.freebsd.dk
Message-ID: <20040707.232916.126914893.imp@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

In message: <Pine.BSF.4.21.0407071137440.80217-100000@InterJet.elischer.org>
            Julian Elischer <julian@elischer.org> writes:
: > Nevertheless I see ugen more as a quick and dirty way to test drive a
: > device from userland with all it's great debugging capabilities before
: > writing a specific kernel driver.
: > The requirement that ugen has to be generic is often bad for
: > performance sensitive applications.
: 
: Ugen is used in production all over the place where people have to used
: devices there is no specific support for, and where there is no
: kernel expertise.

usb drivers are very easy to write.  I think that making it easier to
write those drivers is going to be better for the project in the long
run.

ugen is supposed to be general.  If we can make it faster w/o
sacrificying this generalness, that's OK.  But if we can't, then you
gotta do stuff in the kernel.  That's always been the case (and why we
don't have userland tcp, for example).  Some things have to be in the
kernel to be fast.

Warner

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

Message: 22
Date: Thu, 08 Jul 2004 17:53:18 +1200
From: Drew Broadley <drew@corrupt.co.nz>
Subject: Re: 5.2.1  using heaps of memory for Perl Process
To: Andrew Nelson <andrew__nelson@hotmail.com>
Cc: freebsd-current@freebsd.org
Message-ID: <40ECE14E.2050905@corrupt.co.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Andrew Nelson wrote:

> Hi,
>
> I've just upgraded from 4.9 to 5.2.1 and have a perl script
> which runs for about 10 minutes roughly 20 times a day.  Since
> the upgrade, the same process has started crashing with "Out
> of Memory"..  It keeps building up, eating the swap then crashes.
> The swap partition is the same size on the old machine but I don't
> think it ever needed it.. (exactly the same hardware too).
>
> 'top'  shows the process alternating between  STATES: 'piperd',
> 'swread' and 'RUN'.
>
> All the process does is uncompress some data (using the system
> command to flow-tools) and inserts it into a MySQL database.
>
> it's the same version of perl (installed with default FreeBSD install).
>
> Can anyone suggest a fix?

Probably the best suggestion would be to rebuild perl. 5.1 -> 5.2.1 is a 
major step and if you are using other then 5.00x then it would probably 
be a MUST DO.

Have you read /usr/src/UPDATING ?

- Drew


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

Message: 23
Date: Thu, 08 Jul 2004 00:15:17 -0600
From: Scott Long <scottl@samsco.org>
Subject: Re: speeding up ugen by an order of magnitude.
To: Julian Elischer <julian@elischer.org>
Cc: "Charles M. Hannum" <mycroft@netbsd.org>
Message-ID: <40ECE675.2090307@samsco.org>
Content-Type: text/plain; charset=UTF-8; format=flowed

Julian Elischer wrote:
> 
> On Wed, 7 Jul 2004, Scott Long wrote:
> 
> 
>>On Wed, 7 Jul 2004, Poul-Henning Kamp wrote:
>>
>>>In message <200407072129.15095.mycroft@netbsd.org>, "Charles M. Hannum" wri
tes:
>>>
>>>>On Wednesday 07 July 2004 20:46, Charles M. Hannum wrote:
>>>>
>>>>>1) You'll need to add an interface for assigning pipes for read and write
,
>>>>>since there may be more than just bulk pipes (and may be more than one bu
lk
>>>>>pipe in each direction), and we only have have device node to work with.

>>>>
>>>>Seems I misspoke there.  That part looks fine.
>>>>
>>>>I think you're going to be screwed by the buffer alignment, though.  This 
also
>>>>causes some issues with umass if you're not using a bounce buffer.
>>>
>>>We've already had that issue with ATA for the b�rked Geode controller:
>>>physio does nothing for alignment and relies on userland doing something
>>>sensible.
>>>
>>>I think this is pretty reasonable for the kind of hardware-near
>>>work that physio is usually employed in (including if we use it for
>>>ugen).
>>>
>>>Obviously, if the alignment is not OK, EINVAL should be returned,
>>>and that means that the driver should explicitly check the alignment.
>>
>>Note that busdma can handle alignment now for loaded buffers by using
>>bounce pages.
> 
> 
> Since we have a relatively highly weighted priority on keeping this 
> code common with teh NetBSD version, how does that go for NetBSD?
> 
> 
> 
>>Scott
> 
> 
> 

I honestly don't know if NetBSD busdma honors alignment when loading 
segments.  However, I believe that our usb code has the busdma 
functionality completely broken out from the common code (in usb_mem.c,
IIRC), so it's of little consequence to portability.

I was going to mention that different semantics of bus_dmamap_load()
between FreeBSD and NetBSD might still cause problems here, but it looks
like our usb code still allocates static busdma buffers and copies the
packets in/out of these.  Wasn't this fixed a while back?

Scott

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

Message: 24
Date: Thu, 08 Jul 2004 01:24:55 -0500
From: Jon Noack <noackjr@alumni.rice.edu>
Subject: Re: Rewrite cvsup & portupgrade in C
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: freebsd-current@freebsd.org
Message-ID: <40ECE8B7.4010209@alumni.rice.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed

On 07/07/04 22:26, Steve Kargl wrote:
> On Wed, Jul 07, 2004 at 10:56:17PM -0400, Wesley Morgan wrote:
>> On Wed, 7 Jul 2004, Steve Kargl wrote:
>>> My initial argument does not invlove the language.  I don't care
>>> about the language.  My argument is that neither cvsup nor csup
>>> belong in the base system.  Both utilities can be installed from
>>> ports.  If you're going to import csup, then I hope csup goes
>>> through a security audit and you define a NO_CSUP make.conf
>>> variable.
>> 
>> Does "csup" belong in the tree more, or less than cvs?
> 
> csup does not belong in the base system.  cvs belongs in the base
> syste
> 
>> A program that I have used maybe a handful of times because cvsup 
>> is so much better for my purposes is rebuilt with every make world 
>> unless you explicitly disable it (which I would argue that most 
>> people do not).
> 
> cvsup is built with every make world?

I think you misunderstand: He was questioning why *cvs* is in the base 
system and is built with every make world when many users opt for the 
more advanced cvsup instead (I used cvsup exclusively for my first 
couple years with FreeBSD).  I can see his point, but I think it's a 
good idea to include in the base system the tools used to contribute to 
FreeBSD.

I don't think it matters if c(v)sup is in the base system.  Even if it's 
not, the installer could install the package by default similar to the 
way it handles perl.  I think c(v)sup should be installed by default, 
but I couldn't care less whether or not it's in the base system.

>> It has had security holes and other issues.
> 
> And csup won't have any issues?

It's a moot point at this stage anyway.  I don't think you could 
convince many people that adding csup to the base system this late 
before 5.3 is a good idea.  If csup proves itself as a port (which I 
have no doubt that it will), perhaps adding it to the base system can be 
revisited for 6.x.

>> Why is this in the base system at all?  Simply so developers can
>> make commits from a fresh install?
> 
> Rhetoric, but correct.
> 
> You do realize that you can use cvs to retrieve the FreeBSD sources 
> via anoncvs.  So, cvsup isn't even needed.

There's a reason why we have cvsup.  It's actually faster for me to 
mirror the entire cvs repository locally using cvsup (see 
/usr/share/examples/cvsup/cvs-supfile) and 'cvs update' from there than 
to use anoncvs.  The speed of cvsup and doing the 'cvs update' locally 
more than make up for the extra steps involved.  Granted, I have a 
decently fast machine with lots of RAM, but anoncvs is still *much* 
slower than cvsup (sometimes by several orders of magnitude).

Jon

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

Message: 25
Date: Thu, 8 Jul 2004 08:41:33 +0200
From: Michael Nottebrock <michaelnottebrock@gmx.net>
Subject: Re: 5.2.1  using heaps of memory for Perl Process
To: freebsd-current@FreeBSD.org
Cc: freebsd-perl@freebsd.org
Message-ID: <200407080841.38160.michaelnottebrock@gmx.net>
Content-Type: text/plain; charset="iso-8859-15"

On Thursday 08 July 2004 05:56, Andrew Nelson wrote:

> it's the same version of perl (installed with default FreeBSD install).

Perl is not included in FreeBSD 5.2.1, which means you're probably still 
running the perl installed by FreeBSD 4.x, which could very well account for 

the strangeness you're seeing. You should probably remove all pieces of perl 

from your system by hand and then install perl from ports.

-- 
   ,_,   | Michael Nottebrock               | lofi@freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040708/
c226efea/attachment-0001.bin

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

Message: 26
Date: Thu, 8 Jul 2004 08:46:16 +0200 (CEST)
From: Harti Brandt <harti@freebsd.org>
Subject: Re: bringing /etc/services up to date
To: Charles Swiger <cswiger@mac.com>
Cc: current@freebsd.org
Message-ID: <20040708084449.I43727@beagle.kn.op.dlr.de>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 7 Jul 2004, Charles Swiger wrote:

CS>Lots of systems implement some external caching system (nscd, lookupd, etc)

CS>which those library calls access rather than iterating through the
CS>/etc/services file and related sources directly within each process which
CS>calls getservby*().  I'm not sure whether the sources for Solaris' nscd are

CS>handy, but I believe the sources for lookupd and friends are at:
CS>
CS>http://developer.apple.com/darwin/projects/opendirectory/

I remember someone from Russia or Ukraina offering something like nscd at leas
t
twice during the last 12 month. What happend to that project?

harti

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

Message: 27
Date: Thu, 08 Jul 2004 11:41:01 +0400
From: Denis Antrushin <DAntrushin@mail.ru>
Subject: Re: bringing /etc/services up to date
To: current@freebsd.org
Message-ID: <40ECFA8D.60609@mail.ru>
Content-Type: text/plain; charset=us-ascii; format=flowed

Harti Brandt wrote:
> On Wed, 7 Jul 2004, Charles Swiger wrote:
> 
> CS>Lots of systems implement some external caching system (nscd, lookupd, et
c)
> CS>which those library calls access rather than iterating through the
> CS>/etc/services file and related sources directly within each process which

> CS>calls getservby*().  I'm not sure whether the sources for Solaris' nscd a
re
> CS>handy, but I believe the sources for lookupd and friends are at:
> CS>
> CS>http://developer.apple.com/darwin/projects/opendirectory/
> 
> I remember someone from Russia or Ukraina offering something like nscd at le
ast
> twice during the last 12 month. What happend to that project?
> 
It's still there: http://rsu.ru/~bushman/lookupd/
But IIRC, there was no response to these announcements, at least on current@ .
..

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

Message: 28
Date: Thu, 8 Jul 2004 01:16:24 -0700 (PDT)
From: Julian Elischer <julian@elischer.org>
Subject: Re: speeding up ugen by an order of magnitude.
To: "M. Warner Losh" <imp@bsdimp.com>
Cc: phk@phk.freebsd.dk
Message-ID:
	<Pine.BSF.4.21.0407080108010.66234-100000@InterJet.elischer.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Wed, 7 Jul 2004, M. Warner Losh wrote:

> In message: <Pine.BSF.4.21.0407071137440.80217-100000@InterJet.elischer.org>

>             Julian Elischer <julian@elischer.org> writes:
> : > Nevertheless I see ugen more as a quick and dirty way to test drive a
> : > device from userland with all it's great debugging capabilities before
> : > writing a specific kernel driver.
> : > The requirement that ugen has to be generic is often bad for
> : > performance sensitive applications.
> : 
> : Ugen is used in production all over the place where people have to used
> : devices there is no specific support for, and where there is no
> : kernel expertise.
> 
> usb drivers are very easy to write.  I think that making it easier to
> write those drivers is going to be better for the project in the long
> run.
> 
> ugen is supposed to be general.  If we can make it faster w/o
> sacrificying this generalness, that's OK.  But if we can't, then you
> gotta do stuff in the kernel.  That's always been the case (and why we
> don't have userland tcp, for example).  Some things have to be in the
> kernel to be fast.

I don't think this has to sacrifice generalness..

Matt Dillon just made a simple patch for this on Dfly and I'm looking at
back-porting it. there is nothing in ugen that shouldn't let it take
data from a bulk USB2 device at a good speed except that it doesn't ask
for the data that fast.. it is possible that there is a problem in the
ehci driver too, but I haven't got my mind around that driver quite
fully enough yet to say for sure.. it looks like it doesn't allow more
than one transfer per msec frame from the ugen device.  solving this
would allow the use of smaller buffers. I don;t think it's a problem
woth overhead and small transfers, but rather that ugen is asking for
only 1 x 1KB transaction per mSec when USB2 is capable of delivering
60KB/mSec. I think increasing the buffer size means still asking for one
transaction per mSec, but it's a bigger transaction :-)



> 
> Warner
> 


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

Message: 29
Date: Thu, 8 Jul 2004 18:25:51 +1000 (EST)
From: Bruce Evans <bde@zeta.org.au>
Subject: Re: panic: arithmetic trap in fpurstor() in
	sys/i386/isa/npx.c
To: Eric van Gyzen <vangyzen@stat.duke.edu>
Cc: freebsd-current@freebsd.org
Message-ID: <20040708175144.V854@gamplex.bde.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 1 Jul 2004, Eric van Gyzen wrote:

> Bruce et al.:
>
> I apologize for reviving this old problem.  It became irrelevant to me for a

> few months, but now it's relevant again.
>
> Backing out rev 1.216 of vm_machdep.c fixed the problem.  I can no longer
> panic these machines.
>
> Would you still like to see the value and contents of union savefpu *addr?

I think this is the same problem that was reported in PR 68058 and
fixed in revs 1.150 and 1.151 of npx.c, so there is no need for further
investigation.  Backing out rev. 1.216 of vm_machdep.c would have
helped by removing one trigger for the problem (one at exit time), but
the problem can also be triggered by signal handling so the fixes in npx.c
should be applied to 5.2R to fix it completely (or you can get a simpler
1 line fix from the PR followup).

> Bruce Evans wrote:
> > On Thu, 19 Feb 2004, Eric van Gyzen wrote:
> > > I can reliably panic 5.2-RELEASE GENERIC running on three different AMD

> > > Athlon CPUs with:
> > >
> > >   # echo 'q()' | R --no-save
> > >
> > > R is ports/math/R-letter, and q() just tells R to quit.  This does not
> > > happen on an AthlonMP or P3 running the same kernel.  It did not happen


The known problem affects systems without SSE (or with SSE disabled).
AthlonXP and up and P3 have SSE.  You Athlons with the problem are
presumably older.

> > > on the same three Athlon machines while running 5.1-RELEASE.  Some simpl
e
> > > gdb debugging follows.  If you need more info, please ask; I don't debug

> > > the kernel very often, so I'm not sure what to provide.  :-/

5.1R has the known problem, but not the trigger for it at exit time.

> > Try backing out rev.1.216 of vm_machdep.c.  I don't see exactly how this
> > commit could cause the problem, but it is the only related thing that has

> > changed since 5.1, and the first part of it has several bugs (it is a
> > layering violation and is missing explicit disabling of interrupts).

It triggered the problem by not accidentally initializing the npx state at
exit time (this was its main point -- the initialization is mainly just a
pessimization), so state with a pending error in it was passed to the next
process to use the CPU; then since initialization for the new process had
become too lazy, the the error in the old state bit the next process.

> > > panic: arithmetic trap
> > > ...
> > > (kgdb) list *0xc07e07b4
> > > 0xc07e07b4 is in fpurstor (/usr/src/sys/i386/isa/npx.c:986).
> > > [snip]
> > >
> > > (kgdb) list 976,987
> > > 976     static void
> > > 977     fpurstor(addr)
> > > 978             union savefpu *addr;
> > > 979     {
> > > 980
> > > 981     #ifdef CPU_ENABLE_SSE
> > > 982             if (cpu_fxsr)
> > > 983                     fxrstor(addr);
> > > 984             else
> > > 985     #endif
> > > 986                     frstor(addr);
> > > 987     }

The simplest fix is to add an fnclex() to the else clause here (non-SSE
non-fxsr case only).  Since you found that it was the frstor() and not
the fxrstor that trapped, it is clear that you saw the problem on old
Athlons (or CPU_ENABLE_SSE is not configured).

> > frstror() can only cause an arithmetic trap on broken CPUs.  I doubt
> > that Athlons are that broken, so this trap is mysterious.  frstor()
> > doesn't even trap for plain i386's; it may cause a bogus IRQ13 which
> > the kernel has to be careful not to turn into an arithmetic trap.

Actually, frstor() is broken as designed and can trap on all CPUs and
NPX's that have it.  fxrstor() works right, so there is no problem in
the cpu_fxsr case.

Bruce

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

Message: 30
Date: Thu, 08 Jul 2004 17:35:52 +0900
From: Hajimu UMEMOTO <ume@FreeBSD.org>
Subject: Re: Rewrite cvsup & portupgrade in C
To: Bruce M Simpson <bms@spc.org>
Cc: freebsd-current@freebsd.org
Message-ID: <yge3c423nh3.wl%ume@FreeBSD.org>
Content-Type: text/plain; charset=US-ASCII

Hi,

>>>>> On Wed, 7 Jul 2004 10:03:20 +0100
>>>>> Bruce M Simpson <bms@spc.org> said:

bms> ezm3 provides networking libraries which would need to be updated to
bms> provide IPv6 support, and in turn, cvsup itself.
bms> Perhaps one of the ingenious KAME people may have such a patch up their
bms> sleeve? :-)

No, there is no such patch available, unfortunately.
I tried to teach IPv6 to ezm3 and cvsup.  But, I gave up.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

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

Message: 31
Date: Thu, 8 Jul 2004 10:46:51 +0200
From: Bernd Walter <ticso@cicely12.cicely.de>
Subject: Re: speeding up ugen by an order of magnitude.
To: Julian Elischer <julian@elischer.org>
Cc: phk@phk.freebsd.dk
Message-ID: <20040708084650.GW12877@cicely12.cicely.de>
Content-Type: text/plain; charset=us-ascii

On Thu, Jul 08, 2004 at 01:16:24AM -0700, Julian Elischer wrote:
> 
> 
> On Wed, 7 Jul 2004, M. Warner Losh wrote:
> 
> > In message: <Pine.BSF.4.21.0407071137440.80217-100000@InterJet.elischer.or
g>
> >             Julian Elischer <julian@elischer.org> writes:
> > : > Nevertheless I see ugen more as a quick and dirty way to test drive a

> > : > device from userland with all it's great debugging capabilities before

> > : > writing a specific kernel driver.
> > : > The requirement that ugen has to be generic is often bad for
> > : > performance sensitive applications.
> > : 
> > : Ugen is used in production all over the place where people have to used

> > : devices there is no specific support for, and where there is no
> > : kernel expertise.
> > 
> > usb drivers are very easy to write.  I think that making it easier to
> > write those drivers is going to be better for the project in the long
> > run.
> > 
> > ugen is supposed to be general.  If we can make it faster w/o
> > sacrificying this generalness, that's OK.  But if we can't, then you
> > gotta do stuff in the kernel.  That's always been the case (and why we
> > don't have userland tcp, for example).  Some things have to be in the
> > kernel to be fast.
> 
> I don't think this has to sacrifice generalness..
> 
> Matt Dillon just made a simple patch for this on Dfly and I'm looking at
> back-porting it. there is nothing in ugen that shouldn't let it take
> data from a bulk USB2 device at a good speed except that it doesn't ask

There are technical limits - such as that we can't support select and
prereads without breaking generalness for bulk endpoints.

> for the data that fast.. it is possible that there is a problem in the
> ehci driver too, but I haven't got my mind around that driver quite
> fully enough yet to say for sure.. it looks like it doesn't allow more
> than one transfer per msec frame from the ugen device.  solving this

Possibly a side effect because we have to disconnect the pipe queue to
modify it, but I still think its the time we need to take the completed
xfer and setting up the next one.

> would allow the use of smaller buffers. I don;t think it's a problem
> woth overhead and small transfers, but rather that ugen is asking for
> only 1 x 1KB transaction per mSec when USB2 is capable of delivering
> 60KB/mSec. I think increasing the buffer size means still asking for one
> transaction per mSec, but it's a bigger transaction :-)

What interrupt rate do you see from the host controller?

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de


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

Message: 32
Date: Thu, 8 Jul 2004 02:04:28 -0700 (PDT)
From: Don Lewis <truckman@FreeBSD.org>
Subject: Re: today's CURRENT lockups
To: mich@FreeBSD.org
Cc: glebius@cell.sick.ru
Message-ID: <200407080904.i6894T2r008869@gw.catspoiler.org>
Content-Type: TEXT/plain; charset=us-ascii

On  5 Jul, Michael L. Hostbaek wrote:
> Gleb Smirnoff (glebius) writes:
>>   I'm experiencing severe lockups with today's CURRENT
>> while browsing mozilla in X. I have pressed reset button
>> about 5 times today. 
> 
> Me too !

Me three!

I got bit by this problem when I tried to do some browsing on my
Thinkpad R40 after my primary (4.10-STABLE) machine lost a disk.

It's a July 5th kernel with SCHED_ULE, DDB, INVARIANTS, WITNESS, and
ACPI.

I couldn't switch to a serial console because the other end of the
serial cable connects to the dead machine.


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

_______________________________________________
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 68, Issue 10
***********************************************


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


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