Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!cca!ima!ISM780!geoff From: geoff@ISM780.UUCP Newsgroups: net.jokes Subject: New System Call Message-ID: <114@ISM780.UUCP> Date: Tue, 26-Feb-85 01:38:28 EST Article-I.D.: ISM780.114 Posted: Tue Feb 26 01:38:28 1985 Date-Received: Fri, 1-Mar-85 07:24:42 EST Lines: 58 Nf-ID: #N:ISM780:29500003:000:2034 Nf-From: ISM780!geoff Feb 25 13:00:00 1985 thrash(2) thrash(2) NAME thrash -- reduce throughput by swapping processes SYNOPIS #include #include char *thrash (pids, freq, mode) int *pids[]; int freq; char *mode; DESCRIPTION Thrash allows the calling process to reduce system performance to an arbitrary level by forcing the kernel to swap process images. The processes to be swapped are identified by *pid* in the array pids[]. Processes are swapped every *freq* clock ticks (see time(2)), according to the flags in *mode*. Mode can be OR'd with any of the following: THRSHGRP 01 swap processes by group id THRSHLIB 02 swap only pure text segments THRSHPGS 04 cause page faults (for paging systems) THRSHSCK 08 swap only blocks with the sticky bit set THRSHBLK 16 indicates that the last member of pids[] is a blocksize (prime numbers give best results) THRSHCHR 32 do swapping one character at a time THRSHKNL 64 swap resident kernel routines THRSHSTK 128 swap only the stack segments RETURN VALUE A successful call to thrash will never really return until the SUPERUSER kills the calling process from the system console (see The Kernel Debugger Tutorial). If for some reason (e.g. very fast processor) thrash should return, it will return a pointer to the name of the CPU to which the processor speed has been reduced to emulate (i.e. 1401, 6502, pdp7 ). SEE ALSO stopit(2), scribble(2), harass(1), dumpola(3), unexec(3). BUGS Only processes with uids greater than 3 may call thrash. ________________________________________________________________________ submitted by Geoffrey Kimbrough -- Consultant to: Inactive Systems Inc. Systems Demolition Corp. MicroBug Coding Services. "Treating UNIX systems the way they deserve."