Re: [PATCH 2/4] posix-timers: limit the number of posix timers perprocess

From: Andrew Morton
Date: Tue Aug 30 2011 - 17:44:50 EST


On Mon, 29 Aug 2011 16:39:15 -0700
Andi Kleen <andi@xxxxxxxxxxxxxx> 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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/