Loading drivers/staging/android/lowmemorykiller.c +31 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,35 @@ void tune_lmk_zone_param(struct zonelist *zonelist, int classzone_idx, } } #ifdef CONFIG_HIGHMEM void adjust_gfp_mask(gfp_t *gfp_mask) { struct zone *preferred_zone; struct zonelist *zonelist; enum zone_type high_zoneidx; if (current_is_kswapd()) { zonelist = node_zonelist(0, *gfp_mask); high_zoneidx = gfp_zone(*gfp_mask); first_zones_zonelist(zonelist, high_zoneidx, NULL, &preferred_zone); if (high_zoneidx == ZONE_NORMAL) { if (zone_watermark_ok_safe(preferred_zone, 0, high_wmark_pages(preferred_zone), 0, 0)) *gfp_mask |= __GFP_HIGHMEM; } else if (high_zoneidx == ZONE_HIGHMEM) { *gfp_mask |= __GFP_HIGHMEM; } } } #else void adjust_gfp_mask(gfp_t *unused) { } #endif void tune_lmk_param(int *other_free, int *other_file, struct shrink_control *sc) { gfp_t gfp_mask; Loading @@ -175,6 +204,8 @@ void tune_lmk_param(int *other_free, int *other_file, struct shrink_control *sc) int use_cma_pages; gfp_mask = sc->gfp_mask; adjust_gfp_mask(&gfp_mask); zonelist = node_zonelist(0, gfp_mask); high_zoneidx = gfp_zone(gfp_mask); first_zones_zonelist(zonelist, high_zoneidx, NULL, &preferred_zone); Loading Loading
drivers/staging/android/lowmemorykiller.c +31 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,35 @@ void tune_lmk_zone_param(struct zonelist *zonelist, int classzone_idx, } } #ifdef CONFIG_HIGHMEM void adjust_gfp_mask(gfp_t *gfp_mask) { struct zone *preferred_zone; struct zonelist *zonelist; enum zone_type high_zoneidx; if (current_is_kswapd()) { zonelist = node_zonelist(0, *gfp_mask); high_zoneidx = gfp_zone(*gfp_mask); first_zones_zonelist(zonelist, high_zoneidx, NULL, &preferred_zone); if (high_zoneidx == ZONE_NORMAL) { if (zone_watermark_ok_safe(preferred_zone, 0, high_wmark_pages(preferred_zone), 0, 0)) *gfp_mask |= __GFP_HIGHMEM; } else if (high_zoneidx == ZONE_HIGHMEM) { *gfp_mask |= __GFP_HIGHMEM; } } } #else void adjust_gfp_mask(gfp_t *unused) { } #endif void tune_lmk_param(int *other_free, int *other_file, struct shrink_control *sc) { gfp_t gfp_mask; Loading @@ -175,6 +204,8 @@ void tune_lmk_param(int *other_free, int *other_file, struct shrink_control *sc) int use_cma_pages; gfp_mask = sc->gfp_mask; adjust_gfp_mask(&gfp_mask); zonelist = node_zonelist(0, gfp_mask); high_zoneidx = gfp_zone(gfp_mask); first_zones_zonelist(zonelist, high_zoneidx, NULL, &preferred_zone); Loading