From 4a3dfd10dcbf36f1a68a950d87deb2dc977c40ef Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 9 Mar 2016 11:11:06 +1100 Subject: [PATCH] mm-oom-rework-oom-detection-checkpatch-fixes Cc: David Rientjes WARNING: line over 80 characters #99: FILE: mm/page_alloc.c:2965: + * zone list (with a backoff mechanism which is a function of no_progress_loops). WARNING: line over 80 characters #129: FILE: mm/page_alloc.c:2995: + * Keep reclaiming pages while there is a chance this will lead somewhere. WARNING: line over 80 characters #134: FILE: mm/page_alloc.c:3000: + for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, ac->high_zoneidx, ac->nodemask) { WARNING: line over 80 characters #138: FILE: mm/page_alloc.c:3004: + available -= DIV_ROUND_UP(no_progress_loops * available, MAX_RECLAIM_RETRIES); WARNING: line over 80 characters #142: FILE: mm/page_alloc.c:3008: + * Would the allocation succeed if we reclaimed the whole available? WARNING: line over 80 characters #146: FILE: mm/page_alloc.c:3012: + /* Wait for some write requests to complete then retry */ total: 0 errors, 6 warnings, 202 lines checked ./patches/mm-oom-rework-oom-detection.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: David Rientjes Cc: Hillf Danton Cc: Johannes Weiner Cc: KAMEZAWA Hiroyuki Cc: Mel Gorman Cc: Michal Hocko Cc: Tetsuo Handa Signed-off-by: Andrew Morton --- mm/page_alloc.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5f2002ffba0bf4..08e63aba325098 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3096,7 +3096,8 @@ static inline bool is_thp_gfp_mask(gfp_t gfp_mask) * the last reclaim round), pages_reclaimed (cumulative number of reclaimed * pages) and no_progress_loops (number of reclaim rounds without any progress * in a row) is considered as well as the reclaimable pages on the applicable - * zone list (with a backoff mechanism which is a function of no_progress_loops). + * zone list (with a backoff mechanism which is a function of + * no_progress_loops). * * Returns true if a retry is viable or false to enter the oom path. */ @@ -3126,24 +3127,27 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, } /* - * Keep reclaiming pages while there is a chance this will lead somewhere. - * If none of the target zones can satisfy our allocation request even - * if all reclaimable pages are considered then we are screwed and have - * to go OOM. + * Keep reclaiming pages while there is a chance this will lead + * somewhere. If none of the target zones can satisfy our allocation + * request even if all reclaimable pages are considered then we are + * screwed and have to go OOM. */ - for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, ac->high_zoneidx, ac->nodemask) { + for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, + ac->high_zoneidx, ac->nodemask) { unsigned long available; available = zone_reclaimable_pages(zone); - available -= DIV_ROUND_UP(no_progress_loops * available, MAX_RECLAIM_RETRIES); + available -= DIV_ROUND_UP(no_progress_loops * available, + MAX_RECLAIM_RETRIES); available += zone_page_state_snapshot(zone, NR_FREE_PAGES); /* - * Would the allocation succeed if we reclaimed the whole available? + * Would the allocation succeed if we reclaimed the whole + * available? */ if (__zone_watermark_ok(zone, order, min_wmark_pages(zone), ac->high_zoneidx, alloc_flags, available)) { - /* Wait for some write requests to complete then retry */ + /* Wait for some writes to complete then retry */ wait_iff_congested(zone, BLK_RW_ASYNC, HZ/50); return true; }