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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KOSAKI Motohiro
Date: Saturday, November 13, 2010 - 10:07 pm

Hi Mandeep,


This concept sound useful for embedeed. but I dislike this interface
a bit. Why don't you create /proc/{pid}/oom_adj_lower_bound or similar? 
It is more straight forward because oom_adj are already using /proc.

I also think 15..-17 to 0-32 convertion is a bit user unfriendly.



two points.

1) task->signal->rlim[RLIMIT_OOMADJ].rlim_cur is incorrect.
   please use task_rlimit().

2) If process has CAP_SYS_RESOURCE, we should ignore RLIMIT_OOMADJ for
   backword compatibility. CAP_NICE do so. (see below)

------------------------------------------------------------------
int can_nice(const struct task_struct *p, const int nice)
{
        /* convert nice value [19,-20] to rlimit style value [1,40] */
        int nice_rlim = 20 - nice;

        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
                capable(CAP_SYS_NICE));
}
------------------------------------------------------------------




I don't think 0 is good initial value because 0 mean oom_adj==15.






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