<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech-pubs.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Kernel%3A_STREAMS</id>
	<title>Kernel: STREAMS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech-pubs.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Kernel%3A_STREAMS"/>
	<link rel="alternate" type="text/html" href="https://tech-pubs.net/wiki/index.php?title=Kernel:_STREAMS&amp;action=history"/>
	<updated>2026-04-19T19:39:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://tech-pubs.net/wiki/index.php?title=Kernel:_STREAMS&amp;diff=476&amp;oldid=prev</id>
		<title>Raion at 23:57, 9 January 2026</title>
		<link rel="alternate" type="text/html" href="https://tech-pubs.net/wiki/index.php?title=Kernel:_STREAMS&amp;diff=476&amp;oldid=prev"/>
		<updated>2026-01-09T23:57:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:57, 9 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l98&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Overall, IRIX STREAMS is classic SVR4 with NUMA/per-CPU optimizations. illumos provides closest modern equivalent; BSD lacks native support. For replication: preserve per-CPU lists, buffer size classes, and queue scheduling semantics. Page reclamation and tiling logic are IRIX-specific.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Overall, IRIX STREAMS is classic SVR4 with NUMA/per-CPU optimizations. illumos provides closest modern equivalent; BSD lacks native support. For replication: preserve per-CPU lists, buffer size classes, and queue scheduling semantics. Page reclamation and tiling logic are IRIX-specific.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Kernel Documentation]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raion</name></author>
	</entry>
	<entry>
		<id>https://tech-pubs.net/wiki/index.php?title=Kernel:_STREAMS&amp;diff=463&amp;oldid=prev</id>
		<title>Raion: Created page with &quot;The IRIX STREAMS framework provides a modular, message-passing I/O subsystem for character devices, terminals, network protocols, and pseudo-devices. It uses queues (read/write pairs per module/driver), message blocks (mblk_t/dblk_t), and buffers for data transfer. The implementation is highly optimized for performance with:  Per-CPU free lists (NUMA-aware) for message blocks, data blocks, and buffers of various sizes. Cache coloring and alignment support. Zone-based...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech-pubs.net/wiki/index.php?title=Kernel:_STREAMS&amp;diff=463&amp;oldid=prev"/>
		<updated>2026-01-09T05:16:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The IRIX &lt;a href=&quot;/wiki/index.php?title=STREAMS&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;STREAMS (page does not exist)&quot;&gt;STREAMS&lt;/a&gt; framework provides a modular, message-passing I/O subsystem for character devices, terminals, network protocols, and pseudo-devices. It uses queues (read/write pairs per module/driver), message blocks (mblk_t/dblk_t), and buffers for data transfer. The implementation is highly optimized for performance with:  Per-CPU free lists (NUMA-aware) for message blocks, data blocks, and buffers of various sizes. Cache coloring and alignment support. Zone-based...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The IRIX [[STREAMS]] framework provides a modular, message-passing I/O subsystem for character devices, terminals, network protocols, and pseudo-devices. It uses queues (read/write pairs per module/driver), message blocks (mblk_t/dblk_t), and buffers for data transfer. The implementation is highly optimized for performance with:&lt;br /&gt;
