Re: sleeping instead of ENOBUFS on write to socket?

2011-05-28 Thread David Laight
On Fri, May 27, 2011 at 09:32:02PM -0400, Thor Lancelot Simon wrote:
 
 What do the SCTP implementations out there in the world use now?  SOCK_DGRAM,
 SOCK_SEQPACKET, or something else?  That might be the only other prior
 use of the seqpacket sockets.

For some reason I can't remember what SCTP uses - even having written code that
uses it! (at work we have enough stubs to run the SCTP code 'stolen' from 
freebsd
in the windows kernel - for in-kernel use).

However the major 'prior use' of SOCK_SEQPACKET would be ISO transport.

David

-- 
David Laight: da...@l8s.co.uk


Re: kmem-pool-uvm

2011-05-28 Thread Lars Heidieker
Hi,

On 05/26/11 03:51, YAMAMOTO Takashi wrote:
 hi,
 
 Findings after having run the system for a while and having about 1.1gig
 in the pool(9)s:
 Option a: about 3 allocated kernel map_entries (not in the map but
 allocated)
 Option b: about 10 allocated boundary tags.
 Option c: about 40 allocated boundary tags.

 With boundary tags beeing about half the size of vm_map_entries the vmem
 version uses slightly more memory but not so much.
 
 why did you use different numbers for heap_va_arena's qcache_max
 (8 * PAGE_SIZE) and VMK_VACACHE_MAP_QUANTUM (32 * PAGE_SIZE)?
 
 if i read your patches correctly, the number of map entries/boundary tags
 will be smaller if these constants are bigger, right?
 

I choose the 8 * PAGE_SIZE for qcache_max as the quantum caches are
pool_caches, so if we have only two or three allocation of a particular
size made by different cpus we have 2 or 3 times the va in the pool
caches, with a lot va wasted.
This might or might not be a point but was the motivation to start with
a lower value.
If the size is increased the amount of boundary tags goes down a bit
further, these caches very much have an influence on the control
structure allocation count.

One could argument that the vmk_vacaches should be pool_caches as well
(I tried that, no problem to switch them) for scalability reasons, then
they will have to deal with the same wastage argument.
Currently having these as pool_caches doesn't buy us much, as they have
to get backed with physical memory, which is a process most likely
serializing the allocation anyway... But this is no different between
the two options ;-)

 Both versions use a modified kmem(9) that interfaces either with vmem or
 the extended kva caches, which has page_aligned memory for allocations
 of page_size and larger and cache_line aligned allocations for
 allocations between cache_line size and page_size.
 This should resolve some problems xen-kernels do have.
 
 does the original (solaris) version of kmem_alloc provide aligned
 allocations?
 

Yes it does, it switches to cache_line size for alignment for
allocations = cache_line size and to page_size alignment for
allocations = page_size.

 YAMAMOTO Takashi
 

Lars


Build and include hdaudio hdafg as modules

2011-05-28 Thread Paul Goyette
Now that Jared has modularized the hdaudio and hdafg drivers, is there 
any reason that we should not be building the modules by default?


And is there any reason why they should not be removed from i386/GENERIC 
and amd64/GENERIC (and, of course, added to i386/MONOLITHIC)?


Patch attached.

-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-Index: distrib/sets/lists/modules/mi
===
RCS file: /cvsroot/src/distrib/sets/lists/modules/mi,v
retrieving revision 1.21
diff -u -p -r1.21 mi
--- distrib/sets/lists/modules/mi   26 Feb 2011 18:07:15 -  1.21
+++ distrib/sets/lists/modules/mi   28 May 2011 13:18:18 -
@@ -52,6 +52,10 @@
 ./@MODULEDIR@/flash/flash.kmod base-kernel-modules kmod
 ./@MODULEDIR@/fss  base-kernel-modules kmod
 ./@MODULEDIR@/fss/fss.kmod base-kernel-modules kmod
+./@MODULEDIR@/hdafgbase-kernel-modules kmod
+./@MODULEDIR@/hdafg/hdafg.kmod base-kernel-modules kmod
+./@MODULEDIR@/hdaudio  base-kernel-modules kmod
+./@MODULEDIR@/hdaudio/hdaudio.kmod base-kernel-modules kmod
 ./@MODULEDIR@/hfs  base-kernel-modules kmod
 ./@MODULEDIR@/hfs/hfs.kmod base-kernel-modules kmod
 ./@MODULEDIR@/kernfs   base-kernel-modules kmod
Index: sys/arch/amd64/conf/GENERIC
===
RCS file: /cvsroot/src/sys/arch/amd64/conf/GENERIC,v
retrieving revision 1.318
diff -u -p -r1.318 GENERIC
--- sys/arch/amd64/conf/GENERIC 1 Apr 2011 12:11:17 -   1.318
+++ sys/arch/amd64/conf/GENERIC 28 May 2011 13:18:30 -
@@ -992,8 +992,8 @@ opl*at fms?
 opl*   at sv?
 
 # High Definition Audio
-hdaudio*   at pci? dev ? function ?# High Definition Audio
-hdafg* at hdaudiobus?
+#hdaudio*  at pci? dev ? function ?# High Definition Audio
+#hdafg*at hdaudiobus?
 
 # Audio support
 audio* at audiobus?
Index: sys/arch/i386/conf/GENERIC
===
RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.1032
diff -u -p -r1.1032 GENERIC
--- sys/arch/i386/conf/GENERIC  28 May 2011 13:01:49 -  1.1032
+++ sys/arch/i386/conf/GENERIC  28 May 2011 13:18:38 -
@@ -1369,8 +1369,8 @@ opl*  at yds?
 opl*   at ym?
 
 # High Definition Audio
-hdaudio*   at pci? dev ? function ?# High Definition Audio
-hdafg* at hdaudiobus?
+#hdaudio*  at pci? dev ? function ?# High Definition Audio
+#hdafg*at hdaudiobus?
 
 # Audio support
 audio* at audiobus?
Index: sys/arch/i386/conf/MONOLITHIC
===
RCS file: /cvsroot/src/sys/arch/i386/conf/MONOLITHIC,v
retrieving revision 1.15
diff -u -p -r1.15 MONOLITHIC
--- sys/arch/i386/conf/MONOLITHIC   6 Mar 2011 17:08:26 -   1.15
+++ sys/arch/i386/conf/MONOLITHIC   28 May 2011 13:18:45 -
@@ -66,3 +66,7 @@ pseudo-device putter  # for puffs and pu
 pseudo-device  pad # pseudo audio device driver
 
 pseudo-device  dm  # device-mapper device driver
+
+# High Definition Audio
+hdaudio*   at pci? dev ? function ?# High Definition Audio  
+hdafg* at hdaudiobus?
Index: sys/modules/Makefile
===
RCS file: /cvsroot/src/sys/modules/Makefile,v
retrieving revision 1.70
diff -u -p -r1.70 Makefile
--- sys/modules/Makefile14 Apr 2011 15:45:27 -  1.70
+++ sys/modules/Makefile28 May 2011 13:18:50 -
@@ -23,6 +23,8 @@ SUBDIR+=  ffs
 SUBDIR+=   filecore
 SUBDIR+=   flash
 SUBDIR+=   fss
+SUBDIR+=   hdafg
+SUBDIR+=   hdaudio
 SUBDIR+=   hfs
 SUBDIR+=   kernfs
 SUBDIR+=   ksem