Re: problems with a firewire external hard disk [long]

2002-12-04 Thread Thierry Herbelot
Le Wednesday 04 December 2002 23:41, Julian Elischer a écrit :
> On Wed, 4 Dec 2002, Thierry Herbelot wrote:
> > Hello,
> >
> > I can't seem to use my new external firewire hard disk : (this is
> > with 5.0-DP2, there are the same kinds of symptoms under 4.7-Stable)
> >
> > My main question is to know where the problems are : is the hard
> > disk dead ?  is the firewire/ATA bridge fried ? are all problems due
> > to the driver ?
>
> What bridge do you have?
> I have an Indigita bridge.. seems to work fine for my DVD writer at
> least..  That would be ATAPI not ATA right?

excerpt from dmesg :

fwohci0:  mem 0xfedffc00-0xfedffdff,0xfedff000-0xfedff7ff at 
device 8.0 on pci0
fwohci0: PCI bus latency was changing to 250.
cache size 8.
pcib0: slot 8 INTA is routed to irq 9
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channel is 4.
fwohci0: resetting OHCI...done (0)
fwohci0: BUS_OPT 0xa002 -> 0xf800a002
fwohci0: Link 1394a available S400, 3 ports, maxrec 2048 bytes.
fwohci0: Enable 1394a Enhancements
fwohci0: EUI64 08:00:46:03:00:9d:41:5e
fwochi_set_intr: 1
firewire0:  on fwohci0
firewire0: firewire bus attach
sbp_identify
sbp_probe
sbp0:  on firewire0
sbp_attach

firewire0: BUS reset
firewire0: node_id = 0xc800ffc1, CYCLEMASTER mode
firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me)
fw_set_bus_manager: 63->1 (loop=0)


Le Thursday 05 December 2002 00:31, Kenneth D. Merry a écrit :
[SNIP explanations on non-harmful error messages]
> > 
> >
> > PS : I recently tried to read from the firewire disk of a colleague,
> > which was formatted as HFS+, so these attempts did not go very far
>
> You can use dd to read from the drive and see at least whether reads work
> correctly.

done :
portable-cur# dd if=/dev/da0 of=/dev/null bs=64k count=40
40+0 records in
40+0 records out
2621440 bytes transferred in 1493.586586 secs (17551309 bytes/sec)
portable-cur#

this hopefully means neither the disk nor the adapter are fried - good news 
indeed ! (and the read speed is very good : 17Mbyte/sec)

TfH
>
> Ken

PS : this is with
FreeBSD 5.0-DP2 #1: Sat Nov 16 13:38:33 GMT 2002
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC
Preloaded elf kernel "/boot/kernel/kernel" at 0xc06be000.
Preloaded elf module "/boot/kernel/snd_ds1.ko" at 0xc06be0a8.
Preloaded elf module "/boot/kernel/snd_pcm.ko" at 0xc06be154.
Preloaded elf module "/boot/kernel/firewire.ko" at 0xc06be200.
Preloaded elf module "/boot/kernel/sbp.ko" at 0xc06be2b0.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc06be358.

I'll try ASAP with an up-to-date -Current



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



strange netstat output inside 4.x jails...

2002-12-04 Thread Josh Brooks

I run netstat -i fxp0 while _innside_ a jail:

Name  Mtu   Network   AddressIpkts IerrsOpkts Oerrs
fxp0  1500  10.10.10.10/ host 7908671 -39559 -

and then, I transfer a large file from the jail to some external host.


Name  Mtu   Network   AddressIpkts IerrsOpkts Oerrs
fxp0  1500  65.248.2.133/ host 7910577 -41292 -


The file I transferred out was 4.3 megabytes.  Opkts only increased by
1733 ... which means 2481 bytes per packet ... but ifconfig tells us:

# ifconfig -a
fxp0: flags=8843 mtu 1500

that the MTU is 1500 bytes.

So, am I missing something, or is something pathological happening here ?

thanks.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: USB support for new HP printers?

2002-12-04 Thread Dag-Erling Smorgrav
The attached patch allows me to print to my HP OfficeJet by making
ulpt0 use the bidirectional interface (7/1/2) instead of the IEEE1284
interface (7/1/3).  I haven't had time to set up CUPS yet, but simply
catting a text file do /dev/ulpt0 works fine, while previously it
would just hang.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]


Index: sys/dev/usb/ulpt.c
===
RCS file: /home/ncvs/src/sys/dev/usb/ulpt.c,v
retrieving revision 1.50
diff -u -r1.50 ulpt.c
--- sys/dev/usb/ulpt.c	30 Oct 2002 01:18:58 -	1.50
+++ sys/dev/usb/ulpt.c	4 Dec 2002 23:33:39 -
@@ -236,8 +236,7 @@
 		id->bInterfaceNumber == ifcd->bInterfaceNumber) {
 			if (id->bInterfaceClass == UICLASS_PRINTER &&
 			id->bInterfaceSubClass == UISUBCLASS_PRINTER &&
-			(id->bInterfaceProtocol == UIPROTO_PRINTER_BI ||
-			 id->bInterfaceProtocol == UIPROTO_PRINTER_1284))
+			id->bInterfaceProtocol == UIPROTO_PRINTER_BI)
 goto found;
 			altno++;
 		}



Re: maxusers and random system freezes

2002-12-04 Thread Terry Lambert
Marc Recht wrote:
> Every now and this I hear people saying (mostly you :)) that some problems
> are KVA related or that the KVA must be increased. This makes me a bit
> curious, since I've never seen problems like that on Linux. It sounds for
> me, the not kernel hacker, a bit like something which should be set at boot
> time (or via sysctl). Have you got some pointers which explain FreeBSD's
> KVA ?

I have written documentation for FreeBSD 4.3/4.4.  Unfortunately,
everyone keeps substituting activity for action, and hacking away
at the code, so it doesn't sit still long enough to match any
useful documentation; otherwise, I would have published what I
wrote in Pentad Embedded Systems Journal already (example: the
KVA_PAGES stuff came in after FreeBSD 4.3/4.4, and blew out two
paragraphs on what to modify where, and how to calculate the
values to use).

The best documentation is probably Matt Dillon's article in Daemon
News, the FreeBSD Developer's handbook, or the German guy's article
in English (sorry for not remembering your name), depending on what
part of things you are interested in.

If you could get people to leave the damn code alone for a while,
I'd be willing to update my article to FreeBSD RELENG_4 (-STABLE),
and publish it.  One of the major problems with undocumented code
is that weenies are unwilling to sit down and understand it, so
they rewrite it to understand it, instead, and then you are still
without documentation.

Documentation that's "almost right" is unbelievably worse than no
documentation at all.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Terry Lambert
Rashim Gupta wrote:
> On Thu, 5 Dec 2002, Wilkinson,Alex wrote:
> > Where can you get the "FORTH bootnext" replacement ?
> 
> That is exactly what I asked Jon and he gave me the following reply 
> 
> You want "nextboot," not "bootnext," and it is in FreeBSD 5.

