[patch] oom: fix zone_scan_mutex name - Kernel

This is a discussion on [patch] oom: fix zone_scan_mutex name - Kernel ; zone_scan_mutex is actually a spinlock, so name it appropriately. Signed-off-by: David Rientjes --- mm/oom_kill.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -31,7 +31,7 @@ int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [patch] oom: fix zone_scan_mutex name

  1. [patch] oom: fix zone_scan_mutex name

    zone_scan_mutex is actually a spinlock, so name it appropriately.

    Signed-off-by: David Rientjes
    ---
    mm/oom_kill.c | 12 ++++++------
    1 files changed, 6 insertions(+), 6 deletions(-)

    diff --git a/mm/oom_kill.c b/mm/oom_kill.c
    --- a/mm/oom_kill.c
    +++ b/mm/oom_kill.c
    @@ -31,7 +31,7 @@
    int sysctl_panic_on_oom;
    int sysctl_oom_kill_allocating_task;
    int sysctl_oom_dump_tasks;
    -static DEFINE_SPINLOCK(zone_scan_mutex);
    +static DEFINE_SPINLOCK(zone_scan_lock);
    /* #define DEBUG */

    /**
    @@ -470,7 +470,7 @@ int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask)
    struct zone *zone;
    int ret = 1;

    - spin_lock(&zone_scan_mutex);
    + spin_lock(&zone_scan_lock);
    for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) {
    if (zone_is_oom_locked(zone)) {
    ret = 0;
    @@ -480,7 +480,7 @@ int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask)

    for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) {
    /*
    - * Lock each zone in the zonelist under zone_scan_mutex so a
    + * Lock each zone in the zonelist under zone_scan_lock so a
    * parallel invocation of try_set_zone_oom() doesn't succeed
    * when it shouldn't.
    */
    @@ -488,7 +488,7 @@ int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask)
    }

    out:
    - spin_unlock(&zone_scan_mutex);
    + spin_unlock(&zone_scan_lock);
    return ret;
    }

    @@ -502,11 +502,11 @@ void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask)
    struct zoneref *z;
    struct zone *zone;

    - spin_lock(&zone_scan_mutex);
    + spin_lock(&zone_scan_lock);
    for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) {
    zone_clear_flag(zone, ZONE_OOM_LOCKED);
    }
    - spin_unlock(&zone_scan_mutex);
    + spin_unlock(&zone_scan_lock);
    }

    /**
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [patch] oom: fix zone_scan_mutex name

    > zone_scan_mutex is actually a spinlock, so name it appropriately.
    >
    > Signed-off-by: David Rientjes


    looks good to me.

    Reviewed-by: KOSAKI Motohiro



    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread