Re: No Livelock on 2 Oct 2010 current

2010-10-08 Thread Philip Guenther
On 10/4/10, David Gwynne  wrote:
...
> this restores the visibility of network livelocks to systat.
>
> anyone object? if not i'll commit it tomorrow morning around 10am
> in a GMT+10 timezeon.

I like it, with one micro suggestion:

...
> --- sbin/sysctl/sysctl.c  19 Aug 2010 18:14:14 -  1.173
> +++ sbin/sysctl/sysctl.c  5 Oct 2010 01:20:59 -
> @@ -447,6 +447,9 @@ parse(char *string, int flags)
>   case KERN_CONSDEV:
>   special |= CHRDEV;
>   break;
> + case KERN_NETLIVELOCKS:
> + special |= UNSIGNED;
> + break;
>   }
>   break;
>

The KERN_NETLIVELOCKS case could be joined with the KERN_HOSTID and
KERN_ARND cases earlier in the file.  That switch() isn't in pure
numerical order, so there's no need to put this last, separate from
the other "special |= UNSIGNED" cases.

ok guenther@



Re: No Livelock on 2 Oct 2010 current

2010-10-05 Thread Kenneth R Westerback
On Tue, Oct 05, 2010 at 11:28:50AM +1000, David Gwynne wrote:
> On Mon, Oct 04, 2010 at 10:41:15PM +, Stuart Henderson wrote:
> > On 2010-10-04, Insan Praja SW  wrote:
> > > I can't see any livelocks. I'm aware of new algorithm on mclgeti got  
> > > something to do with this, I just want to confirm this. If this systat  
> > > output tells me the truth, well that just a huge achievement.
> > 
> > # pstat -d u mcllivelocks
> > 
> > You will probbaly see more livelocks than before (the detection is more
> > sensitive), but the effect on network traffic should be smaller.
> > 
> 
> this restores the visibility of network livelocks to systat.
> 
> anyone object? if not i'll commit it tomorrow morning around 10am
> in a GMT+10 timezeon.

No objections from me. ok k...@.

 Ken