Cool.  I didn't realized it had been committed; I thought there
was some argument over the patches to the libstand code.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Terry Lambert
"Wilkinson,Alex" wrote:
> Where can you get the "FORTH bootnext" replacement ?
> 
> You want the FORTH "bootnext" replacement that Jon Mini and James
> Harris worked on.
> This replaces the "nextboot" program, which was broken when FreeBSD
> went to the FORTH bootloader during the a.out->ELF transition.

It was posted about 8-9 months back.  Otherwise, you should
contact Jon Mini directly.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-04 Thread Terry Lambert
Reinier Kleipool wrote:
> but it does not put some files in the hints cache: (Files listed above
> deleted by hand from the listing below)
> 
> root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
> -rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
> -rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
> -rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13 /usr/local/lib/libdb_cxx-4.1.so*

These are shared libraries, but they do not have version numbers
associated with them (*.so.).  You have built them
incorrectly; they  should be symlinked to a versioned library of
the same name without the version.


> -r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
> -r--r--r--  1 root  wheel   10581 Nov 23 16:50 /usr/local/lib/pam_smb_auth.so

These are *not* shared libraries.  They are shared objects, which
are intended to be dlopen'ed by the PAM library, as one of the
allowed module types.  See /etc/pam.conf.


> My question is now: "Why those files not???"
> In my opinion it has something to do with the "format" of those files. It
> has nothing to do with reboots or upgrades. (it is a clean install of
> FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
> new hintsfile with all libraries in those directories.
> Any ideas about the way you generate good files and bad libraries???

See above.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Rashim Gupta


On Thu, 5 Dec 2002, Wilkinson,Alex wrote:

> Where can you get the "FORTH bootnext" replacement ?
>
>  - aW
>


That is exactly what I asked Jon and he gave me the following reply 
-rg


-- Forwarded message --
Date: Wed, 4 Dec 2002 16:40:49 -0800
From: Jonathan Mini <[EMAIL PROTECTED]>
To: Rashim Gupta <[EMAIL PROTECTED]>
Subject: Re: [Fwd: Re: booting multiple kernels]

You want "nextboot," not "bootnext," and it is in FreeBSD 5.

On Wednesday, December 4, 2002, at 07:37 AM, Rashim Gupta wrote:

> Hi Jon
>Terry mentioned in one of his e-mails that you have a program that
> can handle booting of various kernels (please read below for more
> details). Please let me know where I can get this program from.
> Thanks
> Regards
> Rashim
>



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: question about shared libraries and the library cache.

2002-12-04 Thread Tim Kientzle
According to the source code for ldconfig
(/usr/src/sbin/ldconfig/ldconfig.c),
ldconfig requires that the library file
have a name that:

* begins with 'lib'
* contains '.so.'  (note the trailing period)

This is in the dodir() function, around line
270.  It does not seem to require a number after the
final dot, though, based on a cursory reading of the
source.

So, 'pam_XXX.so' isn't in the hints file
because it's not a 'libXXX', and the
others don't have a trailing version number.

Tim Kientzle


Reinier Kleipool wrote:


Hello Gents,

  ldconfig -r does find other libraries in /usr/local/lib:
root@mail:~# ldconfig -r | grep local
search directories: /usr/lib:/usr/local/lib
67:-lltdl.1 => /usr/local/lib/libltdl.so.1
68:-ldb3.3 => /usr/local/lib/libdb3.so.3
69:-ldb3_cxx.3 => /usr/local/lib/libdb3_cxx.so.3
70:-llber.2 => /usr/local/lib/liblber.so.2
71:-lldap.2 => /usr/local/lib/libldap.so.2
72:-lldap_r.2 => /usr/local/lib/libldap_r.so.2
73:-lsasl2.2 => /usr/local/lib/libsasl2.so.2
74:-ljpeg.9 => /usr/local/lib/libjpeg.so.9
75:-lpng.5 => /usr/local/lib/libpng.so.5
root@mail:~#

but it does not put some files in the hints cache: (Files listed above
deleted by hand from the listing below)

root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
-rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
-rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
-rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13
/usr/local/lib/libdb_cxx-4.1.so*
-r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
-r--r--r--  1 root  wheel   10581 Nov 23 16:50
/usr/local/lib/pam_smb_auth.so
root@mail:~#

My question is now: "Why those files not???"
In my opinion it has something to do with the "format" of those files. It
has nothing to do with reboots or upgrades. (it is a clean install of
FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
new hintsfile with all libraries in those directories.
Any ideas about the way you generate good files and bad libraries???

Kind regards,
Reinier




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message








To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Wilkinson,Alex
Where can you get the "FORTH bootnext" replacement ?

 - aW


You want the FORTH "bootnext" replacement that Jon Mini and James
Harris worked on.
This replaces the "nextboot" program, which was broken when FreeBSD
went to the FORTH bootloader during the a.out->ELF transition.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: problems with a firewire external hard disk [long]

2002-12-04 Thread Kenneth D. Merry
On Wed, Dec 04, 2002 at 23:19:56 +0100, Thierry Herbelot wrote:
> Hello,
> 
> I can't seem to use my new external firewire hard disk :
> (this is with 5.0-DP2, there are the same kinds of symptoms under 4.7-Stable)
> 
> My main question is to know where the problems are : is the hard disk dead ? 
> is the firewire/ATA bridge fried ? are all problems due to the driver ?
> 
>   Any help very much appreciated
>   (or hints to get debugging / trace info)
> 
>   TfH
> 
> Here follows a list of problems encountered :
> 
> 
> 1/ error messages at startup
> 
> 
> when booting, the disk is detected as : (for 5.0-DP2)
> 
> firewire0:Discover new S400 device ID:00a0b80037aa
> bus_explore done
> Device SBP-II
> sbp_post_explore: EUI:00a0b80037aa spec=1 key=1.
> sbp0:0:0 LOGIN
> sbp0:0:0 ordered:0 type:0 EUI:00a0b80037aa node:0 speed:2 maxrec:5 new!
> sbp0:0:0 'LSI Logic' 'SYM13FW500-DISK DRIVE' 'a0b835'
> sbp0:0:0 login: len 16, ID 0, cmd f001, recon_hold 1
> sbp0:0:0 sbp_busy_timeout
> sbp0:0:0 sbp_agent_reset
> sbp0:0:0 sbp_do_attach
> sbp0:0:0 sbp_cam_scan_lun
> sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c83a4
> sbp0:0:0 Request aborted
> sbp0:0:0 sbp_agent_reset
> sbp0:0:0 XPT_SCSI_IO: cmd: 12 01 80 00 ff 00 00 00 00 00, flags: 0x40, 6b 
> cmd/255b data/18b sense
> sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 5 code 24 qlfr 0 len 3

It's complaining there about the serial number inquiry.  That's normal, and
you'll notice there are no CAM errors showing up from it.  The firewire
code is just being chatty.

> sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c84d8
> sbp0:0:0 Request aborted
> sbp0:0:0 sbp_agent_reset
> sbp0:0:0 XPT_SCSI_IO: cmd: 00 00 00 00 00 00 00 00 00 00, flags: 0xc0, 6b 
> cmd/0b data/32b sense
> sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 6 code 29 qlfr 0 len 3

Now it's reporting unit attention, which is normal after power on.  Again,
we retry the command so it isn't a problem.

> sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c89a8
> sbp0:0:0 Request aborted
> sbp0:0:0 sbp_agent_reset
> sbp0:0:0 XPT_SCSI_IO: cmd: 12 01 80 00 ff 00 00 00 00 00, flags: 0x40, 6b 
> cmd/255b data/18b sense
> sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 5 code 24 qlfr 0 len 3

It's complaining about the serial number inquiry again, doesn't like it.
That's not a problem.

> da0 at sbp0 bus 0 target 0 lun 0
> da0:  Fixed Simplified Direct Access SCSI-0 
> device
> da0: 50.000MB/s transfers
> da0: 28615MB (58605120 512 byte sectors: 255H 63S/T 3648C)
> 
> I'm a bit disturbed by the "Request aborted" messages
> 
> 
> 2/ Geometry problems
> 
> furthermore, I can't use more than the first 1024 cylinders of the disk : I 
> cannot create a BIOS partition above cylinder 1024 (all partitions seem cut 
> at 1024, when seen from the 4.7-Stable of 5.0 fdisk, even when forcing 3648 
> cylinders for the size)

[ someone else will have to address the fdisk issues ]

> 
> 3/ Write errors
> 
> when I try to write to any partitions, one write operations ends "as stuck", 
> with an error message such as :
> Dec  4 21:41:09 portable-cur kernel: sbp_scsi_status: unknown scsi status
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 sbp_abort_ocb 0x1b
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 XPT_SCSI_IO: cmd: 2a 00 00 00 00 
> 9f 00 00 20 00, flags: 0x80, 10b cmd/16384b data/32b sense
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 ORB status src:0 resp:1 dead:1 
> len:3 stat:4 orb:0008c8fac
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 Object: Operation request block 
> (ORB), Serial Bus Error: Busy retry limit exceeded(X)
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 unordered execution order:1
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 sbp_agent_reset

Looks like some sort of firewire error (i.e. not a SCSI error coming back
from the drive).

> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 XPT_SCSI_IO: cmd: 2a 00 00 00 00 
> 9f 00 00 20 00, flags: 0x80, 10b cmd/16384b data/32b sense
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 SCSI status 8 sfmt 0 valid 0 key 
> b code 8 qlfr 0 len 3
> Dec  4 21:41:09 portable-cur kernel: sbp_scsi_status: unknown scsi status
> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 sbp_abort_ocb 0x1b

Now the drive says it's busy.  Note that no CAM error has been printed for
this one -- it probably got retried.

> Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 XPT_SCSI_IO: cmd: 2a 00 00 00 00 
> 7f 00 00 20 00, flags: 0x80, 10b cmd/16384b data/32b sense
> Dec  4 21:41:10 portable-cur kernel: sbp0:0:0 ORB status src:0 resp:1 dead:1 
> len:3 stat:4 orb:0008c9214
> Dec  4 21:41:10 portable-cur kernel: sbp0:0:0 Object: Operation request block 
> (ORB), Serial Bus Error: Busy retry limit exceeded(X)
> Dec  4 21:41:10 portable-cur kernel: sbp0:0:0 unordered execution order:1
> Dec  4 21:41:10 portable

Re: maxusers and random system freezes

2002-12-04 Thread Marc Recht
With these settings, and that much physical RAM, you should set
your KVA space to 3G (the default is 2G); have you?

Most likely, you are running out of KVA space for mappings.

Every now and this I hear people saying (mostly you :)) that some problems 
are KVA related or that the KVA must be increased. This makes me a bit 
curious, since I've never seen problems like that on Linux. It sounds for 
me, the not kernel hacker, a bit like something which should be set at boot 
time (or via sysctl). Have you got some pointers which explain FreeBSD's 
KVA ?

Regards,
Marc

"Premature optimization is the root of all evil." -- Donald E. Knuth

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message


Re: problems with a firewire external hard disk [long]

2002-12-04 Thread Julian Elischer


On Wed, 4 Dec 2002, Thierry Herbelot wrote:

> Hello,
> 
> I can't seem to use my new external firewire hard disk : (this is
> with 5.0-DP2, there are the same kinds of symptoms under 4.7-Stable)
> 
> My main question is to know where the problems are : is the hard
> disk dead ?  is the firewire/ATA bridge fried ? are all problems due
> to the driver ?

