Re: [PATCH] RSS ulimit enforcement for 2.6.8

From: Andrew Morton
Date: Thu Aug 05 2004 - 17:31:51 EST


Rik van Riel <riel@xxxxxxxxxx> wrote:
>
> The patch below implements RSS ulimit enforcement for 2.6.8-rc3-mm1.
> It works in a very simple way: if a process has more resident memory
> than its RSS limit allows, we pretend it didn't access any of its
> pages, making it easy for the pageout code to evict the pages.
>
> In addition to this, we don't allow a process that exceeds its RSS
> limit to have the swapout protection token.

Thanks.

I'd kinda expected that the patch would try to limit a process to its
RLIMIT_RSS all the time. So if a process is set to 16MB and tries to use
32MB it gets to do a lot of swapping. But you're not doing that. Instead,
the patch is preferentially penalising processes which are over their limit
when we enter page reclaim. What are the pros and cons, and what is the
thinking behind this?

Also, I wonder if it would be useful if refill_inactive_zone() were to
unconditionally move pages from over-rss-limit mm's onto the inactive list,
ignoring swappiness. Or if we should explicitly deactivate pages which are
newly added to the LRU on behalf of an over-rss-limit process.


-
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/