lkml.org 
[lkml]   [2010]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch] oom: give current access to memory reserves if it has been killed
    On 04/01, David Rientjes wrote:
    >
    > On Thu, 1 Apr 2010, Oleg Nesterov wrote:
    >
    > > > You can't do this for the reason I cited in another email, oom_badness()
    > > > returning 0 does not exclude a task from being chosen by
    > > > selcet_bad_process(), it will use that task if nothing else has been found
    > > > yet. We must explicitly filter it from consideration by checking for
    > > > !p->mm.
    > >
    > > Yes, you are right. OK, oom_badness() can never return points < 0,
    > > we can make it int and oom_badness() can return -1 if !mm. IOW,
    > >
    > > - unsigned int points;
    > > + int points;
    > > ...
    > >
    > > points = oom_badness(...);
    > > if (points >= 0 && (points > *ppoints || !chosen))
    > > chosen = p;
    > >
    >
    > oom_badness() and its predecessor badness() in mainline never return
    > negative scores, so I don't see the value in doing this; just filter the
    > task in select_bad_process() with !p->mm as it has always been done.

    David, you continue to ignore my arguments ;) select_bad_process()
    must not filter out the tasks with ->mm == NULL.

    Once again:

    void *memory_hog_thread(void *arg)
    {
    for (;;)
    malloc(A_LOT);
    }

    int main(void)
    {
    pthread_create(memory_hog_thread, ...);
    syscall(__NR_exit, 0);
    }

    Now, even if we fix PF_EXITING check, select_bad_process() will always
    ignore this process. The group leader has ->mm == NULL.

    See?

    That is why I think we need something like find_lock_task_mm() in the
    pseudo-patch I sent.

    Or I missed something?

    Oleg.



    \
     
     \ /
      Last update: 2010-04-02 13:19    [W:0.031 / U:63.620 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site