What bridge do you have?
I have an Indigita bridge.. seems to work fine for my DVD writer at
least..  That would be ATAPI not ATA right?





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Enache Adrian
> 
> FWIW, my first X11 game I ever wrote, which was similar to the
> game "LodeRunner", used a select() timeout for the timing loop

select(),nanosleep(),poll(),etc all sleep one tick longer _except_
when previous syscall was interrupted by a signal or when input 
became available.

this is due to tvtohz ( sys/kern/kern_clock.c ) allways adding 1
to 'allow for the current tick to expire'.

this badly breaks some - maybe poor - code I have written which
hooks both i/o polling and timers ( set_fd, set_timer,kill_timer
in the style of javascript) on a select() loop.
(random timeouts would be better here!)

I'm not sure but this seems to affect also the Xkb ( I use to set
autorepeat to delay 10,repeat 120 ) when playing my tetris ...

why not testing for zero result instead of adding 1 in tvtohz ?
if (ticks > INT_MAX)
ticks = INT_MAX;
+   else if (ticks == 0)
+   ticks = 1;
return ((int)ticks);

I modified kern_clock.c and other places which assume that tvtohz
adds 1 in 4.4 long time ago and recently in 5.0 and haven't seen
so far any harm at all.

I attached my trivial patch and a little test program.

Best regards
adi

notes:
tvtohz has been renamed to hzto in NetBSD but is the same.

of course you can write
  ticks =
(sec * hz) + (((unsigned long)usec + (tick - 1)) / tick) ?: 1;
but this wouldn't work with other compiler than GCC ( does
FreeBSD compile with other compiler anyway ?)

/* select [msec] - display select() timeout inaccuracy as '[+-] sec usec' */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

fd_set rdfs;
int ms;

void sig(int unused) {}