&lt;br /&gt;
Per-CPU free lists (NUMA-aware) for message blocks, data blocks, and buffers of various sizes.&lt;br /&gt;
Cache coloring and alignment support.&lt;br /&gt;
Zone-based allocation for small structures.&lt;br /&gt;
Page-based buffering with coalescing and reclaim.&lt;br /&gt;
Global limits and dynamic reclamation via strgiveback.&lt;br /&gt;
MP-safe design using spinlocks per CPU.&lt;br /&gt;
&lt;br /&gt;
The core data structures are managed through list vectors (lf_listvec) per CPU, with separate pools for different buffer sizes (64B to full page).&lt;br /&gt;
== Key Functions ==&lt;br /&gt;
Initialization&lt;br /&gt;
&lt;br /&gt;
str_init_master: Initializes global structures for master CPU.&lt;br /&gt;
str_init_slave: Sets up per-CPU structures for slave CPUs.&lt;br /&gt;
str_init_memsize: Configures page limits based on physical memory.&lt;br /&gt;
str_init_alloc_bufs: Preallocates initial buffers per CPU.&lt;br /&gt;
strinit_giveback: Starts periodic page reclamation timer.&lt;br /&gt;
&lt;br /&gt;
Message Block Allocation&lt;br /&gt;
&lt;br /&gt;
allocb: Allocates mblk_t + dblk_t + buffer (various sizes).&lt;br /&gt;
allocb_nobuffer: Allocates only mblk_t/dblk_t (no data buffer).&lt;br /&gt;
esballoc: Attaches external buffer (zero-copy).&lt;br /&gt;
bufcall / esbbcall: Schedule callback when memory available.&lt;br /&gt;
&lt;br /&gt;
Queue Operations&lt;br /&gt;
&lt;br /&gt;
putq / putbq / insq: Insert message into queue (priority-ordered).&lt;br /&gt;
getq: Remove next message from queue.&lt;br /&gt;
rmvq: Remove specific message.&lt;br /&gt;
flushq / flushband: Discard messages (all or by band).&lt;br /&gt;
qenable: Schedule queue service routine.&lt;br /&gt;
canput / bcanput: Flow control checks.&lt;br /&gt;
&lt;br /&gt;
Buffer Management&lt;br /&gt;
&lt;br /&gt;
lf_get / lf_free: Node allocation/deallocation from per-CPU lists.&lt;br /&gt;
lf_addpage / lf_getpage_tiled: Page tiling and addition to free lists.&lt;br /&gt;
lf_freepage: Return full page to kernel VM.&lt;br /&gt;
str_preallocate: Initial buffer preallocation.&lt;br /&gt;
&lt;br /&gt;
Special Cases&lt;br /&gt;
&lt;br /&gt;
msgpullup: Coalesce message into single contiguous buffer.&lt;br /&gt;
copyb / copymsg / dupb / dupmsg: Copy or reference-count messages.&lt;br /&gt;
linkb / unlinkb: Chain management.&lt;br /&gt;
adjmsg: Trim bytes from head/tail.&lt;br /&gt;
&lt;br /&gt;
== Undocumented or IRIX-Specific Interfaces and Behaviors ==&lt;br /&gt;
Structures&lt;br /&gt;
&lt;br /&gt;
mblk_t: Message descriptor (pointers, type, flags, band).&lt;br /&gt;
dblk_t: Data block (buffer pointers, refcount, type, size, free routine).&lt;br /&gt;
queue_t: Read/write queue pair with flow control parameters.&lt;br /&gt;
qband_t: Per-priority-band flow control (for non-zero bands).&lt;br /&gt;
lf_listvec / listvec: Per-CPU free list vectors with multiple size classes.&lt;br /&gt;
strstat: Per-CPU statistics.&lt;br /&gt;
&lt;br /&gt;
Buffer Pools&lt;br /&gt;
&lt;br /&gt;
Fixed sizes: 64, 256, 512, 2048 bytes + full page.&lt;br /&gt;
Combined mblk_t/dblk_t pool.&lt;br /&gt;
Separate message header pool.&lt;br /&gt;
Page reclamation: strgiveback returns excess pages to kernel.&lt;br /&gt;
&lt;br /&gt;
NUMA Awareness&lt;br /&gt;
&lt;br /&gt;
Per-node, per-CPU list vectors.&lt;br /&gt;
Allocation prefers local node.&lt;br /&gt;
&lt;br /&gt;
Flow Control&lt;br /&gt;
&lt;br /&gt;
High/low water marks per queue and band.&lt;br /&gt;
QFULL / QB_FULL flags.&lt;br /&gt;
Back-enable nearest upstream service routine.&lt;br /&gt;
&lt;br /&gt;
Extended Free Routine&lt;br /&gt;
&lt;br /&gt;
esballoc supports external buffers with custom free function.&lt;br /&gt;
&lt;br /&gt;
== Similarities to illumos and BSD Kernel Implementations ==&lt;br /&gt;
illumos (Solaris-derived)&lt;br /&gt;
Strong similarity:&lt;br /&gt;
&lt;br /&gt;
Message block (mblk_t/dblk_t) and queue model nearly identical.&lt;br /&gt;
allocb, esballoc, putq, getq, canput, qenable.&lt;br /&gt;
Per-CPU caches and buffer pools.&lt;br /&gt;
Flow control with high/low water.&lt;br /&gt;
&lt;br /&gt;
Differences: illumos uses kmem_cache extensively; more modular.&lt;br /&gt;
BSD (FreeBSD, etc.)&lt;br /&gt;
Less similar:&lt;br /&gt;
&lt;br /&gt;
No native STREAMS (removed long ago).&lt;br /&gt;
Character I/O via cdevsw or tty.&lt;br /&gt;
Some ports emulate via compatibility layers.&lt;br /&gt;
&lt;br /&gt;
Overall, IRIX STREAMS is classic SVR4 with NUMA/per-CPU optimizations. illumos provides closest modern equivalent; BSD lacks native support. For replication: preserve per-CPU lists, buffer size classes, and queue scheduling semantics. Page reclamation and tiling logic are IRIX-specific.&lt;/div&gt;</summary>
		<author><name>Raion</name></author>
	</entry>
</feed>