Linux things (index to this page)

Take me to the patches

The cs89x0 ethernet device driver
A 2.4.x driver for the IBM EtherJet PC-Card NIC (cs89x0_cs)
A new, experimental 3c59x variant by Bogdan Costescu
A tool to generate 802.3x ethernet flow control frames
dev_alloc_fail: a tool for testing netdrivers under low memory conditions
Timepegs: a tool for measuring time intervals within the kernel
Intlat: A tool for measuring interrupt latency within the kernel
netdevice2.txt: A description of some changes to netdevice registration in the 2.4.0-test13pre4-ac1 kernel
zc and cyclesoak: Tools for accurately measuring system load and TCP efficiency (mainly sendfile)
cpus_allowed: A patch which allows processes to be bonded to CPUs.

Other pages

Kernel 2.4.0 scheduling latency The lowish-latency patches for kernel 2.4
waitqueues: A modest redesign of the waitqueues and wakeup mechanism
consoles: Patches to enable interrupts during console output operations.
ext3: ext3 for the 2.4 kernel.


Timepegs are a tool for precisely measuring the time interval between the execution of arbitrary pieces of code in the kernel.

The current version of timepegs is 2.4.1-pre10-1
6-March-2000 posting to LKML
26-March-2000 posting to LKML
The timepeg documentation (Documentation/timepeg.txt)
The patch against 2.4.0-test3-pre2
New patch against 2.4.0-test6 (includes schedlat)
Patch against 2.4.0-test8 (includes schedlat)
Patch against 2.4.1-pre10
Patch against 2.4.17 (Dominic Duval)
Patch against 2.4.19-pre6
The tpt (timepeg tool) tool
timepeg.c (may not be current)
timepeg.h (may not be current)

If you run SMP please read Documentation/intlat.h!  It says:

The intlat patch alters include/linux/threads.h! It changes NR_CPUS
from 32 to 2.  If you have more than two CPUs then you should change
this appropriately.


intlat is a tool for measuring how long the 2.3.xx kernel spends with
interrupts disabled. A similar tool for 2.2.xx has been developed by MontaVista.  It is at

26-March-2000 posting to lkml
The intlat documentation (Documentation/intlat.txt)
A posting to lkml which shows intlat example output
Measurements for kernel 2.3.x SCSI and IDE subsystems
The intlat source is a part of the timepeg patch, above.

The cs89x0 ethernet device driver

A driver for Cirrus Logic's CS8900 and CS8920 10 Mbit ethernet chips.  Only known to exist in IBM Etherjet cards (PnP ID 'IBM1010').

The current version of the cs89x0 driver is 2.3.49-1
3-March-2000 LKML posting
I have taken down the cs89x0 patch. It is in the official tree.

A 2.4.x driver for the IBM EtherJet PC Card NIC (cs89x0_cs)

A nasty hack to Danilo Beuche's driver which makes it work (apparently) in the 2.4.x tree.

Patch against linux-2.4.0-test1-ac5
Patch against linux-2.4.17
Danilo's page for the original driver

A high-performance variant of 2.2's 3c59x.c

This driver is the result of careful work by Bogdan Costescu.  It will work in all Linux 2.2 kernels, giving higher throughtput for 3c905B and 3c905C NICs (we're not sure how much higher though).

Specific changes:

Download poll-ioctl-2.2.18-pre16.c.gz


This is a tool which generates 802.3x ethernet flow control PAUSE frames.  It may be used to test an ethernet driver's handling of this feature.

Pretty simple to use: ping your target machine and then run 'flow-ctrl -p 50000' on the host which is sending the pings.  You should see the ping times suddenly go up to 2.5 seconds on 10baseT, 0.25 seconds on 100 baseT.

This program is derived from Donald Becker's ether-wake.c

Download flow-ctrl.c (Jul 02)

dev_alloc_fail: a patch for testing netdrivers under low memory conditions

A tool inspired by Mark Hemment. May be used to make the net driver's dev_alloc_skb() calls deliberately fail.  To use it, apply the patch and add
#define dev_alloc_skb dev_alloc_skb_debug
to the driver.


echo 100 > /proc/sys/net/core/dev_alloc_fail
will cause all the driver's skbuff allocation requests to fail for skbs which are greater than 100 bytes.  Use
echo 0 > /proc/sys/net/core/dev_alloc_fail
to turn it off.

Patch against 2.2.17-pre5
Patch against 2.4.0-test2

zc and cyclesoak: Tools for accurately measuring system load and TCP efficiency (mainly sendfile)

cyclesoak is a tool for measuring system resource utilisation (CPU cycles and memory bandwidth). It uses a `subtractive' algorithm: it measures how much system capacity is still available, rather than how much is consumed.  This gives a very accurate and useful measurement of the efficiency of kernel subsystems.  Much better than conventional process accounting, which can easily be wrong by an order of magnitude.

zcc and zcs are tools for sending TCP traffic across a link, using write(), send() or sendfile().  Measure their performance with cyclesoak.

The README file says it all.
Download zc.tar.gz

cpus_allowed: A patch which allows processes to be bonded to CPUs.

The 2.4.x kernel patch creates /proc/<pid>/cpus_allowed.  The contents of this are a bitmask which says which CPUs the process and any subsequently created child processes are allowed to run on.  CAP_SYS_ADMIN is required to alter cpus_allowed.

Download cpus_allowed.patch

Andrew Morton, 22 Aug 2001