int main(int argc,char **argv)
{
int k,mib[2];
struct timeval tv,savtv,otv;
struct clockinfo clock;
char buf[256];
signal(SIGQUIT,sig);
if (argc > 1) ms = atoi(argv[1]);
if (!ms) ms = 500;
savtv.tv_usec = ms % 1000 * 1000; savtv.tv_sec = ms / 1000;
mib[0] = CTL_KERN; mib[1] = KERN_CLOCKRATE;
k = sizeof clock;
if (sysctl(mib,2,&clock,&k,NULL,0)) err(1,"sysctl");
printf("%d\n",clock.tick);
savtv.tv_usec -= savtv.tv_usec % clock.tick;
redo:
tv = savtv; gettimeofday(&otv,NULL);
for(;;) {
FD_SET(0,&rdfs);
k = select(1,&rdfs,NULL,NULL,&tv);
gettimeofday(&tv,NULL);
timersub(&tv,&otv,&tv);
switch(k) {
case 0:
if (timercmp(&tv,&savtv,<))
{ timersub(&savtv,&tv,&tv);k = '-'; }
else
{ timersub(&tv,&savtv,&tv);k = '+'; }
printf("%c%4d s %10d us\n",k,tv.tv_sec,tv.tv_usec);
goto redo;
case -1:
if (errno != EINTR) err(1,"select");
printf("\t--interrupt\n");
break;
default:
read(0,buf,256);
printf("\t--input\n");
break;
}
timersub(&savtv,&tv,&tv);
if (tv.tv_sec < 0) timerclear(&tv);
}
}

/* use ^M for input and ^\ for interrupt
   unpatched kernel:
+   0 s   9938 us

--input
+   0 s   9959 us
+   0 s   9972 us
+   0 s   9930 us
^\  --interrupt
+   0 s   9954 us
+   0 s   9954 us

   patched kernel:
-   0 s 44 us
^\  --interrupt
-   0 s  3 us
-   0 s100 us

--input
-   0 s 44 us
-   0 s 47 us
 (this on xterm,on console results are better)
*/

diff -Naur osrc/sys/kern/kern_clock.c src/sys/kern/kern_clock.c
--- osrc/sys/kern/kern_clock.c  Tue Nov 19 23:58:52 2002
+++ src/sys/kern/kern_clock.c   Mon Dec  2 23:47:36 2002
@@ -257,8 +257,7 @@
 * If the number of usecs in the whole seconds part of the time
 * difference fits in a long, then the total number of usecs will
 * fit in an unsigned long.  Compute the total and convert it to
-* ticks, rounding up and adding 1 to allow for the current tick
-* to expire.  Rounding also depends on unsigned long arithmetic
+* ticks.  Rounding also depends on unsigned long arithmetic
 * to avoid overflow.
 *
 * Otherwise, if the number of ticks in the whole seconds part of