> 
> Index: sbin/sysctl/sysctl.c
> ===
> RCS file: /cvs/src/sbin/sysctl/sysctl.c,v
> retrieving revision 1.173
> diff -u -p -r1.173 sysctl.c
> --- sbin/sysctl/sysctl.c  19 Aug 2010 18:14:14 -  1.173
> +++ sbin/sysctl/sysctl.c  5 Oct 2010 01:20:59 -
> @@ -447,6 +447,9 @@ parse(char *string, int flags)
>   case KERN_CONSDEV:
>   special |= CHRDEV;
>   break;
> + case KERN_NETLIVELOCKS:
> + special |= UNSIGNED;
> + break;
>   }
>   break;
>  
> Index: sys/kern/kern_sysctl.c
> ===
> RCS file: /cvs/src/sys/kern/kern_sysctl.c,v
> retrieving revision 1.193
> diff -u -p -r1.193 kern_sysctl.c
> --- sys/kern/kern_sysctl.c23 Sep 2010 13:24:22 -  1.193
> +++ sys/kern/kern_sysctl.c5 Oct 2010 01:21:02 -
> @@ -110,6 +110,7 @@ extern int nselcoll, fscale;
>  extern struct disklist_head disklist;
>  extern fixpt_t ccpu;
>  extern  long numvnodes;
> +extern u_int mcllivelocks;
>  
>  extern void nmbclust_update(void);
>  
> @@ -585,6 +586,8 @@ kern_sysctl(int *name, u_int namelen, vo
>   else
>   dev = NODEV;
>   return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
> + case KERN_NETLIVELOCKS:
> + return (sysctl_rdint(oldp, oldlenp, newp, mcllivelocks));
>   default:
>   return (EOPNOTSUPP);
>   }
> Index: sys/sys/sysctl.h
> ===
> RCS file: /cvs/src/sys/sys/sysctl.h,v
> retrieving revision 1.106
> diff -u -p -r1.106 sysctl.h
> --- sys/sys/sysctl.h  19 Aug 2010 18:14:13 -  1.106
> +++ sys/sys/sysctl.h  5 Oct 2010 01:21:03 -
> @@ -190,7 +190,8 @@ struct ctlname {
>  #define  KERN_FILE2  73  /* struct: file entries */
>  #define  KERN_RTHREADS   74  /* kernel rthreads support 
> enabled */
>  #define  KERN_CONSDEV75  /* dev_t: console terminal 
> device */
> -#define  KERN_MAXID  76  /* number of valid kern ids */
> +#define  KERN_NETLIVELOCKS   76  /* int: number of network 
> livelocks */
> +#define  KERN_MAXID  77  /* number of valid kern ids */
>  
>  #define  CTL_KERN_NAMES { \
>   { 0, 0 }, \
> @@ -269,6 +270,7 @@ struct ctlname {
>   { "file2", CTLTYPE_STRUCT }, \
>   { "rthreads", CTLTYPE_INT }, \
>   { "consdev", CTLTYPE_STRUCT }, \
> + { "netlivelocks", CTLTYPE_INT }, \
>  }
>  
>  /*
> Index: usr.bin/systat/mbufs.c
> ===
> RCS file: /cvs/src/usr.bin/systat/mbufs.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 mbufs.c
> --- usr.bin/systat/mbufs.c23 Sep 2010 10:49:55 -  1.29
> +++ usr.bin/systat/mbufs.c5 Oct 2010 01:21:04 -
> @@ -41,6 +41,7 @@ struct mclpool_info {
>  int mclpool_count = 0;
>  int mbpool_index = -1;
>  struct pool mbpool;
> +u_int mcllivelocks = 0;
>  
>  /* interfaces */
>  static int num_ifs;
> @@ -198,6 +199,15 @@ read_mb(void)
>   int i, p, nif, ret = 1;
>   size_t size;
>  
> + mib[0] = CTL_KERN;
> + mib[1] = KERN_NETLIVELOCKS;
> + size = sizeof(mcllivelocks);
> + if (sysctl(mib, 2, &mcllivelocks, &size, NULL, 0) < 0 &&
> + errno != EOPNOTSUPP) {
> + error("sysctl(KERN_NETLIVELOCKS)");
> + goto exit;
> + }
> +
>   num_disp = 0;
>   if (getifaddrs(&ifap)) {
>   error("getifaddrs: %s", strerror(errno));
> @@ -341,6 +351,7 @@ showmbuf(struct if_info *ifi, int p, int
>   print_fld_str(FLD_MB_IFACE, ifi->name);
>  
>   if (p == -1 && ifi == interfaces) {
> + print_fld_uint(FLD_MB_LLOCKS, mcllivelocks);
>   print_fld_size(FLD_MB_MSIZE, mbpool.pr_size);
>   print_fld_size(FLD_MB_MALIVE, mbpool.pr_nget - mbpool.pr_nput);
>   print_fld_size(FLD_MB_MHWM, mbpool.pr_hiwat);
> @@ -349,8 +360,6 @@ showmbuf(struct if_info *if

Re: No Livelock on 2 Oct 2010 current

2010-10-04 Thread David Gwynne
On Mon, Oct 04, 2010 at 10:41:15PM +, Stuart Henderson wrote:
> On 2010-10-04, Insan Praja SW  wrote:
> > I can't see any livelocks. I'm aware of new algorithm on mclgeti got  
> > something to do with this, I just want to confirm this. If this systat  
> > output tells me the truth, well that just a huge achievement.
> 
> # pstat -d u mcllivelocks
> 
> You will probbaly see more livelocks than before (the detection is more
> sensitive), but the effect on network traffic should be smaller.
> 

this restores the visibility of network livelocks to systat.

anyone object? if not i'll commit it tomorrow morning around 10am
in a GMT+10 timezeon.

Index: sbin/sysctl/sysctl.c
===
RCS file: /cvs/src/sbin/sysctl/sysctl.c,v
retrieving revision 1.173
diff -u -p -r1.173 sysctl.c
--- sbin/sysctl/sysctl.c19 Aug 2010 18:14:14 -  1.173
+++ sbin/sysctl/sysctl.c5 Oct 2010 01:20:59 -
@@ -447,6 +447,9 @@ parse(char *string, int flags)
case KERN_CONSDEV:
special |= CHRDEV;
break;
+   case KERN_NETLIVELOCKS:
+   special |= UNSIGNED;
+   break;
}
break;
 
Index: sys/kern/kern_sysctl.c
===
RCS file: /cvs/src/sys/kern/kern_sysctl.c,v
retrieving revision 1.193
diff -u -p -r1.193 kern_sysctl.c
--- sys/kern/kern_sysctl.c  23 Sep 2010 13:24:22 -  1.193
+++ sys/kern/kern_sysctl.c  5 Oct 2010 01:21:02 -
@@ -110,6 +110,7 @@ extern int nselcoll, fscale;
 extern struct disklist_head disklist;
 extern fixpt_t ccpu;
 extern  long numvnodes;
+extern u_int mcllivelocks;
 
 extern void nmbclust_update(void);
 
@@ -585,6 +586,8 @@ kern_sysctl(int *name, u_int namelen, vo
else
dev = NODEV;
return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
+   case KERN_NETLIVELOCKS:
+   return (sysctl_rdint(oldp, oldlenp, newp, mcllivelocks));
default:
return (EOPNOTSUPP);
}
Index: sys/sys/sysctl.h
===
RCS file: /cvs/src/sys/sys/sysctl.h,v
retrieving revision 1.106
diff -u -p -r1.106 sysctl.h
--- sys/sys/sysctl.h19 Aug 2010 18:14:13 -  1.106
+++ sys/sys/sysctl.h5 Oct 2010 01:21:03 -
@@ -190,7 +190,8 @@ struct ctlname {
 #defineKERN_FILE2  73  /* struct: file entries */
 #defineKERN_RTHREADS   74  /* kernel rthreads support 
enabled */
 #defineKERN_CONSDEV75  /* dev_t: console terminal 
device */
-#defineKERN_MAXID  76  /* number of valid kern ids */
+#defineKERN_NETLIVELOCKS   76  /* int: number of network 
livelocks */
+#defineKERN_MAXID  77  /* number of valid kern ids */
 
 #defineCTL_KERN_NAMES { \
{ 0, 0 }, \
@@ -269,6 +270,7 @@ struct ctlname {
{ "file2", CTLTYPE_STRUCT }, \
{ "rthreads", CTLTYPE_INT }, \
{ "consdev", CTLTYPE_STRUCT }, \
+   { "netlivelocks", CTLTYPE_INT }, \
 }
 
 /*
Index: usr.bin/systat/mbufs.c
===
RCS file: /cvs/src/usr.bin/systat/mbufs.c,v
retrieving revision 1.29
diff -u -p -r1.29 mbufs.c
--- usr.bin/systat/mbufs.c  23 Sep 2010 10:49:55 -  1.29
+++ usr.bin/systat/mbufs.c  5 Oct 2010 01:21:04 -
@@ -41,6 +41,7 @@ struct mclpool_info {
 int mclpool_count = 0;
 int mbpool_index = -1;
 struct pool mbpool;
+u_int mcllivelocks = 0;
 
 /* interfaces */
 static int num_ifs;
@@ -198,6 +199,15 @@ read_mb(void)
int i, p, nif, ret = 1;
size_t size;
 
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_NETLIVELOCKS;
+   size = sizeof(mcllivelocks);
+   if (sysctl(mib, 2, &mcllivelocks, &size, NULL, 0) < 0 &&
+   errno != EOPNOTSUPP) {
+   error("sysctl(KERN_NETLIVELOCKS)");
+   goto exit;
+   }
+
num_disp = 0;
if (getifaddrs(&ifap)) {
error("getifaddrs: %s", strerror(errno));
@@ -341,6 +351,7 @@ showmbuf(struct if_info *ifi, int p, int
print_fld_str(FLD_MB_IFACE, ifi->name);
 
if (p == -1 && ifi == interfaces) {
+   print_fld_uint(FLD_MB_LLOCKS, mcllivelocks);
print_fld_size(FLD_MB_MSIZE, mbpool.pr_size);
print_fld_size(FLD_MB_MALIVE, mbpool.pr_nget - mbpool.pr_nput);
print_fld_size(FLD_MB_MHWM, mbpool.pr_hiwat);
@@ -349,8 +360,6 @@ showmbuf(struct if_info *ifi, int p, int
 #if NOTYET
print_fld_uint(FLD_MB_RXDELAY, ifi->data.ifi_rxdelay);
print_fld_uint(FLD_MB_TXDELAY, ifi->data.ifi_txdelay);
-   if (ifi->data.ifi_livelocks)
-   print_fld_size(FLD_MB_LLOCKS, ifi->data.ifi_

Re: No Livelock on 2 Oct 2010 current

2010-10-04 Thread Stuart Henderson
On 2010-10-04, Insan Praja SW  wrote:
> I can't see any livelocks. I'm aware of new algorithm on mclgeti got  
> something to do with this, I just want to confirm this. If this systat  
> output tells me the truth, well that just a huge achievement.

# pstat -d u mcllivelocks

You will probbaly see more livelocks than before (the detection is more
sensitive), but the effect on network traffic should be smaller.



No Livelock on 2 Oct 2010 current

2010-10-04 Thread Insan Praja SW

Hi Misc@,
On this machine;

OpenBSD 4.8-current (GENERIC.MP) #5: Sat Oct  2 21:06:09 WIT 2010
r...@border-rf.mygreenlinks.net:/usr/src/sys/arch/i386/compile/GENERIC.MP
RTC BIOS diagnostic error f
cpu0: Intel(R) Xeon(R) CPU X3220 @ 2.40GHz ("GenuineIntel" 686-class) 2.41  
GHz
cpu0:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,S

SE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM
real mem  = 1069002752 (1019MB)
avail mem = 1041489920 (993MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 03/26/07, SMBIOS rev. 2.4 @  
0x3fbe4000 (42 entries)
bios0: vendor Intel Corporation version  
"S3000.86B.02.00.0054.061120091710" date 06/11/2009

bios0: Intel S3000AH
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT SLIC FACP APIC WDDT HPET MCFG ASF! SSDT SSDT SSDT SSDT  
SSDT HEST BERT ERST EINJ
acpi0: wakeup devices SLPB(S4) P32_(S4) UAR1(S1) PEX4(S4) PEX5(S4)  
UHC1(S1) UHC2(S1) UHC3(S1) UHC4(S1) EHCI(S1) AC9M(S4) AZAL(

S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 266MHz
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Xeon(R) CPU X3220 @ 2.40GHz ("GenuineIntel" 686-class) 2.41  
GHz
cpu1:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,S

SE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Xeon(R) CPU X3220 @ 2.40GHz ("GenuineIntel" 686-class) 2.41  
GHz
cpu2:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,S

SE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Xeon(R) CPU X3220 @ 2.40GHz ("GenuineIntel" 686-class) 2.41  
GHz
cpu3:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,S

SE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM
ioapic0 at mainbus0: apid 5 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 5
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 4 (P32_)
acpiprt2 at acpi0: bus 1 (PEX0)
acpiprt3 at acpi0: bus -1 (PEX1)
acpiprt4 at acpi0: bus -1 (PEX2)
acpiprt5 at acpi0: bus -1 (PEX3)
acpiprt6 at acpi0: bus 2 (PEX4)
acpiprt7 at acpi0: bus 3 (PEX5)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpicpu2 at acpi0: PSS
acpicpu3 at acpi0: PSS
acpibtn0 at acpi0: SLPB
bios0: ROM list: 0xc/0x9000 0xc9000/0x1000 0xca000/0x1800  
0xcb800/0x1000

cpu0: Enhanced SpeedStep 2401 MHz: speeds: 2394, 1596 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel E7230 Host" rev 0x00
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: apic 5 int  
17 (irq 255)

pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 4 "Intel 82801G PCIE" rev 0x01: apic 5 int 17  
(irq 255)

pci2 at ppb1 bus 2
em0 at pci2 dev 0 function 0 "Intel PRO/1000 PT (82571EB)" rev 0x06: apic  
5 int 16 (irq 9), address 00:15:17:86:52:fc
em1 at pci2 dev 0 function 1 "Intel PRO/1000 PT (82571EB)" rev 0x06: apic  
5 int 17 (irq 10), address 00:15:17:86:52:fd
ppb2 at pci0 dev 28 function 5 "Intel 82801G PCIE" rev 0x01: apic 5 int 16  
(irq 255)

pci3 at ppb2 bus 3
em2 at pci3 dev 0 function 0 "Intel PRO/1000MT (82573E)" rev 0x03: apic 5  
int 17 (irq 10), address 00:15:17:49:04:0d

"Intel 82573E Serial" rev 0x03 at pci3 dev 0 function 3 not configured
"Intel 82573E KCS" rev 0x03 at pci3 dev 0 function 4 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 5 int  
23 (irq 11)
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 5 int  
19 (irq 11)
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 5 int  
18 (irq 11)
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 5 int  
16 (irq 9)
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 5 int  
23 (irq 11)

ehci0: timed out waiting for BIOS
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xe1
pci4 at ppb3 bus 4
skc0 at pci4 dev 0 function 0 "D-Link DGE-530T B1" rev 0x11, Yukon Lite  
(0x9): apic 5 int 21 (irq 11)

sk0 at skc0 port A: address 00:1c:f0:11:6c:d4
eephy0 at sk0 phy 0: 88E1011 Gigabit PHY, rev. 5
em3 at pci4 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02: apic 5  
int 22 (irq 11), address 00:07:e9:0f:44:e3

vga1 at pci4 dev 4 function 0 "ATI ES1000" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: apic 5 int 18 (irq 11)
drm0 at radeondrm0
em4 at pci4 dev 5 function 0 "Intel PRO/1000MT (82541GI)" rev 0x05: apic 5