提交 ff321fea 编写于 作者: M Minchan Kim 提交者: Linus Torvalds

mm: rename try_set_zone_oom() to try_set_zonelist_oom()

We have been used naming try_set_zone_oom and clear_zonelist_oom.
The role of functions is to lock of zonelist for preventing parallel
OOM. So clear_zonelist_oom makes sense but try_set_zone_oome is rather
awkward and unmatched with clear_zonelist_oom.

Let's change it with try_set_zonelist_oom.
Signed-off-by: NMinchan Kim <minchan.kim@gmail.com>
Acked-by: NDavid Rientjes <rientjes@google.com>
Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b940fd70
...@@ -25,7 +25,7 @@ enum oom_constraint { ...@@ -25,7 +25,7 @@ enum oom_constraint {
CONSTRAINT_MEMCG, CONSTRAINT_MEMCG,
}; };
extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags); extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
......
...@@ -549,7 +549,7 @@ EXPORT_SYMBOL_GPL(unregister_oom_notifier); ...@@ -549,7 +549,7 @@ EXPORT_SYMBOL_GPL(unregister_oom_notifier);
* if a parallel OOM killing is already taking place that includes a zone in * if a parallel OOM killing is already taking place that includes a zone in
* the zonelist. Otherwise, locks all zones in the zonelist and returns 1. * the zonelist. Otherwise, locks all zones in the zonelist and returns 1.
*/ */
int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask) int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask)
{ {
struct zoneref *z; struct zoneref *z;
struct zone *zone; struct zone *zone;
...@@ -566,7 +566,7 @@ int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask) ...@@ -566,7 +566,7 @@ int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_mask)
for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) { for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) {
/* /*
* Lock each zone in the zonelist under zone_scan_lock so a * Lock each zone in the zonelist under zone_scan_lock so a
* parallel invocation of try_set_zone_oom() doesn't succeed * parallel invocation of try_set_zonelist_oom() doesn't succeed
* when it shouldn't. * when it shouldn't.
*/ */
zone_set_flag(zone, ZONE_OOM_LOCKED); zone_set_flag(zone, ZONE_OOM_LOCKED);
......
...@@ -1738,7 +1738,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, ...@@ -1738,7 +1738,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
struct page *page; struct page *page;
/* Acquire the OOM killer lock for the zones in zonelist */ /* Acquire the OOM killer lock for the zones in zonelist */
if (!try_set_zone_oom(zonelist, gfp_mask)) { if (!try_set_zonelist_oom(zonelist, gfp_mask)) {
schedule_timeout_uninterruptible(1); schedule_timeout_uninterruptible(1);
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册