Rusty's Linux Kernel Page

Module Utilities for 2.6

Here is the source for "module-init-tools" which replaces modutils for modern kernels. Your distribution will probably have it in a convenient package by now.

Kernel Patches

This is a page for many of my kernel patches: an increasing number of them apply on top of the others, so I decided to split them up and host them somewhere appropriate (thanks HPA!).

Patch Compatibility Chart
Patch name Status v2.6.10-rc1-bk12 v2.6.10-rc1-mm2 vppc64-2.5
EarlyParam section:
Handle __early_param and __setup Collision Booted on 2.6.7-rc2-bk7 BROKEN BROKEN BROKEN
Hotcpu section:
Don't Sleep After We're Out Of Task List Booted on 2.6.8.1-mm2 BROKEN BROKEN BROKEN
Debug Checks for CPU Hotplug and stop_machine Booted on 2.6.7-bk8 APPLIES APPLIES BROKEN
Centralize Calls to set_task_cpu() on Fork Booted on 2.6.6-rc2-mm2 BROKEN BROKEN BROKEN
Don't Sleep After We're Out Of Task List Booted on 2.6.8.1-mm1 BROKEN BROKEN BROKEN
Neaten migrate_all_tasks Tested on 2.6.8.1-mm4 BROKEN BROKEN BROKEN
Simplified Kthread Tests Booted on 2.6.1-rc2-bk1 BROKEN BROKEN BROKEN
Create sysfs Nodes For IA64 CPUs BROKEN BROKEN BROKEN
Extra Debugging Checks for Hotplug CPU
Needs: Spinlock debugging for PPC64
Experimental UNKNOWN UNKNOWN UNKNOWN
Hotplug CPU vs TASK_ZOMBIEs: The Sequel to Hotplug CPU vs TASK_DEAD
Needs: Neaten migrate_all_tasks
Tested on 2.6.8.1-mm4 UNKNOWN UNKNOWN UNKNOWN
Add basic support to enable CPU hotplug for IA64
Needs: Create sysfs Nodes For IA64 CPUs
UNKNOWN UNKNOWN UNKNOWN
x86 code
Needs: Hotplug CPU vs TASK_ZOMBIEs: The Sequel to Hotplug CPU vs TASK_DEAD
Booted on 2.6.6-rc3-bk7 UNKNOWN UNKNOWN UNKNOWN
Suspend And Resume APIC for x86
Needs: x86 code
Untested UNKNOWN UNKNOWN UNKNOWN
Hotmem section:
Prototype Absolute Memory Indirection Layer for PPC64 Untested BROKEN BROKEN BROKEN
Kmod section:
Enhanced kmod macros Simple BROKEN BROKEN BROKEN
include kmod.h Simple BROKEN BROKEN BROKEN
CONFIG_KMOD cleanup
Needs: Enhanced kmod macros
Experimental UNKNOWN UNKNOWN UNKNOWN
Misc section:
XBUG macro Tested in 2.5.17 BROKEN BROKEN BROKEN
Test Single-Threaded Workqueues Booted on 2.6.6-rc1-bk3 BROKEN BROKEN APPLIES
typecheck.h Addition Simple APPLIES APPLIES APPLIES
try_dev_hold Experimental BROKEN BROKEN BROKEN
Simple Dynamic Allocation of groups array Experimental APPLIES APPLIES APPLIES
task_t removal patch Trivial BROKEN BROKEN BROKEN
streq implementation Trivial APPLIES APPLIES APPLIES
Fix stop_machine() For Nick Sched Tested on 2.6.8.1-mm4 APPLIES APPLIES BROKEN
Remove Strange start_cpu_timer Code Booted on 2.6.5-rc2-bk1 BROKEN BROKEN BROKEN
Debug Too-Early Use of softirqs Untested APPLIES APPLIES APPLIES
Serialize Network Packets for PPPoE Experimental BROKEN BROKEN BROKEN
Split Scheduler Structure into Per-CPU and Per-Runqueue Parts Experimental BROKEN BROKEN BROKEN
Revert Sched Domain Lockup Fix Untested BROKEN BROKEN BROKEN
Don't Check for Dead Tasks on Every Schedule Booted on 2.6.7-rc2-bk3 BROKEN BROKEN BROKEN
Remove rwlocks Experimental BROKEN BROKEN BROKEN
RTAS System Call Experimental BROKEN BROKEN BROKEN
Remove CONFIG_PROC_FS Where Compiler Will Discard Anyway Experimental APPLIES APPLIES APPLIES
Removed inter_module functions Untested BROKEN BROKEN BROKEN
RCU For Softirqs and Hard IRQs
Needs: Use __get_per_cpu instead of per_cpu in RCU.
Experimental UNKNOWN UNKNOWN UNKNOWN
QEMU CONFIG Patch Booted on 2.6.4-rc1-bk3 APPLIES APPLIES APPLIES
put_user/get_user extra checks (x86 only) Trivial BROKEN BROKEN BROKEN
Merge Duplicate Names in prom.c Device Tree Tested on Ameslab 19-May-2004 BROKEN BROKEN BROKEN
Per-CPU Memory On Right Nodes Untested APPLIES APPLIES APPLIES
Spinlock debugging for PPC64 Experimental BROKEN BROKEN BROKEN
Module initcall depends Tested on 2.5.34 BROKEN BROKEN BROKEN
__keep and __optional attributes Trivial BROKEN BROKEN BROKEN
IDE Oops Dumper for x86 Tested on 2.5.34 i386 SMP BROKEN BROKEN BROKEN
on_one_cpu function Booted on 2.6.5 APPLIES BROKEN APPLIES
notifier_unregister should return void Tested on 2.5.66-bk2 BROKEN BROKEN BROKEN
Directed Migration: Don't Change cpumask in sched_balance_exec() Experimental BROKEN BROKEN BROKEN
Simple Dynamic Allocation of groups array Experimental BROKEN BROKEN BROKEN
Automagic Proc Entry Creation
Needs: Allow Arbitrary Number of Init and Exit Functions
Tested on 2.5.71-bk2 UNKNOWN UNKNOWN UNKNOWN
mandocs target Experimental BROKEN BROKEN BROKEN
Interpret ibm,lrdr-capacity Property Correctly Trivial BROKEN BROKEN BROKEN
Add Al Viro's Recursive Lock Warning to Locking Guide Trivial APPLIES APPLIES APPLIES
Spinlock Data Debugging Untested BROKEN BROKEN BROKEN
kstrdup Trivial BROKEN BROKEN BROKEN
Kprobes for i386 Tested on 2.5.44 SMP BROKEN BROKEN BROKEN
Kobject Whitespace Style Patch Trivial BROKEN BROKEN BROKEN
Make kallsyms filter out all non-C symbols Booted on 2.6.7-bk6 BROKEN BROKEN BROKEN
Sort Kallsyms for Stem Compression Booted on 2.6.6 BROKEN BROKEN BROKEN
in_sched_functions() Booted on 2.6.5-mm4 BROKEN INCLUDED BROKEN
Poison __init regions Experimental BROKEN BROKEN BROKEN
Remove quotes around environment variables Booted on 2.6-bk INCLUDED INCLUDED BROKEN
i386 Constant Cleanup Experimental BROKEN BROKEN BROKEN
Hyperthread Scheduler Modifications Experimental BROKEN BROKEN BROKEN
Update Hacking Guide For 2.6 Experimental BROKEN BROKEN BROKEN
Group Reference Counting Debug Patch Tested on 21 May 2004 APPLIES APPLIES APPLIES
gfp_t Tested against 2.5.43 BROKEN BROKEN BROKEN
generated file removal Trivial BROKEN BROKEN BROKEN
Clean up futex task state setting Trivial BROKEN BROKEN BROKEN
Resolve Race Between Requeue and Wakeup Futex Requeue Race Experimental Experimental BROKEN BROKEN BROKEN
Futexes Hold Reference Counts on Page or MM Experimental BROKEN BROKEN BROKEN
Minor Futex Tweaks Trivial BROKEN BROKEN BROKEN
Who's Spuriously Waking Futexes? Tested on 2.6.3-bk1 BROKEN BROKEN APPLIES
Fix cmdline parsing crash Untested BROKEN BROKEN BROKEN
File Logging Patch Untested APPLIES APPLIES APPLIES
Fake Schedule for Another CPU Works for Me BROKEN BROKEN BROKEN
Event Logging Macros II Experimental BROKEN BROKEN BROKEN
Eliminate Unused Functions Tested on 2.5.70-bk16 BROKEN BROKEN BROKEN
Merge __early_param() with __setup code Tested on 2.6.5-rc3 BROKEN BROKEN BROKEN
Die OSS, die Relatively Trivial BROKEN BROKEN BROKEN
Detect POSIX Lock Surprises Booted on 2.6.7-rc3-bk7 BROKEN BROKEN BROKEN
Put __per_cpu_offset in the thread struct, remove cpu Tested on 2.5.69-bk15, dual x86 BROKEN BROKEN BROKEN
Deprecate cli/sti/restore_flags etc. Tested on 2.5.54 BROKEN BROKEN BROKEN
Make current an attribute const function Experimental BROKEN BROKEN BROKEN
Simple Cleanup of Uses of cpumask_t Booted on 2.6.5 BROKEN BROKEN BROKEN
CPU mask patch Tested on 2.5.44 SMP BROKEN BROKEN BROKEN
Remove Useless cpumask Initializers Untested BROKEN BROKEN BROKEN
CPU iterator patch Trivial BROKEN BROKEN BROKEN
copy_device_tree to use Open Firmware claim call Untested BROKEN BROKEN BROKEN
Check Calls to smp_processor_id() Experimental BROKEN BROKEN BROKEN
Bigrefs Implementation using __alloc_percpu
Needs: Dynamic per-cpu allocation using static per-cpu mechanism (old version)
Experimental UNKNOWN UNKNOWN UNKNOWN
Bigrefs Implementation Tested on 2.5.38 BROKEN BROKEN BROKEN
Cache Align Cleanup Patch Relatively Trivial BROKEN BROKEN BROKEN
2.4 module_param Forward Compatibility Macros Tested on 2.5.24-pre6 BROKEN BROKEN BROKEN
Core initcall depends
Needs: Module initcall depends
Experimental UNKNOWN UNKNOWN UNKNOWN
Neater returns for i386/x86_64 cpuid/msr on Offline CPUs
Needs: on_one_cpu function
Untested BROKEN UNKNOWN BROKEN
Kobject Devpath Sanity Patch
Needs: Kobject Whitespace Style Patch
Tested in userspace. UNKNOWN UNKNOWN UNKNOWN
Rusty's Hyperthread Scheduler Modifications
Needs: Hyperthread Scheduler Modifications
Experimental UNKNOWN UNKNOWN UNKNOWN
FUTEX_REQUEUE simplification
Needs: Minor Futex Tweaks
Booted on 2.6.0-test4-bk9 UNKNOWN UNKNOWN UNKNOWN
cpumask_t Removal
Needs: Simple Cleanup of Uses of cpumask_t
Untested UNKNOWN UNKNOWN UNKNOWN
Expose kobject_hotplug function.
Needs: Kobject Devpath Sanity Patch
Trivial. UNKNOWN UNKNOWN UNKNOWN
Module section:
APPLIES INCLUDED APPLIES
APPLIES BROKEN BROKEN
Figure Out Who Is Inserting Bogus Modules Booted on 2.6.9-rc3-mm3 APPLIES INCLUDED APPLIES
Centralize token pasting and generation of unique IDs Tested on 2.5.70-bk13 BROKEN BROKEN BROKEN
try_then_request_module() in MTD code Trivial APPLIES APPLIES APPLIES
Remove inter_module functions Compiled on 2.6.10-rc1-bk10 BROKEN BROKEN BROKEN
Remove inter_module functions from mtd drivers. Compiled on 2.6.10-rc1-bk10 APPLIES APPLIES APPLIES
Removed inter_module functions from DRM Compiles APPLIES BROKEN APPLIES
Check Permission Are Sane on module_param Usage Tested on 2.6.8-rc6-bk1 APPLIES APPLIES APPLIES
Eliminate Obsolete init_module and cleanup_module Uses Compiled on linux-2.6.9-bk6 BROKEN APPLIES BROKEN
More Module Notifiers Trivial APPLIES APPLIES BROKEN
Remove alias references Trivial APPLIES BROKEN APPLIES
Module Signature Core Code Booted on 2.6.9-rc3 APPLIES APPLIES APPLIES
Alias support for input_device_id tables Experimental APPLIES APPLIES BROKEN
Allow Arbitrary Number of Init and Exit Functions
Needs:
Tested on 2.5.73-bk1 UNKNOWN UNKNOWN UNKNOWN
Fix Module Removal: Don't Ignore try_stop_module Return Trivial APPLIES APPLIES APPLIES
Remove MODULE_PARM from allyesconfig
Needs:
Compiled on 2.6.9-bk6 UNKNOWN UNKNOWN UNKNOWN
Module init race fix
Needs:
Experimental UNKNOWN UNKNOWN UNKNOWN
Eliminate init_module and cleanup_module Magic
Needs: Eliminate Obsolete init_module and cleanup_module Uses
Compiled on linux-2.6.9-bk6 UNKNOWN APPLIES UNKNOWN
Module Signature Signing Script
Needs: Module Signature Core Code
Booted on 2.6.9-rc3 APPLIES APPLIES APPLIES
Test Arbitrary Number of Init and Exit Functions
Needs: Allow Arbitrary Number of Init and Exit Functions
Tested on 2.5.73-bk1 UNKNOWN UNKNOWN UNKNOWN
Mark broken MODULE_PARM uses
Needs: Remove MODULE_PARM from allyesconfig
Trivial UNKNOWN UNKNOWN UNKNOWN
Netfilter section:
skb_walk Function Untested APPLIES APPLIES APPLIES
skb_iter Functions Tested on 2.6.8-rc2-bk12 BROKEN BROKEN BROKEN
Change MASQUERADE to Use Device Address Directly Untested INCLUDED INCLUDED APPLIES
Remove list macro usage from ip_conntrack. Experimental BROKEN BROKEN BROKEN
ip_tables Stack Leakage Trivial APPLIES APPLIES APPLIES
CONFIG_IP_NF_CROSSOVER Experimental APPLIES APPLIES APPLIES
Hardware Loopback Module Tested on 2.5.74-bk5 APPLIES APPLIES APPLIES
ip_nat_ftp - manip at the right place Untested APPLIES APPLIES BROKEN
Fix find_appropriate_src() To Actually Work Tested under nfsim APPLIES APPLIES BROKEN
Fix Early Drop Code Experimental BROKEN BROKEN BROKEN
Call NAT Helper Modules Directly from Conntrack Modules
Needs: More Module Notifiers
Experimental BROKEN BROKEN UNKNOWN
Connection Tracking Protocol Lock optimization Trivial BROKEN BROKEN BROKEN
Conntrack Hash Allocation using __get_free_pages Experimental BROKEN BROKEN BROKEN
Conntrack Hashing Patch Rewrite Experimental BROKEN BROKEN BROKEN
Removes ip_conntrack_expect_tuple_lock Experimental BROKEN BROKEN BROKEN
Change iptables Targets and Matches to Take Whole Struct Experimental BROKEN BROKEN BROKEN
ip_conntrack_alter_reply thinko fix Booted on 2.6.0-test5-bk1 APPLIES APPLIES APPLIES
Avoid warning on CONNTRACK_STAT_INC in destroy_conntrack() Trivial APPLIES INCLUDED BROKEN
Avoid warning on CONNTRACK_STAT_INC in death_by_timeout() Trivial INCLUDED INCLUDED BROKEN
Fragment ID Wrap Workaround
Needs: skb_iter Functions
Untested UNKNOWN UNKNOWN UNKNOWN
Remove NAT to multiple ranges
Needs: Change MASQUERADE to Use Device Address Directly
Needs: Fix find_appropriate_src() To Actually Work
Untested BROKEN BROKEN UNKNOWN
ip_conntrack_expect_alloc
Needs: Removes ip_conntrack_expect_tuple_lock
Experimental UNKNOWN UNKNOWN UNKNOWN
Connection Tracking Helper Lock optimization
Needs: Connection Tracking Protocol Lock optimization
Needs: ip_conntrack_alter_reply thinko fix
Needs: Removes ip_conntrack_expect_tuple_lock
Trivial UNKNOWN UNKNOWN UNKNOWN
Remove Double NAT on LOCAL_OUT
Needs: Remove NAT to multiple ranges
Untested UNKNOWN UNKNOWN UNKNOWN
Make Expectations Timeouts Compulsory
Needs: ip_conntrack_expect_alloc
Experimental UNKNOWN UNKNOWN UNKNOWN
Speed up locking for connection tracking
Needs: Connection Tracking Helper Lock optimization
Experimental UNKNOWN UNKNOWN UNKNOWN
Connection Tracking Expect Fix
Needs: Removes ip_conntrack_expect_tuple_lock
Needs: ip_conntrack_expect_alloc
Needs: Make Expectations Timeouts Compulsory
Experimental UNKNOWN UNKNOWN UNKNOWN
Percpu section:
Remove gratuitous cpu arg in kernel/timer.c Trivial BROKEN BROKEN BROKEN
Softirq callback parameter removal Experimental BROKEN BROKEN BROKEN
Make PPC64 Use r14 For Per-Cpu Data Untested BROKEN BROKEN BROKEN
Make PPC64 Use r14 For Per-Cpu Data Untested BROKEN BROKEN APPLIES
Unification of per-cpu headers for non-SMP Trivial BROKEN BROKEN BROKEN
Align per-cpu Section Correctly Booted on 2.6.9-rc4-bk2 APPLIES BROKEN APPLIES
Make scsi user per-cpu variables Trivial BROKEN BROKEN BROKEN
Use __get_per_cpu instead of per_cpu in RCU. Experimental BROKEN BROKEN BROKEN
Make cpu_tlbstate a per-cpu variable on i386. Experimental BROKEN BROKEN BROKEN
Use local_t for linux_mib network counters Experimental BROKEN BROKEN BROKEN
Use per-cpu-allocated module references Experimental BROKEN BROKEN BROKEN
local_t test code.
Needs: QEMU CONFIG Patch
Booted on 2.6.0-test1 BROKEN BROKEN BROKEN
local_t ia64 support Tested on 2.6.0-test1 BROKEN BROKEN BROKEN
Remove softirq_pending. Tested on 2.5.74 BROKEN BROKEN BROKEN
Dynamic per-cpu allocation using static per-cpu mechanism (old version) Tested on 2.5.69-bk13 BROKEN BROKEN BROKEN
Dynamic per-cpu allocation using static per-cpu mechanism Experimental BROKEN BROKEN BROKEN
Unification of per-cpu headers for SMP
Needs: Unification of per-cpu headers for non-SMP
Trivial UNKNOWN UNKNOWN UNKNOWN
Make Generic irq_stat Structure Use per-cpu
Needs: Remove softirq_pending.
Tested on 2.5.74 UNKNOWN UNKNOWN UNKNOWN
kmalloc testing patch
Needs: Dynamic per-cpu allocation using static per-cpu mechanism
Tested on 2.5.69-bk13 UNKNOWN UNKNOWN UNKNOWN
Make Softirq Structure Use per-cpu
Needs: Make Generic irq_stat Structure Use per-cpu
Tested on 2.5.74-bk1 UNKNOWN UNKNOWN UNKNOWN
Gather Stats on per-cpu Usage
Needs: Make Generic irq_stat Structure Use per-cpu
Needs: Use __get_per_cpu instead of per_cpu in RCU.
Needs: Make Softirq Structure Use per-cpu
Experimental UNKNOWN UNKNOWN UNKNOWN

