On Mon, Aug 02, 2004 at 01:55:27AM -0700, Andrew Morton wrote: > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.8-rc2/2.6.8-rc2-mm2/ > - Tons of new fixes and cleanups and updates to various things as usual. > - Again, 2.6.8 is close, so if people have critical fixes in here which > need flushing out, please ping me. Speaking of cleanups, I've got a little something. 65 files changed, 274 insertions(+), 1076 deletions(-) This mass slaughter of duplicated code is a cleanup of /proc/profile that consolidates code across all arches and privatizes private state. Compiletested on x86-64. Prior incarnations of earlier cleanups this is based on were runtime tested on ia32, x86-64, sparc64, and alpha. The purpose of these cleanups in their prior incarnations has been for use as a preparatory cleanup for profiling other kinds of events in /proc/profile's buffer (or similar buffers). There has recently been a need to discover which codepaths were responsible for leaking inodes that were leaking that similar cleanups in combination with some slab profiling hooks are being used to instrument. In order, the patches of the series (included as a series of separate MIME attachments to this post) are: consolidate-prof_cpu_mask.patch Handling of prof_cpu_mask is grossly inconsistent. Some arches have it as a cpumask_t, others unsigned long, and even within arches it's treated inconsistently. This makes it cpumask_t across the board, and consolidates the handling in kernel/profile.c profile_pc.patch The program counter calculation from pt_regs is the only portion of profile accounting that differs across various architectures. This is usually instruction_pointer(regs), but to handle the few arches where it isn't, introduce profile_pc(). profile_tick.patch With prof_cpu_mask and profile_pc() in hand, the core is now able to perform all the profile accounting work on behalf of arches. Consolidate the profile accounting and convert all arches to call the core function. move-profile-operations.patch proc_misc.c is a trainwreck. Move the file_operations for /proc/profile into kernel/profile.c and call the profiling setup from proc_misc_init(). static-profile-state.patch Make the various bits of state no longer used anywhere else static to kernel/profile.c atomic-prof_buffer.patch Convert prof_buffer to an array of atomic_t instead of sometimes atomic_t, sometimes unsigned int. Also, bootmem rounds up internally, so blow away some crap code there. -- wli