lkml.org 
[lkml]   [2012]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 5/6] staging: android/lowmemorykiller: No need for task->signal check
    task->signal == NULL is not possible, so no need for these checks.

    Suggested-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
    ---
    drivers/staging/android/lowmemorykiller.c | 8 +-------
    1 files changed, 1 insertions(+), 7 deletions(-)

    diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
    index 0755e2f..6e800d3 100644
    --- a/drivers/staging/android/lowmemorykiller.c
    +++ b/drivers/staging/android/lowmemorykiller.c
    @@ -136,19 +136,13 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
    rcu_read_lock();
    for_each_process(tsk) {
    struct task_struct *p;
    - struct signal_struct *sig;
    int oom_adj;

    p = find_lock_task_mm(tsk);
    if (!p)
    continue;

    - sig = p->signal;
    - if (!sig) {
    - task_unlock(p);
    - continue;
    - }
    - oom_adj = sig->oom_adj;
    + oom_adj = p->signal->oom_adj;
    if (oom_adj < min_adj) {
    task_unlock(p);
    continue;
    --
    1.7.7.6


    \
     
     \ /
      Last update: 2012-02-06 17:33    [W:0.023 / U:31.976 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site