[Linux-streams] LiS-2.17.A
David Grothe
Fri, 23 Jan 2004 10:48:49 -0800

I am leaving for a week in Florida in about 5 hours. I wanted to post the partially complete 
LiS-2.17 for the more adventurous of you to play with -- or not.

It compiles on 2.4 and 2.6. It has the 12/20 dev_t implementation which compiles on both 2.4 and 
2.6 and seems to work on 2.4.

In order to get the dev_t stuff to work it was necessary to define away the kernel's symbol 
"dev_t". This is done in linux-mdep.h which is included from stream.h. The consequence of this 
is that your driver now needs to include stream.h before including any kernel include file, 
including especially module.h or modversions.h. The LiS built-in drivers do this with seemingly 
no problem.

What is NOT working:

I haven't figured out how to get LiS put together as a ".ko" module for the 2.6 kernel, so I 
have not been able to load it and test it yet on 2.6. There is a cookbook for this at 
http://www-106.ibm.com/developerworks/linux/library/l-inside.html?ca=dgr-lnxw2oTowardLinux26 but 
I have not been able to get it to work yet.

In 2.4 the fstat() function will return the st_rdev variable as an 8/8 dev_t instead of the LiS 
(or 2.6 kernel) 12/20. If you have programs that use fstat() to discover the minor device number 
of a clone-opened streams device then it will return incorrect information unless the minor 
device number is less than 256.

I'm not sure how this comes out with the 2.6 kernel yet. I think that the same problem will be 
there since the st_rdev field is a short. I don't think the kernel guys and the libc guys have 
this worked out yet.

-- Dave

[Linux-streams] LiS-2.17.B
Dave Grothe
Wed, 25 Feb 2004 09:49:08 -0800

Here is another version of LiS-2.17.  Let's consider it an Alpha version for 
the time being.  In order to use it you have to recompile your drivers 
against the header files in this version.

If any of you are wanting to submit any patches for the official 2.17 this 
would be a good version to patch against.  For example, Eugene might have a 
cosmetic clean-up patch for Matt's performance enhancements.  Brian and/or 
John may or may not want to submit a patch that brings some error returns 
into conformance with the Unix spec.  If you are intending to do something 
like this please let me know so that I will know to hold off until I get 
your patch.

Here are the highlights of the changes for LiS-2.17: 

Work on 2.6 compatibility.  I haven't done a 2.6 build lately, so don't 
bother to try. 
Extended 12/20 bit device ids. 
Routines makedevice(), getmajor() and getminor() now defined within LiS. 
LiS takes over definition of the symbol dev_t from the kernel.  Inside 
LiS a dev_t always means a 12/20 device id. 
Delete a bunch of old 2.2 code -- no longer supported. 
Introduce the file < sys/LiS/module.h> to get include file ordering 
correct for loadable drivers/modules.  Include this file first instead 
of < linux/module.h> and < linux/modversions.h>.  See LiS drivers for 
examples.  The taking over of dev_t figured into the necessity for this 
change. 
Better technique for binding queue runners to CPUs. 
Defer adding a queue to the list of queues to run (qenable()) if it is 
already running.  This change made a large difference in speed and 
efficiency of CPU usage in multi-cpu systems when a single queue 
was high-contention. 
DMA sync direction problem fixed. 
Lock queues using a semaphore instead of a spin lock.  This allows 
service procedures to call kernel routines that sleep (not recommended, 
but sometimes unavoidable).  This will be important for 2.6. 
Semaphore protection for module loading. 
Space in LiS semaphore and lock structures for embedded kernel 
structures enlarged to accommodate 2.6 structure sizes.  I recommend 
that drivers use the lis_sem_alloc() form instead of embedding LiS locks 
in their own structures.  The allocators always allocate according to 
the size of the kernel's structures. 
Add a kernel cache for stream head structures and allocated locks.  
Can't say that I saw any performance improvement as a result. 
Align LiS allocated memory on cache boundary. 
Incorporate Brian's message type renumbering for general compatibility 
with other STREAMS. 
Add the "major-index" field to the node definition in the Config file 
per John's patch. 
I_[P]LINK and I_[P]UNLINK ignore errors at stream head that might have 
been set via an M_ERROR. 
Lock and semaphore free/destroy routines check for NULL ptr so that 
drivers don't have to be too careful in calling them.  Note that these 
routines both return a NULL ptr to make it easy for drivers to zero out 
the pointer being passed in.

[Linux-streams] LiS-2.17
Dave Grothe
Sat, 27 Mar 2004 09:10:42 -0800

I have published it on the ftp site as LiS-2.17.0. Please refer to mail archives for the list of 
changes.

The html documentation is lagging behind a bit.

It is still not quite compatible with 2.6 kernels, but that should happen before too much 
longer.

-- Dave