.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "BADNESS" "9" "09 October 2005" "" ""
.SH NAME
badness \- calculate a numeric value for how bad this task has been
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
unsigned long badness (struct task_struct * \fIp\fB, unsigned long \fIuptime\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIp\fB\fR
current uptime in seconds
.TP
\fB\fIuptime\fB\fR
-- undescribed --
.SH "DESCRIPTION"
.PP
The formula used is relatively simple and documented inline in the
function. The main rationale is that we want to select a good task
to kill when we run out of memory.
.SH "GOOD IN THIS CONTEXT MEANS THAT"
.PP
1) we lose the minimum amount of work done
2) we recover a large amount of memory
3) we don't kill anything innocent of eating tons of memory
4) we want to kill the minimum amount of processes (one)
5) we try to kill the process the user expects us to kill, this
algorithm has been meticulously tuned to meet the principle
of least surprise ... (be careful when you change it)