Messages in this thread | | | Date | Tue, 30 Aug 2011 14:44:07 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 2/4] posix-timers: limit the number of posix timers per process |
| |
On Mon, 29 Aug 2011 16:39:15 -0700 Andi Kleen <andi@firstfloor.org> wrote:
> Now this is the main reason I wrote the whole patchkit: previously > there was no limit on the maximum number of POSIX timers a process > could allocate. This limits the amount of unswappable kernel memory > a process can pin down this way. > > With the POSIX timer ids being per process we can do this limit > per process now without allowing one process DoSing another. > > I implemented it as a sysctl, not a rlimit for now, because > there was no clear use case for rlimit. > > The 1024 default is completely arbitrary, but seems reasonable > for now.
Sorry, it should be an rlimit from day one, IMO.
Partly because rlimits are a better implementation.
Partly because if we later do it via rlimit, we're stuck having to maintain the /proc knob for ever.
Partly because once rlimits are added, the /proc knob no longer has any sane behaviour. Does it only modify /sbin/init? Does it do a global process walk, modifying all threads?
| |