2002-11-11 06:05:10

by ari

[permalink] [raw]
Subject: penalty-imposing resource limits

This post is three years too late.

Once upon a time, when kernel 2.2.13 was the bleeding-edge of the stable
tree, my processor was experiencing heat-related problems. I dealt with
this as any proactively lazy person would, in that instead of buying a
new heat sink, i modified my kernel to deal with the issue, and wrote a
small command-line program as an interface.

This modification added a new resource limit to the kernel, RLIMIT_TCPU,
allowing the user to impose time penalties (in jiffies) on a process
that reaches a set amount of cpu time (in 1/100 of a cpu second). It
was a simple algorithm, but it functioned satisfactorily, and it
remained incredibly useful to me for some time. Eventually, i bought a
new heat sink and high silver content thermal compound, and felt no need
to port this modification to future kernel releases.

The topic of heat-related issues came up in conversation recently, and a
comment about my modification followed suit (this comment came from me,
of course, reminiscently). The person to whom i spoke iterated how
useful such a thing could be, further requesting that i send the patch
on to the linux kernel mailing list. The rest can be inferred.

'Twas a quick hack, and rather dirty. It wasn't designed for
multiprocessor systems, but it will likely handle them... acceptably.
It should also function (and compile) only on i386-based processors, as
i did not modify resource.h in other processor-specific include
directories (this should be terribly easy to change, as the actual
modifications are not processor-specific). Regardless, it served me
well, and perhaps in some form it may live to serve another.

The patch and the program are now available at:
http://www.episec.com/people/edelkind/patches/kernel/

Usage is given there as well.

ari


2002-11-13 19:57:20

by Martin Waitz

[permalink] [raw]
Subject: Re: penalty-imposing resource limits

hi :)

On Mon, Nov 11, 2002 at 01:11:19AM -0500, ari wrote:
> my processor was experiencing heat-related problems. I dealt with
> this as any proactively lazy person would, in that instead of buying a
> new heat sink, i modified my kernel to deal with the issue, and wrote a
> small command-line program as an interface.

i'm currently working on similar problems for my diploma thesis.
i haven't looked at your code but i guess it'll get a little bit
more complicated...

i'm using resource containers as resource principal for accounting
of arbitrary resources (right now the code supports cpu usage
and an estimate of energy consumed by the cpu -- calculated
from the processors performance counters)

user can set arbitrary limits for resource usage of processes,
process groups, entire machine, you name it...

a friend of mine is working on messuring/estimating/controlling
cpu temperature based on this system as a semester thesis.



there are still a lot of rough edges everywhere but i hope
i can do some cleanup and be able to do a real release of the code
after my thesis is done (will happen early next year)
if there is interest, i can point to some code, but there's
no real doku yet...

--
CU, / Friedrich-Alexander University Erlangen, Germany
Martin Waitz // [Tali on IRCnet] [tali.home.pages.de] _________
______________/// - - - - - - - - - - - - - - - - - - - - ///
dies ist eine manuell generierte mail, sie beinhaltet //
tippfehler und ist auch ohne grossbuchstaben gueltig. /
-
Wer bereit ist, grundlegende Freiheiten aufzugeben, um sich
kurzfristige Sicherheit zu verschaffen, der hat weder Freiheit
noch Sicherheit verdient.
Benjamin Franklin (1706 - 1790)


Attachments:
(No filename) (1.67 kB)
(No filename) (189.00 B)
Download all attachments