lkml.org 
[lkml]   [2010]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus
    On Thu, 4 Nov 2010, Figo.zhang wrote:

    > CAP_SYS_RESOURCE also had better get 3% bonus for protection.
    >

    Would you like to elaborate as to why?

    > Signed-off-by: Figo.zhang <figo1802@gmail.com>
    > ---
    > mm/oom_kill.c | 3 ++-
    > 1 files changed, 2 insertions(+), 1 deletions(-)
    >
    > diff --git a/mm/oom_kill.c b/mm/oom_kill.c
    > index 4029583..30b24b9 100644
    > --- a/mm/oom_kill.c
    > +++ b/mm/oom_kill.c
    > @@ -198,7 +198,8 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
    > * Root processes get 3% bonus, just like the __vm_enough_memory()
    > * implementation used by LSMs.
    > */
    > - if (has_capability_noaudit(p, CAP_SYS_ADMIN))
    > + if (has_capability_noaudit(p, CAP_SYS_ADMIN) ||
    > + has_capability_noaudit(p, CAP_SYS_RESOURCE))
    > points -= 30;
    >
    > /*


    \
     
     \ /
      Last update: 2010-11-04 00:49    [W:0.024 / U:0.840 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site