Re: [PATCH] oom: create a resource limit for oom_adj

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mandeep Singh Baines
Date: Thursday, November 11, 2010 - 11:30 am

David Rientjes (rientjes@google.com) wrote:

Ah. Thanks for the pointer.


The focus here is the web browser's tabs. In our case, each is a process. If
OOM is going to kill a process, you'd rather it kill the tab you looked at
hours ago instead of the one you're looking at now. So you'd like to have a
policy where the LRU tab gets killed first. We'd like to use oom_score_adj
as the mechanism to implement an LRU policy like this.


As explained above, oom_kill_allocating_task won't give us what we want.


A process in the browser session will do the adusting. We'd rather not give
it CAP_SYS_RESOURCE. It should only be allowed to change oom_score_adj up
and down within the bounds set by the administrator. Analagous to renice()
which we also do using a similar policy.


This is a MAX value because of how resource limits work. On the other hand,
it is really controlling the minimum oom_adj. So its a toss up for me.
More than happy to change if you prefer Min.


Unfortunate but unavoidable. The resource limit code checks to see if the
new limit is greater than the limit. This code was based on the can_nice()
code in sched.c.


D'oh. Forward port error. I should be more careful. Thanks for catching:)


Thank you for reviewing this patch.

Should I send an updated oom_score_adj patch?

Regards,
Mandeep
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] oom: create a resource limit for oom_adj, Mandeep Singh Baines, (Wed Nov 10, 9:35 pm)
Re: [PATCH] oom: create a resource limit for oom_adj, David Rientjes, (Thu Nov 11, 12:35 am)
Re: [PATCH] oom: create a resource limit for oom_adj, Mandeep Singh Baines, (Thu Nov 11, 11:30 am)
Re: [PATCH] oom: create a resource limit for oom_adj, David Rientjes, (Thu Nov 11, 1:57 pm)
Re: [PATCH] oom: create a resource limit for oom_adj, Mandeep Singh Baines, (Thu Nov 11, 3:25 pm)
Re: [PATCH] oom: create a resource limit for oom_adj, David Rientjes, (Thu Nov 11, 4:19 pm)
Re: [PATCH] oom: create a resource limit for oom_adj, Mandeep Singh Baines, (Thu Nov 11, 4:56 pm)
[PATCH] oom: allow a non-CAP_SYS_RESOURCE proces to oom_sc ..., Mandeep Singh Baines, (Fri Nov 12, 5:46 pm)
Re: [PATCH] oom: create a resource limit for oom_adj, KOSAKI Motohiro, (Sat Nov 13, 10:07 pm)
[PATCH v2] oom: allow a non-CAP_SYS_RESOURCE proces to oom ..., Mandeep Singh Baines, (Mon Nov 15, 3:01 pm)
[PATCH v3] oom: allow a non-CAP_SYS_RESOURCE proces to oom ..., Mandeep Singh Baines, (Mon Nov 15, 5:03 pm)