Key

Increasing levels reflect increased amounts of testing...
UNKNOWN APPLIES ALMOST BROKEN COMPILES NOCOMPILE RUNS NORUN
Untested. Patches cleanly. Almost patches: lkpatch is OK Doesn't patch. Compiled OK. Did not compile. Boots OK. Did not boot.

Kmod Section

These are my kmod enhancements, mainly concerned with removing the messy code which is required for the 2.4 kernels to do autoloading.

Module Section

These is my module rewrite, which has the following goals:

Hotplug CPU Section

This is the Hot Plug CPU section: see also the SourceForge Page.

The idea is to use Read Copy Update to safely and unintrusively support addition and removal of CPUs. Of course, once CPUs can appear and disappear, the attempts to keep CPU numbers linear become meaningless, so this patch also removes the distinction between "logical" and "physical" CPU numbers (which were already the same for some ports).

Proc Section

This is my proc rewrite, which has the following goals:

Initializer Revision Section

The old form of designated initializers used in the kernel (".foo =") are obsolete: we need to replace them with the ISO C forms before 2.6, otherwise a future gcc change will bury us in warnings. Gcc has always supported both forms anyway, we just chose the wrong one.

This started as a trivial patch effort by Art Haas, but people complained about his patches messing up whitespace, so I wrote my own script to start submitting them.

Misc Section

This section is for patches which don't fit anywhere else.
Rusty Russell. (Yes, you can reach me via kernel org. No spam please.).