@@ -291,14 +290,15 @@
ticks = 1;
} else if (sec <= LONG_MAX / 100)
ticks = (sec * 100 + (unsigned long)usec + (tick - 1))
-   / tick + 1;
+   / tick;
else if (sec <= LONG_MAX / hz)
-   ticks = sec * hz
-   + ((unsigned long)usec + (tick - 1)) / tick + 1;
+   ticks = sec * hz + ((unsigned long)usec + (tick - 1)) / tick;
else
ticks = LONG_MAX;
if (ticks > INT_MAX

problems with a firewire external hard disk [long]

2002-12-04 Thread Thierry Herbelot
Hello,

I can't seem to use my new external firewire hard disk :
(this is with 5.0-DP2, there are the same kinds of symptoms under 4.7-Stable)

My main question is to know where the problems are : is the hard disk dead ? 
is the firewire/ATA bridge fried ? are all problems due to the driver ?

Any help very much appreciated
(or hints to get debugging / trace info)

TfH

Here follows a list of problems encountered :


1/ error messages at startup


when booting, the disk is detected as : (for 5.0-DP2)

firewire0:Discover new S400 device ID:00a0b80037aa
bus_explore done
Device SBP-II
sbp_post_explore: EUI:00a0b80037aa spec=1 key=1.
sbp0:0:0 LOGIN
sbp0:0:0 ordered:0 type:0 EUI:00a0b80037aa node:0 speed:2 maxrec:5 new!
sbp0:0:0 'LSI Logic' 'SYM13FW500-DISK DRIVE' 'a0b835'
sbp0:0:0 login: len 16, ID 0, cmd f001, recon_hold 1
sbp0:0:0 sbp_busy_timeout
sbp0:0:0 sbp_agent_reset
sbp0:0:0 sbp_do_attach
sbp0:0:0 sbp_cam_scan_lun
sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c83a4
sbp0:0:0 Request aborted
sbp0:0:0 sbp_agent_reset
sbp0:0:0 XPT_SCSI_IO: cmd: 12 01 80 00 ff 00 00 00 00 00, flags: 0x40, 6b 
cmd/255b data/18b sense
sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 5 code 24 qlfr 0 len 3
sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c84d8
sbp0:0:0 Request aborted
sbp0:0:0 sbp_agent_reset
sbp0:0:0 XPT_SCSI_IO: cmd: 00 00 00 00 00 00 00 00 00 00, flags: 0xc0, 6b 
cmd/0b data/32b sense
sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 6 code 29 qlfr 0 len 3
sbp0:0:0 ORB status src:1 resp:0 dead:1 len:3 stat:c orb:0008c89a8
sbp0:0:0 Request aborted
sbp0:0:0 sbp_agent_reset
sbp0:0:0 XPT_SCSI_IO: cmd: 12 01 80 00 ff 00 00 00 00 00, flags: 0x40, 6b 
cmd/255b data/18b sense
sbp0:0:0 SCSI status 2 sfmt 0 valid 0 key 5 code 24 qlfr 0 len 3
da0 at sbp0 bus 0 target 0 lun 0
da0:  Fixed Simplified Direct Access SCSI-0 
device
da0: 50.000MB/s transfers
da0: 28615MB (58605120 512 byte sectors: 255H 63S/T 3648C)

I'm a bit disturbed by the "Request aborted" messages


2/ Geometry problems

furthermore, I can't use more than the first 1024 cylinders of the disk : I 
cannot create a BIOS partition above cylinder 1024 (all partitions seem cut 
at 1024, when seen from the 4.7-Stable of 5.0 fdisk, even when forcing 3648 
cylinders for the size)

for now, I've tried to just use 4 1G partitions :

portable-cur# fdisk da0
*** Working on device /dev/da0 ***
parameters extracted from in-core disklabel are:
cylinders=3648 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=3648 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 2040192 (996 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 126/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 2040255, size 2040255 (996 Meg), flag 80 (active)
beg: cyl 127/ head 0/ sector 1;
end: cyl 253/ head 254/ sector 63
The data for partition 3 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 4080510, size 2040255 (996 Meg), flag 80 (active)
beg: cyl 254/ head 0/ sector 1;
end: cyl 380/ head 254/ sector 63
The data for partition 4 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 6120765, size 2040255 (996 Meg), flag 80 (active)
beg: cyl 381/ head 0/ sector 1;
end: cyl 507/ head 254/ sector 63
portable-cur#

(why are all partitions active ?)


3/ Write errors

when I try to write to any partitions, one write operations ends "as stuck", 
with an error message such as :
Dec  4 21:41:09 portable-cur kernel: sbp_scsi_status: unknown scsi status
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 sbp_abort_ocb 0x1b
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 XPT_SCSI_IO: cmd: 2a 00 00 00 00 
9f 00 00 20 00, flags: 0x80, 10b cmd/16384b data/32b sense
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 ORB status src:0 resp:1 dead:1 
len:3 stat:4 orb:0008c8fac
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 Object: Operation request block 
(ORB), Serial Bus Error: Busy retry limit exceeded(X)
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 unordered execution order:1
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 sbp_agent_reset
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 XPT_SCSI_IO: cmd: 2a 00 00 00 00 
9f 00 00 20 00, flags: 0x80, 10b cmd/16384b data/32b sense
Dec  4 21:41:09 portable-cur kernel: sbp0:0:0 SCSI status 8 sfmt 0 valid 0 key 
b code 8 qlfr 0 len 3
Dec  4 21:41:09 portable-cur kernel: sbp_scsi_status: unknown scsi status
Dec  4 21:41:09 portable-cur kernel: sbp0:0:

RE: question about shared libraries and the library cache.

2002-12-04 Thread Reinier Kleipool
Hello Gents,

  ldconfig -r does find other libraries in /usr/local/lib:
root@mail:~# ldconfig -r | grep local
search directories: /usr/lib:/usr/local/lib
67:-lltdl.1 => /usr/local/lib/libltdl.so.1
68:-ldb3.3 => /usr/local/lib/libdb3.so.3
69:-ldb3_cxx.3 => /usr/local/lib/libdb3_cxx.so.3
70:-llber.2 => /usr/local/lib/liblber.so.2
71:-lldap.2 => /usr/local/lib/libldap.so.2
72:-lldap_r.2 => /usr/local/lib/libldap_r.so.2
73:-lsasl2.2 => /usr/local/lib/libsasl2.so.2
74:-ljpeg.9 => /usr/local/lib/libjpeg.so.9
75:-lpng.5 => /usr/local/lib/libpng.so.5
root@mail:~#

but it does not put some files in the hints cache: (Files listed above
deleted by hand from the listing below)

root@mail:~# ls -l /usr/local/lib/*.so* | grep -v "^l"
-rwxr-xr-x  1 root  wheel  699643 Dec  1 11:12 /usr/local/lib/libdb-4.1.so*
-rwxr-xr-x  1 root  wheel  699643 Nov 29 11:32 /usr/local/lib/libdb4_1.so*
-rwxr-xr-x  1 root  wheel  800336 Dec  1 11:13
/usr/local/lib/libdb_cxx-4.1.so*
-r-xr-xr-x  1 root  wheel   32216 Nov 23 16:53 /usr/local/lib/pam_ldap.so*
-r--r--r--  1 root  wheel   10581 Nov 23 16:50
/usr/local/lib/pam_smb_auth.so
root@mail:~#

My question is now: "Why those files not???"
In my opinion it has something to do with the "format" of those files. It
has nothing to do with reboots or upgrades. (it is a clean install of
FreeBSD 4.7) Also "ldconfig /usr/lib /usr/local/lib" should create a clean
new hintsfile with all libraries in those directories.
Any ideas about the way you generate good files and bad libraries???

Kind regards,
Reinier




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: USB support for new HP printers?

2002-12-04 Thread Dag-Erling Smorgrav
John Nielsen <[EMAIL PROTECTED]> writes:
> "Hi, John.  The LaserJet 1200 advertises several alternate settings for the
> printer-class interface: 7/1/3 (for IEEE 1284.4 packets, the "new and
> different USB interface" you mentioned), 7/1/2 (bidirectional raw print
> data), and 7/1/1 (unidirectional raw print data).  If you can somehow
> convince the ulpt driver to bind to 7/1/2 or 7/1/1 rather than just blindly
> binding to the first alternate setting it finds, then that should be all you
> need."

Interesting.  I wonder if the same applies to the OfficeJet.  I have a
d145, and while FreeBSD recognizes it just fine, and attaches it as a
ulpt device, it fails to print (the process that tries to write to
/dev/ulpt0 just hangs).  I'll see if I can figure out a way to force
the ulpt driver to bind to 7/1/2.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Mike Silbersack

On Wed, 4 Dec 2002, Stijn Hoop wrote:

> > In short, I don't think the issue has been discussed much, partially
> > because it's so easy for those who want hz=1000 to just edit loader.conf.
> > If you want to propose that we switch to hz=1000 by default:
>
> Nah, I'll leave that to someone who has some more expertise in writing
> benchmarks etc.
>
> --Stijn

Well, what you _should_ do is make sure that the Xmame documentation gets
updated to mention that FreeBSD users should tweak kern.hz for best
performance. :)

Mike "Silby" Silbersack



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: maxusers and random system freezes

2002-12-04 Thread Terry Lambert
Varshavchick Alexander wrote:
> > With these settings, and that much physical RAM, you should set
> > your KVA space to 3G (the default is 2G); have you?
> >
> > Most likely, you are running out of KVA space for mappings.
> 
> No, I didn't do it, and I'm not sure how to perform it, can you please
> advise? Thanks a lot!

grep -B 7 KVA_ /sys/i386/conf/LINT

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Terry Lambert
Stijn Hoop wrote:
> On Wed, Dec 04, 2002 at 10:06:16AM -0800, Terry Lambert wrote:
> > Actually, for the case you are talking about, your emulator should
> > be using aggregate instead of discrete timeouts, and you would not
> > be having a problem.  It's not useful to do 100 1ms timeouts to
> > achieve a  100ms timeout, when you can ask for a single 100ms
> > timeout.  I would count this as a bug in your emulator.
> 
> Yes, I would count it as a bug in any application in fact. But these
> benchmarks are used to determine which of the various _sleep functions
> would be appropriate to use in the idle loop of the emulator while
> not dropping too many frames. Sleeping for a minimum of 10 ms is a
> lot if you want to achieve a steady 60 frames / second.

It's a flawed benchmark.

I would argue that that application was special purpose, as well.

The hardclock rate gets boosted in the kernel under certain usage
conditions, among them being using the PC speaker driver.  I
believe there is an interface available that you could abuse to
raise it the same way.  Far be it for sotware to know about the
hardware it's running on, though... 8-).

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Terry Lambert
Mike Silbersack wrote:
> On the other hand, a higher HZ should create a system which runs a bit
> smoother for interactive programs.  And, as you point out, it is necessary
> for good timing in emulators / simulators / dummynet.

Higher hardclock rate.  It affects dummynet because most of the
work it does is at NETISR.  Software interrupts run when you splx()
back down from a high SPL to one at or below the software interrupt
priority level.  More hardware interrupts equal more software
interrupts, in that case, and so dummynet runs faster.  You could
achieve the same effect by running multiple dummynet software
interrupts.  The real problem is peristalsis; you want the dummynet
code to run number-of-nodes-along-a-graph-edge number of times per
soft interrupt, rather than just once per.  So the same effect would
be to put the soft interrupt routine in an encapsulation "for" loop
with number of nodes on longest edge, plus one.  For most dummynet
applications, that's basically adding:


int j;

for( j = 0; j< 4; j++) {

... /* normal dummynet software interrupt code */
}

To the dummynet ISR.


For emulators and simulators, the problem is badly written code,
as I stated previously.  Rather than adding a bunch of operations
together to get one big operation, the code should use a single
big operation.  Thus the overhead is amortized, and the timer
resolution requirements are significantly reduced.

FWIW, my first X11 game I ever wrote, which was similar to the
game "LodeRunner", used a select() timeout for the timing loop
to ensure smooth game operation.


-- Terry



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Stijn Hoop
On Wed, Dec 04, 2002 at 10:06:16AM -0800, Terry Lambert wrote:

[snip]

> Increased context switch overhead.

Yes, Mike's explanation was clear.

> Actually, for the case you are talking about, your emulator should
> be using aggregate instead of discrete timeouts, and you would not
> be having a problem.  It's not useful to do 100 1ms timeouts to
> achieve a  100ms timeout, when you can ask for a single 100ms
> timeout.  I would count this as a bug in your emulator.

Yes, I would count it as a bug in any application in fact. But these
benchmarks are used to determine which of the various _sleep functions
would be appropriate to use in the idle loop of the emulator while
not dropping too many frames. Sleeping for a minimum of 10 ms is a
lot if you want to achieve a steady 60 frames / second.

--Stijn

-- 
The rain it raineth on the just
And also on the unjust fella,
But chiefly on the just, because
The unjust steals the just's umbrella.



msg38474/pgp0.pgp
Description: PGP signature


Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Stijn Hoop
On Wed, Dec 04, 2002 at 12:01:43PM -0600, Mike Silbersack wrote:
> On Wed, 4 Dec 2002, Stijn Hoop wrote:
> > With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am
> > indeed seeing much better times on this 'benchmark'. See attached log. Not
> > only the _select_sleep method benefits from this. What are the reasons *not*
> > to do this?
> >
> > > As to why Linux may appear "better"... I believe that Linux defaults to
> > > hz=100, but that the default switched to hz=1000 sometime in the recent
> > > past.
> >
> > And why don't we do the same? (I suspect this is related to the question
> > above :)
> 
> Well, it's generally believed that in the common case (around 100
> processes, and/or with well behaved processes that voluntarily give up
> their timeslice) that 100 context switches per second is enough for
> smooth performance.  Whether this is true or not as you hit 500+ processes
> on a busy server is unknown, I don't believe that anyone has done
> benchmarking.  One argument against more frequent context switches when
> you have < 100 processes is that you will be invalidating the contents of
> the various caches more often, leading to less efficient overall
> performance.  The same argument could also be made for the VM system if
> the system is under memory pressure.

