diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index d8893dc2d4eb..e1471385d001 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1108,8 +1108,6 @@ static unsigned long shrink_zone(int priority, struct zone *zone, | |||
1108 | unsigned long nr_to_scan; | 1108 | unsigned long nr_to_scan; |
1109 | unsigned long nr_reclaimed = 0; | 1109 | unsigned long nr_reclaimed = 0; |
1110 | 1110 | ||
1111 | zone_set_flag(zone, ZONE_RECLAIM_LOCKED); | ||
1112 | |||
1113 | /* | 1111 | /* |
1114 | * Add one to `nr_to_scan' just to make sure that the kernel will | 1112 | * Add one to `nr_to_scan' just to make sure that the kernel will |
1115 | * slowly sift through the active list. | 1113 | * slowly sift through the active list. |
@@ -1148,8 +1146,6 @@ static unsigned long shrink_zone(int priority, struct zone *zone, | |||
1148 | } | 1146 | } |
1149 | 1147 | ||
1150 | throttle_vm_writeout(sc->gfp_mask); | 1148 | throttle_vm_writeout(sc->gfp_mask); |
1151 | |||
1152 | zone_clear_flag(zone, ZONE_RECLAIM_LOCKED); | ||
1153 | return nr_reclaimed; | 1149 | return nr_reclaimed; |
1154 | } | 1150 | } |
1155 | 1151 | ||
@@ -1900,6 +1896,7 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
1900 | int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | 1896 | int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) |
1901 | { | 1897 | { |
1902 | int node_id; | 1898 | int node_id; |
1899 | int ret; | ||
1903 | 1900 | ||
1904 | /* | 1901 | /* |
1905 | * Zone reclaim reclaims unmapped file backed pages and | 1902 | * Zone reclaim reclaims unmapped file backed pages and |
@@ -1917,13 +1914,13 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
1917 | <= zone->min_slab_pages) | 1914 | <= zone->min_slab_pages) |
1918 | return 0; | 1915 | return 0; |
1919 | 1916 | ||
1917 | if (zone_is_all_unreclaimable(zone)) | ||
1918 | return 0; | ||
1919 | |||
1920 | /* | 1920 | /* |
1921 | * Avoid concurrent zone reclaims, do not reclaim in a zone that does | 1921 | * Do not scan if the allocation should not be delayed. |
1922 | * not have reclaimable pages and if we should not delay the allocation | ||
1923 | * then do not scan. | ||
1924 | */ | 1922 | */ |
1925 | if (!(gfp_mask & __GFP_WAIT) || zone_is_all_unreclaimable(zone) || | 1923 | if (!(gfp_mask & __GFP_WAIT) || (current->flags & PF_MEMALLOC)) |
1926 | zone_is_reclaim_locked(zone) || (current->flags & PF_MEMALLOC)) | ||
1927 | return 0; | 1924 | return 0; |
1928 | 1925 | ||
1929 | /* | 1926 | /* |
@@ -1935,6 +1932,12 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
1935 | node_id = zone_to_nid(zone); | 1932 | node_id = zone_to_nid(zone); |
1936 | if (node_state(node_id, N_CPU) && node_id != numa_node_id()) | 1933 | if (node_state(node_id, N_CPU) && node_id != numa_node_id()) |
1937 | return 0; | 1934 | return 0; |
1938 | return __zone_reclaim(zone, gfp_mask, order); | 1935 | |
1936 | if (zone_test_and_set_flag(zone, ZONE_RECLAIM_LOCKED)) | ||
1937 | return 0; | ||
1938 | ret = __zone_reclaim(zone, gfp_mask, order); | ||
1939 | zone_clear_flag(zone, ZONE_RECLAIM_LOCKED); | ||
1940 | |||
1941 | return ret; | ||
1939 | } | 1942 | } |
1940 | #endif | 1943 | #endif |