Skip to content

Commit

Permalink
oom: fix zone_scan_mutex name
Browse files Browse the repository at this point in the history
zone_scan_mutex is actually a spinlock, so name it appropriately.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Rientjes authored and Linus Torvalds committed Jan 6, 2009
1 parent 1c0fe6e commit c7d4cae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/**
Expand Down Expand Up @@ -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;
Expand All @@ -480,15 +480,15 @@ 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.
*/
zone_set_flag(zone, ZONE_OOM_LOCKED);
}

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

Expand All @@ -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);
}

/*
Expand Down

0 comments on commit c7d4cae

Please sign in to comment.