OK, thanks for the explanation. This makes sense.

> On the other hand, a higher HZ should create a system which runs a bit
> smoother for interactive programs.  And, as you point out, it is necessary
> for good timing in emulators / simulators / dummynet.

Wel, necessary might be an overstatement but seeing as the overhead of the
syscalls decreased this much, it would mean a few more frames per second,
yes.

> In short, I don't think the issue has been discussed much, partially
> because it's so easy for those who want hz=1000 to just edit loader.conf.
> If you want to propose that we switch to hz=1000 by default:

Nah, I'll leave that to someone who has some more expertise in writing
benchmarks etc.

--Stijn

-- 
"Computer games don't affect kids; I mean if Pac-Man affected us as kids,
we'd all be running around in darkened rooms, munching magic pills and
listening to repetitive electronic music."
-- Kristian Wilson, Nintendo, Inc., 1989



msg38473/pgp0.pgp
Description: PGP signature


Re: maxusers and random system freezes

2002-12-04 Thread Varshavchick Alexander
On Wed, 4 Dec 2002, Terry Lambert wrote:

> Varshavchick Alexander wrote:
> > Can it be so that kernel maxusers=768 value being more than 512 leads to
> > spontaneous system freezes which can take up to several hours when the
> > system is just sleeping (only replying to ping) and doing nothing else,
> > not allowing to telnet or anything. The system is 4.5-STABLE with much RAM
> > (4 Gb) and the box has a heavy enough traffic so a bunch of other kernel
> > options have been increased:
>
> [ ...  settings ... ]
>
> With these settings, and that much physical RAM, you should set
> your KVA space to 3G (the default is 2G); have you?
>
> Most likely, you are running out of KVA space for mappings.

No, I didn't do it, and I'm not sure how to perform it, can you please
advise? Thanks a lot!

>
> -- Terry
>



Alexander Varshavchick, Metrocom Joint Stock Company
Phone: (812)118-3322, 118-3115(fax)




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: maxusers and random system freezes

2002-12-04 Thread Terry Lambert
Varshavchick Alexander wrote:
> Can it be so that kernel maxusers=768 value being more than 512 leads to
> spontaneous system freezes which can take up to several hours when the
> system is just sleeping (only replying to ping) and doing nothing else,
> not allowing to telnet or anything. The system is 4.5-STABLE with much RAM
> (4 Gb) and the box has a heavy enough traffic so a bunch of other kernel
> options have been increased:

[ ...  settings ... ]

With these settings, and that much physical RAM, you should set
your KVA space to 3G (the default is 2G); have you?

Most likely, you are running out of KVA space for mappings.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Terry Lambert
Stijn Hoop wrote:
> On Mon, Dec 02, 2002 at 11:49:03AM -0600, Mike Silbersack wrote:
> > The time select() takes should be directly related to your system's hz
> > setting.  The default for FreeBSD is 100, which means that the interrupt
> > timer will fire every 10ms.  If you want to play with that, edit
> > /etc/sysctl.conf and set kern.hz="1000", which should give you 1 ms
> > accuracy.
> 
> With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am
> indeed seeing much better times on this 'benchmark'. See attached log. Not
> only the _select_sleep method benefits from this. What are the reasons *not*
> to do this?

Increased context switch overhead.


> > As to why Linux may appear "better"... I believe that Linux defaults to
> > hz=100, but that the default switched to hz=1000 sometime in the recent
> > past.
> 
> And why don't we do the same? (I suspect this is related to the question
> above :)

Increased context switch overhead.


> > To answer your final question:  Sleep accuracy doesn't matter to most
> > applications, but I'm sure counterexamples could be found.
> 
> Such as emulators :)

Actually, for the case you are talking about, your emulator should
be using aggregate instead of discrete timeouts, and you would not
be having a problem.  It's not useful to do 100 1ms timeouts to
achieve a  100ms timeout, when you can ask for a single 100ms
timeout.  I would count this as a bug in your emulator.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Mike Silbersack


On Wed, 4 Dec 2002, Stijn Hoop wrote:

> With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am
> indeed seeing much better times on this 'benchmark'. See attached log. Not
> only the _select_sleep method benefits from this. What are the reasons *not*
> to do this?
>
> > As to why Linux may appear "better"... I believe that Linux defaults to
> > hz=100, but that the default switched to hz=1000 sometime in the recent
> > past.
>
> And why don't we do the same? (I suspect this is related to the question
> above :)

Well, it's generally believed that in the common case (around 100
processes, and/or with well behaved processes that voluntarily give up
their timeslice) that 100 context switches per second is enough for
smooth performance.  Whether this is true or not as you hit 500+ processes
on a busy server is unknown, I don't believe that anyone has done
benchmarking.  One argument against more frequent context switches when
you have < 100 processes is that you will be invalidating the contents of
the various caches more often, leading to less efficient overall
performance.  The same argument could also be made for the VM system if
the system is under memory pressure.

On the other hand, a higher HZ should create a system which runs a bit
smoother for interactive programs.  And, as you point out, it is necessary
for good timing in emulators / simulators / dummynet.

In short, I don't think the issue has been discussed much, partially
because it's so easy for those who want hz=1000 to just edit loader.conf.
If you want to propose that we switch to hz=1000 by default:

1.  Make a list of applications / setups that benefit from hz=1000.
2.  Wait until after 5.0-release is out the door.
3.  Pose your question on -arch.

Good luck. :)

Mike "Silby" Silbersack

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Need to override KRNLCONFDIR variable in command line of make (file /usr/src/Makefile.inc1).

2002-12-04 Thread Ruslan Ermilov
On Tue, Dec 03, 2002 at 10:54:28PM +0300, Oleg Sharoiko wrote:
> 
> On Tue, 3 Dec 2002, Ruslan Ermilov wrote:
> 
> RE> KRNLCONFDIR shouldn't be overridden -- we already provide (undocumented)
> RE> user-redefineable KERNCONFDIR which should be used in cases like this.
> RE> KRNLCONFDIR, on the other hand, is dependent on src/ used, and should
> RE> NOT be overridden.
> 
> That's in -CURRENT, are there any plans on merging it into -STABLE ?
> 
Done (merged).


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age



msg38469/pgp0.pgp
Description: PGP signature


maxusers and random system freezes

2002-12-04 Thread Varshavchick Alexander
Hi people,

Can it be so that kernel maxusers=768 value being more than 512 leads to
spontaneous system freezes which can take up to several hours when the
system is just sleeping (only replying to ping) and doing nothing else,
not allowing to telnet or anything. The system is 4.5-STABLE with much RAM
(4 Gb) and the box has a heavy enough traffic so a bunch of other kernel
options have been increased:

options SHMMAXPGS=262144#max amount of shared mem. pages
options SHMMNI=256  #max number of shared memory ident if.
options SHMSEG=256  #max shared mem.segs per process
options MSGSEG=32767#max num. of mes.segments in system
options MSGSSZ=32   #size of msg-seg. MUST be power of 2
options MSGMNB=65535#max char. per message queue
options MSGTQL=2046 #max amount of msgs in system
options SEMMNU=256  #number of semaphore UNDO structures
options SEMMNS=1024 #number of semaphores in system
options SEMMNI=520  #number of semaphore indentifiers
options SEMUME=100  #number of UNDO keys
options SEMMSL=256  # max number of semaphores per id
options SEMOPM=256  # max number of operations per semop call

Or what else can be causing such system crashes? Any help is greatly
appreciated!

Regards


Alexander Varshavchick, Metrocom Joint Stock Company
Phone: (812)118-3322, 118-3115(fax)





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle]

2002-12-04 Thread Stijn Hoop
On Mon, Dec 02, 2002 at 11:49:03AM -0600, Mike Silbersack wrote:
> The time select() takes should be directly related to your system's hz
> setting.  The default for FreeBSD is 100, which means that the interrupt
> timer will fire every 10ms.  If you want to play with that, edit
> /etc/sysctl.conf and set kern.hz="1000", which should give you 1 ms
> accuracy.

With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am
indeed seeing much better times on this 'benchmark'. See attached log. Not
only the _select_sleep method benefits from this. What are the reasons *not*
to do this?

> As to why Linux may appear "better"... I believe that Linux defaults to
> hz=100, but that the default switched to hz=1000 sometime in the recent
> past.

And why don't we do the same? (I suspect this is related to the question
above :)

> To answer your final question:  Sleep accuracy doesn't matter to most
> applications, but I'm sure counterexamples could be found.

Such as emulators :)

Thanks for the responses,

--Stijn

-- 
I really hate this damned machine
I wish that they would sell it.
It never does quite what I want
But only what I tell it.

Script started on Wed Dec  4 11:46:30 2002
Testing _select_sleep (x 1000), delay 3
Total time: 4004.915000 ms; unit time: 4.004915 ms; estimated overhead: 1.004915 ms

Testing _usleep_sleep (x 1000), delay 3
Total time: 4006.116000 ms; unit time: 4.006116 ms; estimated overhead: 1.006116 ms

Testing _nanosleep_sleep (x 1000), delay 3
Total time: 4007.124000 ms; unit time: 4.007124 ms; estimated overhead: 1.007124 ms

Testing _select_sleep (x 1000), delay 8
Total time: 9003.38 ms; unit time: 9.003380 ms; estimated overhead: 1.003380 ms

Testing _usleep_sleep (x 1000), delay 8
Total time: 8998.329000 ms; unit time: 8.998329 ms; estimated overhead: 0.998329 ms

Testing _nanosleep_sleep (x 1000), delay 8
Total time: 8998.352000 ms; unit time: 8.998352 ms; estimated overhead: 0.998352 ms

Testing _select_sleep (x 1000), delay 13
Total time: 14010.526000 ms; unit time: 14.010526 ms; estimated overhead: 1.010526 ms

Testing _usleep_sleep (x 1000), delay 13
Total time: 14011.579000 ms; unit time: 14.011579 ms; estimated overhead: 1.011579 ms

Testing _nanosleep_sleep (x 1000), delay 13
Total time: 14011.588000 ms; unit time: 14.011588 ms; estimated overhead: 1.011588 ms

Testing _select_sleep (x 1000), delay 18
Total time: 18999.703000 ms; unit time: 18.999703 ms; estimated overhead: 0.999703 ms

Testing _usleep_sleep (x 1000), delay 18
Total time: 19000.703000 ms; unit time: 19.000703 ms; estimated overhead: 1.000703 ms

Testing _nanosleep_sleep (x 1000), delay 18
Total time: 18998.785000 ms; unit time: 18.998785 ms; estimated overhead: 0.998785 ms

Testing _select_sleep (x 1000), delay 23
Total time: 23997.911000 ms; unit time: 23.997911 ms; estimated overhead: 0.997911 ms

Testing _usleep_sleep (x 1000), delay 23
Total time: 24007.931000 ms; unit time: 24.007931 ms; estimated overhead: 1.007931 ms

Testing _nanosleep_sleep (x 1000), delay 23
Total time: 23998.212000 ms; unit time: 23.998212 ms; estimated overhead: 0.998212 ms

Testing _select_sleep (x 1000), delay 28
Total time: 29074.207000 ms; unit time: 29.074207 ms; estimated overhead: 1.074207 ms

Testing _usleep_sleep (x 1000), delay 28
Total time: 29000.175000 ms; unit time: 29.000175 ms; estimated overhead: 1.000175 ms

Testing _nanosleep_sleep (x 1000), delay 28
Total time: 29001.373000 ms; unit time: 29.001373 ms; estimated overhead: 1.001373 ms


Script done on Wed Dec  4 11:51:27 2002



msg38468/pgp0.pgp
Description: PGP signature


Re: jail: multiple ip's

2002-12-04 Thread Marko Zec
Terry Lambert wrote:

> Tony Finch wrote:
> > [EMAIL PROTECTED] (Mike Ghunt) wrote:
> > >  Has anyone hacked the jail code to support more than one ip?
> > >Would it be wise to hack at the code to add such a feature?
> >
> > Probably the best way to address this issue is to incorporate the
> > network stack virtualization patch, then change the jail ID from
> > an IPv4 address into a network stack ID.
>
> I'm really tempted to say that the network virtualization patch
> is special purpose, and introduces a lot of overhead that would
> not be there without the network virtualization patch.

Just the contrary, the network stack virtualization concept is mostly
general-purpose oriented. The (minor) penalty of "a lot of overhead"
introduced by the patch is measurable only on loopback traffic, however
in practice the NIC media sets the limit on traffic throughput, so in
most cases no performance degradation can be observed. Some measurement
results can be found at
http://www.tel.fer.hr/zec/papers/zec-bsdconeurope-2002.pdf

On the other hand, I agree with you that this stuff is still in early
experimental phase, but the patch has been proven to work reliably with
4.7-RELEASE as announced, with a -CURRENT version to follow soon...

Marko


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: jail: multiple ip's

2002-12-04 Thread Terry Lambert
Note: Cross-post and "Reply-To:" of freebsd-net!

Tony Finch wrote:
> [EMAIL PROTECTED] (Mike Ghunt) wrote:
> >  Has anyone hacked the jail code to support more than one ip?
> >Would it be wise to hack at the code to add such a feature?
> 
> Probably the best way to address this issue is to incorporate the
> network stack virtualization patch, then change the jail ID from
> an IPv4 address into a network stack ID.

I'm really tempted to say that the network virtualization patch
is special purpose, and introduces a lot of overhead that would
not be there without the network virtualization patch.

It's the type of thing, IMO, that should be possible for an
experimenter, but not integrated into the FreeBSD kernel itself.

I'm also alarmed at the mbuf header bloat, in general, for some
very specific and not very common uses, including the pushing up
of the full Ethernet packet.  The only use I can see for that
particular trick is supporting VIPs on cards in promiscuous mode,
which normally would not support VIPs (e.g. the Intele Gigabit
ethernet car supports 16 of them) and did not support abusing the
multicast mask to obtain VIPs (e.g. the FXP driver method).

Finally, with the integration of the IPSEC stuff from OpenBSD that
Sam Leffler has been doing, I worry that the IPSEC implementation
is not going to be fixed.  Specifically, the IPSEC data is cloned
per socket opened in IPv4, if IPSEC is in the kernel at all, and
it bloats the per connection memory cost considerably, even if the
IPSEC is never used, or the security association never varies from
the default.

It's all well and good to have an IPSEC axe to grind (8-)) relative
to the SSL stuff, but it's not a good idea to grind it against
people's memory footprint unnecessarily.

Note that Sam did not introduce this problem, KAME did, with the
poor IPSEC integration into IPv4 (it looks very much like an
afterthought), but his addition to the code perpetuates it.

There are some things it's important to integrate/fix so that they
are always there, there are some things which should be optioned,
and there are some things which should remain in academia, until
they are standardized, forcing them on everyone.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Terry Lambert
Rashim Gupta wrote:
> I have a machine to which I remotely log in and do
> kernel programming. It has two kernel versions - one is WORKING and the
> other is TEST - the one I am presently working on. Is it possible that
> the bootloader tries to first load TEST but in case TEST panics then
> it loads the WORKING version of kernel without user intervention ? My
> initial guess would be to use loader scripts. Any suggestions?

You want the FORTH "bootnext" replacement that Jon Mini and James
Harris worked on.

This replaces the "nextboot" program, which was broken when FreeBSD
went to the FORTH bootloader during the a.out->ELF transition.

-- Terry


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: jail: multiple ip's

2002-12-04 Thread Tony Finch
[EMAIL PROTECTED] (Mike Ghunt) wrote:
>  Has anyone hacked the jail code to support more than one ip?
>Would it be wise to hack at the code to add such a feature?

Probably the best way to address this issue is to incorporate the
network stack virtualization patch, then change the jail ID from
an IPv4 address into a network stack ID.

Tony.
-- 
f.a.n.finch  <[EMAIL PROTECTED]>  http://dotat.at/
FISHER GERMAN BIGHT: SOUTHEAST BACKING EAST 5 TO 7, PERHAPS GALE 8 LATER IN
FISHER. RAIN. MODERATE.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: booting multiple kernels

2002-12-04 Thread Peter Pentchev
On Tue, Dec 03, 2002 at 08:52:07PM -0800, Nate Lawson wrote:
> On Tue, 3 Dec 2002, Rashim Gupta wrote:
> > I have a machine to which I remotely log in and do
> > kernel programming. It has two kernel versions - one is WORKING and the
> > other is TEST - the one I am presently working on. Is it possible that
> > the bootloader tries to first load TEST but in case TEST panics then
> > it loads the WORKING version of kernel without user intervention ? My
> > initial guess would be to use loader scripts. Any suggestions?
> 
> man 8 reboot, esp. -k option.

Errr... if I'm reading the original message right, then reboot -k is
exactly the opposite of what Rashim is asking for - if the wording of
the -stable manual page is correct.  According to the manual page, if we
try reboot -k TEST, and it fails, the system will keep trying to boot
TEST until somebody walks up to the machine and manually changes the
booted kernel by interrupting the loader.  I believe this is not quite
what Rashim asked for...

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
.siht ekil ti gnidaer eb d'uoy ,werbeH ni erew ecnetnes siht fI



msg38463/pgp0.pgp
Description: PGP signature


Re: jail: multiple ip's

2002-12-04 Thread Henk Wevers
Just take a look at http://garage.freebsd.pl
Works fine with 4.7RELEASE

Henk

Terry Lambert wrote:

Mike Ghunt wrote:


 Has anyone hacked the jail code to support more than one ip?



Yes.  There was a patch posted by someone about 9 months ago.



Would it be wise to hack at the code to add such a feature?



Didn't seem to hurt the person who did it any.  8-).

-- Terry


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message