All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20140902222653.GA20186@cmpxchg.org>

diff --git a/a/1.txt b/N1/1.txt
index f52c74e..af45879 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -48,3 +48,278 @@ On Tue, Sep 02, 2014 at 02:42:14PM -0700, David Rientjes wrote:
 Yikes, thanks for catching those and acking.  Updated patch:
 
 ---
+>From 2420ad16df0634e073ad327f0f72472d9b03762b Mon Sep 17 00:00:00 2001
+From: Johannes Weiner <hannes@cmpxchg.org>
+Date: Tue, 2 Sep 2014 10:14:36 -0400
+Subject: [patch] mm: clean up zone flags
+
+Page reclaim tests zone_is_reclaim_dirty(), but the site that actually
+sets this state does zone_set_flag(zone, ZONE_TAIL_LRU_DIRTY), sending
+the reader through layers indirection just to track down a simple bit.
+
+Remove all zone flag wrappers and just use bitops against zone->flags
+directly.  It's just as readable and the lines are barely any longer.
+
+Also rename ZONE_TAIL_LRU_DIRTY to ZONE_DIRTY to match ZONE_WRITEBACK,
+and remove the zone_flags_t typedef.
+
+Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
+Acked-by: David Rientjes <rientjes@google.com>
+---
+ include/linux/mmzone.h | 51 +++-----------------------------------------------
+ mm/backing-dev.c       |  2 +-
+ mm/oom_kill.c          |  6 +++---
+ mm/page_alloc.c        |  8 ++++----
+ mm/vmscan.c            | 28 +++++++++++++--------------
+ 5 files changed, 25 insertions(+), 70 deletions(-)
+
+diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
+index 318df7051850..48bf12ef6620 100644
+--- a/include/linux/mmzone.h
++++ b/include/linux/mmzone.h
+@@ -521,13 +521,13 @@ struct zone {
+ 	atomic_long_t		vm_stat[NR_VM_ZONE_STAT_ITEMS];
+ } ____cacheline_internodealigned_in_smp;
+ 
+-typedef enum {
++enum zone_flags {
+ 	ZONE_RECLAIM_LOCKED,		/* prevents concurrent reclaim */
+ 	ZONE_OOM_LOCKED,		/* zone is in OOM killer zonelist */
+ 	ZONE_CONGESTED,			/* zone has many dirty pages backed by
+ 					 * a congested BDI
+ 					 */
+-	ZONE_TAIL_LRU_DIRTY,		/* reclaim scanning has recently found
++	ZONE_DIRTY,			/* reclaim scanning has recently found
+ 					 * many dirty file pages at the tail
+ 					 * of the LRU.
+ 					 */
+@@ -535,52 +535,7 @@ typedef enum {
+ 					 * many pages under writeback
+ 					 */
+ 	ZONE_FAIR_DEPLETED,		/* fair zone policy batch depleted */
+-} zone_flags_t;
+-
+-static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
+-{
+-	set_bit(flag, &zone->flags);
+-}
+-
+-static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag)
+-{
+-	return test_and_set_bit(flag, &zone->flags);
+-}
+-
+-static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
+-{
+-	clear_bit(flag, &zone->flags);
+-}
+-
+-static inline int zone_is_reclaim_congested(const struct zone *zone)
+-{
+-	return test_bit(ZONE_CONGESTED, &zone->flags);
+-}
+-
+-static inline int zone_is_reclaim_dirty(const struct zone *zone)
+-{
+-	return test_bit(ZONE_TAIL_LRU_DIRTY, &zone->flags);
+-}
+-
+-static inline int zone_is_reclaim_writeback(const struct zone *zone)
+-{
+-	return test_bit(ZONE_WRITEBACK, &zone->flags);
+-}
+-
+-static inline int zone_is_reclaim_locked(const struct zone *zone)
+-{
+-	return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
+-}
+-
+-static inline int zone_is_fair_depleted(const struct zone *zone)
+-{
+-	return test_bit(ZONE_FAIR_DEPLETED, &zone->flags);
+-}
+-
+-static inline int zone_is_oom_locked(const struct zone *zone)
+-{
+-	return test_bit(ZONE_OOM_LOCKED, &zone->flags);
+-}
++};
+ 
+ static inline unsigned long zone_end_pfn(const struct zone *zone)
+ {
+diff --git a/mm/backing-dev.c b/mm/backing-dev.c
+index 1706cbbdf5f0..b27714f1b40f 100644
+--- a/mm/backing-dev.c
++++ b/mm/backing-dev.c
+@@ -631,7 +631,7 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout)
+ 	 * of sleeping on the congestion queue
+ 	 */
+ 	if (atomic_read(&nr_bdi_congested[sync]) == 0 ||
+-			!zone_is_reclaim_congested(zone)) {
++	    !test_bit(ZONE_CONGESTED, &zone->flags)) {
+ 		cond_resched();
+ 
+ 		/* In case we scheduled, work out time remaining */
+diff --git a/mm/oom_kill.c b/mm/oom_kill.c
+index 1e11df8fa7ec..bbf405a3a18f 100644
+--- a/mm/oom_kill.c
++++ b/mm/oom_kill.c
+@@ -565,7 +565,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
+ 
+ 	spin_lock(&zone_scan_lock);
+ 	for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
+-		if (zone_is_oom_locked(zone)) {
++		if (test_bit(ZONE_OOM_LOCKED, &zone->flags)) {
+ 			ret = false;
+ 			goto out;
+ 		}
+@@ -575,7 +575,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)
+ 	 * call to oom_zonelist_trylock() doesn't succeed when it shouldn't.
+ 	 */
+ 	for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
+-		zone_set_flag(zone, ZONE_OOM_LOCKED);
++		set_bit(ZONE_OOM_LOCKED, &zone->flags);
+ 
+ out:
+ 	spin_unlock(&zone_scan_lock);
+@@ -594,7 +594,7 @@ void oom_zonelist_unlock(struct zonelist *zonelist, gfp_t gfp_mask)
+ 
+ 	spin_lock(&zone_scan_lock);
+ 	for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))
+-		zone_clear_flag(zone, ZONE_OOM_LOCKED);
++		clear_bit(ZONE_OOM_LOCKED, &zone->flags);
+ 	spin_unlock(&zone_scan_lock);
+ }
+ 
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 18cee0d4c8a2..f0eb97de6cad 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -1613,8 +1613,8 @@ again:
+ 
+ 	__mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order));
+ 	if (zone_page_state(zone, NR_ALLOC_BATCH) == 0 &&
+-	    !zone_is_fair_depleted(zone))
+-		zone_set_flag(zone, ZONE_FAIR_DEPLETED);
++	    !test_bit(ZONE_FAIR_DEPLETED, &zone->flags))
++		set_bit(ZONE_FAIR_DEPLETED, &zone->flags);
+ 
+ 	__count_zone_vm_events(PGALLOC, zone, 1 << order);
+ 	zone_statistics(preferred_zone, zone, gfp_flags);
+@@ -1934,7 +1934,7 @@ static void reset_alloc_batches(struct zone *preferred_zone)
+ 		mod_zone_page_state(zone, NR_ALLOC_BATCH,
+ 			high_wmark_pages(zone) - low_wmark_pages(zone) -
+ 			atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));
+-		zone_clear_flag(zone, ZONE_FAIR_DEPLETED);
++		clear_bit(ZONE_FAIR_DEPLETED, &zone->flags);
+ 	} while (zone++ != preferred_zone);
+ }
+ 
+@@ -1985,7 +1985,7 @@ zonelist_scan:
+ 		if (alloc_flags & ALLOC_FAIR) {
+ 			if (!zone_local(preferred_zone, zone))
+ 				break;
+-			if (zone_is_fair_depleted(zone)) {
++			if (test_bit(ZONE_FAIR_DEPLETED, &zone->flags)) {
+ 				nr_fair_skipped++;
+ 				continue;
+ 			}
+diff --git a/mm/vmscan.c b/mm/vmscan.c
+index 2836b5373b2e..a14f1642759c 100644
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -920,7 +920,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
+ 			/* Case 1 above */
+ 			if (current_is_kswapd() &&
+ 			    PageReclaim(page) &&
+-			    zone_is_reclaim_writeback(zone)) {
++			    test_bit(ZONE_WRITEBACK, &zone->flags)) {
+ 				nr_immediate++;
+ 				goto keep_locked;
+ 
+@@ -1002,7 +1002,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
+ 			 */
+ 			if (page_is_file_cache(page) &&
+ 					(!current_is_kswapd() ||
+-					 !zone_is_reclaim_dirty(zone))) {
++					 !test_bit(ZONE_DIRTY, &zone->flags))) {
+ 				/*
+ 				 * Immediately reclaim when written back.
+ 				 * Similar in principal to deactivate_page()
+@@ -1563,7 +1563,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
+ 	 * are encountered in the nr_immediate check below.
+ 	 */
+ 	if (nr_writeback && nr_writeback == nr_taken)
+-		zone_set_flag(zone, ZONE_WRITEBACK);
++		set_bit(ZONE_WRITEBACK, &zone->flags);
+ 
+ 	/*
+ 	 * memcg will stall in page writeback so only consider forcibly
+@@ -1575,16 +1575,16 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
+ 		 * backed by a congested BDI and wait_iff_congested will stall.
+ 		 */
+ 		if (nr_dirty && nr_dirty == nr_congested)
+-			zone_set_flag(zone, ZONE_CONGESTED);
++			set_bit(ZONE_CONGESTED, &zone->flags);
+ 
+ 		/*
+ 		 * If dirty pages are scanned that are not queued for IO, it
+ 		 * implies that flushers are not keeping up. In this case, flag
+-		 * the zone ZONE_TAIL_LRU_DIRTY and kswapd will start writing
+-		 * pages from reclaim context.
++		 * the zone ZONE_DIRTY and kswapd will start writing pages from
++		 * reclaim context.
+ 		 */
+ 		if (nr_unqueued_dirty == nr_taken)
+-			zone_set_flag(zone, ZONE_TAIL_LRU_DIRTY);
++			set_bit(ZONE_DIRTY, &zone->flags);
+ 
+ 		/*
+ 		 * If kswapd scans pages marked marked for immediate
+@@ -2978,7 +2978,7 @@ static bool kswapd_shrink_zone(struct zone *zone,
+ 	/* Account for the number of pages attempted to reclaim */
+ 	*nr_attempted += sc->nr_to_reclaim;
+ 
+-	zone_clear_flag(zone, ZONE_WRITEBACK);
++	clear_bit(ZONE_WRITEBACK, &zone->flags);
+ 
+ 	/*
+ 	 * If a zone reaches its high watermark, consider it to be no longer
+@@ -2988,8 +2988,8 @@ static bool kswapd_shrink_zone(struct zone *zone,
+ 	 */
+ 	if (zone_reclaimable(zone) &&
+ 	    zone_balanced(zone, testorder, 0, classzone_idx)) {
+-		zone_clear_flag(zone, ZONE_CONGESTED);
+-		zone_clear_flag(zone, ZONE_TAIL_LRU_DIRTY);
++		clear_bit(ZONE_CONGESTED, &zone->flags);
++		clear_bit(ZONE_DIRTY, &zone->flags);
+ 	}
+ 
+ 	return sc->nr_scanned >= sc->nr_to_reclaim;
+@@ -3080,8 +3080,8 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
+ 				 * If balanced, clear the dirty and congested
+ 				 * flags
+ 				 */
+-				zone_clear_flag(zone, ZONE_CONGESTED);
+-				zone_clear_flag(zone, ZONE_TAIL_LRU_DIRTY);
++				clear_bit(ZONE_CONGESTED, &zone->flags);
++				clear_bit(ZONE_DIRTY, &zone->flags);
+ 			}
+ 		}
+ 
+@@ -3708,11 +3708,11 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
+ 	if (node_state(node_id, N_CPU) && node_id != numa_node_id())
+ 		return ZONE_RECLAIM_NOSCAN;
+ 
+-	if (zone_test_and_set_flag(zone, ZONE_RECLAIM_LOCKED))
++	if (test_and_set_bit(ZONE_RECLAIM_LOCKED, &zone->flags))
+ 		return ZONE_RECLAIM_NOSCAN;
+ 
+ 	ret = __zone_reclaim(zone, gfp_mask, order);
+-	zone_clear_flag(zone, ZONE_RECLAIM_LOCKED);
++	clear_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
+ 
+ 	if (!ret)
+ 		count_vm_event(PGSCAN_ZONE_RECLAIM_FAILED);
+-- 
+2.0.4
diff --git a/a/content_digest b/N1/content_digest
index 1a8b4a9..052483e 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -59,6 +59,281 @@
  "\n"
  "Yikes, thanks for catching those and acking.  Updated patch:\n"
  "\n"
- ---
+ "---\n"
+ ">From 2420ad16df0634e073ad327f0f72472d9b03762b Mon Sep 17 00:00:00 2001\n"
+ "From: Johannes Weiner <hannes@cmpxchg.org>\n"
+ "Date: Tue, 2 Sep 2014 10:14:36 -0400\n"
+ "Subject: [patch] mm: clean up zone flags\n"
+ "\n"
+ "Page reclaim tests zone_is_reclaim_dirty(), but the site that actually\n"
+ "sets this state does zone_set_flag(zone, ZONE_TAIL_LRU_DIRTY), sending\n"
+ "the reader through layers indirection just to track down a simple bit.\n"
+ "\n"
+ "Remove all zone flag wrappers and just use bitops against zone->flags\n"
+ "directly.  It's just as readable and the lines are barely any longer.\n"
+ "\n"
+ "Also rename ZONE_TAIL_LRU_DIRTY to ZONE_DIRTY to match ZONE_WRITEBACK,\n"
+ "and remove the zone_flags_t typedef.\n"
+ "\n"
+ "Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>\n"
+ "Acked-by: David Rientjes <rientjes@google.com>\n"
+ "---\n"
+ " include/linux/mmzone.h | 51 +++-----------------------------------------------\n"
+ " mm/backing-dev.c       |  2 +-\n"
+ " mm/oom_kill.c          |  6 +++---\n"
+ " mm/page_alloc.c        |  8 ++++----\n"
+ " mm/vmscan.c            | 28 +++++++++++++--------------\n"
+ " 5 files changed, 25 insertions(+), 70 deletions(-)\n"
+ "\n"
+ "diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h\n"
+ "index 318df7051850..48bf12ef6620 100644\n"
+ "--- a/include/linux/mmzone.h\n"
+ "+++ b/include/linux/mmzone.h\n"
+ "@@ -521,13 +521,13 @@ struct zone {\n"
+ " \tatomic_long_t\t\tvm_stat[NR_VM_ZONE_STAT_ITEMS];\n"
+ " } ____cacheline_internodealigned_in_smp;\n"
+ " \n"
+ "-typedef enum {\n"
+ "+enum zone_flags {\n"
+ " \tZONE_RECLAIM_LOCKED,\t\t/* prevents concurrent reclaim */\n"
+ " \tZONE_OOM_LOCKED,\t\t/* zone is in OOM killer zonelist */\n"
+ " \tZONE_CONGESTED,\t\t\t/* zone has many dirty pages backed by\n"
+ " \t\t\t\t\t * a congested BDI\n"
+ " \t\t\t\t\t */\n"
+ "-\tZONE_TAIL_LRU_DIRTY,\t\t/* reclaim scanning has recently found\n"
+ "+\tZONE_DIRTY,\t\t\t/* reclaim scanning has recently found\n"
+ " \t\t\t\t\t * many dirty file pages at the tail\n"
+ " \t\t\t\t\t * of the LRU.\n"
+ " \t\t\t\t\t */\n"
+ "@@ -535,52 +535,7 @@ typedef enum {\n"
+ " \t\t\t\t\t * many pages under writeback\n"
+ " \t\t\t\t\t */\n"
+ " \tZONE_FAIR_DEPLETED,\t\t/* fair zone policy batch depleted */\n"
+ "-} zone_flags_t;\n"
+ "-\n"
+ "-static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)\n"
+ "-{\n"
+ "-\tset_bit(flag, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag)\n"
+ "-{\n"
+ "-\treturn test_and_set_bit(flag, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)\n"
+ "-{\n"
+ "-\tclear_bit(flag, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_reclaim_congested(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_CONGESTED, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_reclaim_dirty(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_TAIL_LRU_DIRTY, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_reclaim_writeback(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_WRITEBACK, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_reclaim_locked(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_fair_depleted(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_FAIR_DEPLETED, &zone->flags);\n"
+ "-}\n"
+ "-\n"
+ "-static inline int zone_is_oom_locked(const struct zone *zone)\n"
+ "-{\n"
+ "-\treturn test_bit(ZONE_OOM_LOCKED, &zone->flags);\n"
+ "-}\n"
+ "+};\n"
+ " \n"
+ " static inline unsigned long zone_end_pfn(const struct zone *zone)\n"
+ " {\n"
+ "diff --git a/mm/backing-dev.c b/mm/backing-dev.c\n"
+ "index 1706cbbdf5f0..b27714f1b40f 100644\n"
+ "--- a/mm/backing-dev.c\n"
+ "+++ b/mm/backing-dev.c\n"
+ "@@ -631,7 +631,7 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout)\n"
+ " \t * of sleeping on the congestion queue\n"
+ " \t */\n"
+ " \tif (atomic_read(&nr_bdi_congested[sync]) == 0 ||\n"
+ "-\t\t\t!zone_is_reclaim_congested(zone)) {\n"
+ "+\t    !test_bit(ZONE_CONGESTED, &zone->flags)) {\n"
+ " \t\tcond_resched();\n"
+ " \n"
+ " \t\t/* In case we scheduled, work out time remaining */\n"
+ "diff --git a/mm/oom_kill.c b/mm/oom_kill.c\n"
+ "index 1e11df8fa7ec..bbf405a3a18f 100644\n"
+ "--- a/mm/oom_kill.c\n"
+ "+++ b/mm/oom_kill.c\n"
+ "@@ -565,7 +565,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)\n"
+ " \n"
+ " \tspin_lock(&zone_scan_lock);\n"
+ " \tfor_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))\n"
+ "-\t\tif (zone_is_oom_locked(zone)) {\n"
+ "+\t\tif (test_bit(ZONE_OOM_LOCKED, &zone->flags)) {\n"
+ " \t\t\tret = false;\n"
+ " \t\t\tgoto out;\n"
+ " \t\t}\n"
+ "@@ -575,7 +575,7 @@ bool oom_zonelist_trylock(struct zonelist *zonelist, gfp_t gfp_mask)\n"
+ " \t * call to oom_zonelist_trylock() doesn't succeed when it shouldn't.\n"
+ " \t */\n"
+ " \tfor_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))\n"
+ "-\t\tzone_set_flag(zone, ZONE_OOM_LOCKED);\n"
+ "+\t\tset_bit(ZONE_OOM_LOCKED, &zone->flags);\n"
+ " \n"
+ " out:\n"
+ " \tspin_unlock(&zone_scan_lock);\n"
+ "@@ -594,7 +594,7 @@ void oom_zonelist_unlock(struct zonelist *zonelist, gfp_t gfp_mask)\n"
+ " \n"
+ " \tspin_lock(&zone_scan_lock);\n"
+ " \tfor_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask))\n"
+ "-\t\tzone_clear_flag(zone, ZONE_OOM_LOCKED);\n"
+ "+\t\tclear_bit(ZONE_OOM_LOCKED, &zone->flags);\n"
+ " \tspin_unlock(&zone_scan_lock);\n"
+ " }\n"
+ " \n"
+ "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n"
+ "index 18cee0d4c8a2..f0eb97de6cad 100644\n"
+ "--- a/mm/page_alloc.c\n"
+ "+++ b/mm/page_alloc.c\n"
+ "@@ -1613,8 +1613,8 @@ again:\n"
+ " \n"
+ " \t__mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order));\n"
+ " \tif (zone_page_state(zone, NR_ALLOC_BATCH) == 0 &&\n"
+ "-\t    !zone_is_fair_depleted(zone))\n"
+ "-\t\tzone_set_flag(zone, ZONE_FAIR_DEPLETED);\n"
+ "+\t    !test_bit(ZONE_FAIR_DEPLETED, &zone->flags))\n"
+ "+\t\tset_bit(ZONE_FAIR_DEPLETED, &zone->flags);\n"
+ " \n"
+ " \t__count_zone_vm_events(PGALLOC, zone, 1 << order);\n"
+ " \tzone_statistics(preferred_zone, zone, gfp_flags);\n"
+ "@@ -1934,7 +1934,7 @@ static void reset_alloc_batches(struct zone *preferred_zone)\n"
+ " \t\tmod_zone_page_state(zone, NR_ALLOC_BATCH,\n"
+ " \t\t\thigh_wmark_pages(zone) - low_wmark_pages(zone) -\n"
+ " \t\t\tatomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));\n"
+ "-\t\tzone_clear_flag(zone, ZONE_FAIR_DEPLETED);\n"
+ "+\t\tclear_bit(ZONE_FAIR_DEPLETED, &zone->flags);\n"
+ " \t} while (zone++ != preferred_zone);\n"
+ " }\n"
+ " \n"
+ "@@ -1985,7 +1985,7 @@ zonelist_scan:\n"
+ " \t\tif (alloc_flags & ALLOC_FAIR) {\n"
+ " \t\t\tif (!zone_local(preferred_zone, zone))\n"
+ " \t\t\t\tbreak;\n"
+ "-\t\t\tif (zone_is_fair_depleted(zone)) {\n"
+ "+\t\t\tif (test_bit(ZONE_FAIR_DEPLETED, &zone->flags)) {\n"
+ " \t\t\t\tnr_fair_skipped++;\n"
+ " \t\t\t\tcontinue;\n"
+ " \t\t\t}\n"
+ "diff --git a/mm/vmscan.c b/mm/vmscan.c\n"
+ "index 2836b5373b2e..a14f1642759c 100644\n"
+ "--- a/mm/vmscan.c\n"
+ "+++ b/mm/vmscan.c\n"
+ "@@ -920,7 +920,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,\n"
+ " \t\t\t/* Case 1 above */\n"
+ " \t\t\tif (current_is_kswapd() &&\n"
+ " \t\t\t    PageReclaim(page) &&\n"
+ "-\t\t\t    zone_is_reclaim_writeback(zone)) {\n"
+ "+\t\t\t    test_bit(ZONE_WRITEBACK, &zone->flags)) {\n"
+ " \t\t\t\tnr_immediate++;\n"
+ " \t\t\t\tgoto keep_locked;\n"
+ " \n"
+ "@@ -1002,7 +1002,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,\n"
+ " \t\t\t */\n"
+ " \t\t\tif (page_is_file_cache(page) &&\n"
+ " \t\t\t\t\t(!current_is_kswapd() ||\n"
+ "-\t\t\t\t\t !zone_is_reclaim_dirty(zone))) {\n"
+ "+\t\t\t\t\t !test_bit(ZONE_DIRTY, &zone->flags))) {\n"
+ " \t\t\t\t/*\n"
+ " \t\t\t\t * Immediately reclaim when written back.\n"
+ " \t\t\t\t * Similar in principal to deactivate_page()\n"
+ "@@ -1563,7 +1563,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,\n"
+ " \t * are encountered in the nr_immediate check below.\n"
+ " \t */\n"
+ " \tif (nr_writeback && nr_writeback == nr_taken)\n"
+ "-\t\tzone_set_flag(zone, ZONE_WRITEBACK);\n"
+ "+\t\tset_bit(ZONE_WRITEBACK, &zone->flags);\n"
+ " \n"
+ " \t/*\n"
+ " \t * memcg will stall in page writeback so only consider forcibly\n"
+ "@@ -1575,16 +1575,16 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,\n"
+ " \t\t * backed by a congested BDI and wait_iff_congested will stall.\n"
+ " \t\t */\n"
+ " \t\tif (nr_dirty && nr_dirty == nr_congested)\n"
+ "-\t\t\tzone_set_flag(zone, ZONE_CONGESTED);\n"
+ "+\t\t\tset_bit(ZONE_CONGESTED, &zone->flags);\n"
+ " \n"
+ " \t\t/*\n"
+ " \t\t * If dirty pages are scanned that are not queued for IO, it\n"
+ " \t\t * implies that flushers are not keeping up. In this case, flag\n"
+ "-\t\t * the zone ZONE_TAIL_LRU_DIRTY and kswapd will start writing\n"
+ "-\t\t * pages from reclaim context.\n"
+ "+\t\t * the zone ZONE_DIRTY and kswapd will start writing pages from\n"
+ "+\t\t * reclaim context.\n"
+ " \t\t */\n"
+ " \t\tif (nr_unqueued_dirty == nr_taken)\n"
+ "-\t\t\tzone_set_flag(zone, ZONE_TAIL_LRU_DIRTY);\n"
+ "+\t\t\tset_bit(ZONE_DIRTY, &zone->flags);\n"
+ " \n"
+ " \t\t/*\n"
+ " \t\t * If kswapd scans pages marked marked for immediate\n"
+ "@@ -2978,7 +2978,7 @@ static bool kswapd_shrink_zone(struct zone *zone,\n"
+ " \t/* Account for the number of pages attempted to reclaim */\n"
+ " \t*nr_attempted += sc->nr_to_reclaim;\n"
+ " \n"
+ "-\tzone_clear_flag(zone, ZONE_WRITEBACK);\n"
+ "+\tclear_bit(ZONE_WRITEBACK, &zone->flags);\n"
+ " \n"
+ " \t/*\n"
+ " \t * If a zone reaches its high watermark, consider it to be no longer\n"
+ "@@ -2988,8 +2988,8 @@ static bool kswapd_shrink_zone(struct zone *zone,\n"
+ " \t */\n"
+ " \tif (zone_reclaimable(zone) &&\n"
+ " \t    zone_balanced(zone, testorder, 0, classzone_idx)) {\n"
+ "-\t\tzone_clear_flag(zone, ZONE_CONGESTED);\n"
+ "-\t\tzone_clear_flag(zone, ZONE_TAIL_LRU_DIRTY);\n"
+ "+\t\tclear_bit(ZONE_CONGESTED, &zone->flags);\n"
+ "+\t\tclear_bit(ZONE_DIRTY, &zone->flags);\n"
+ " \t}\n"
+ " \n"
+ " \treturn sc->nr_scanned >= sc->nr_to_reclaim;\n"
+ "@@ -3080,8 +3080,8 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,\n"
+ " \t\t\t\t * If balanced, clear the dirty and congested\n"
+ " \t\t\t\t * flags\n"
+ " \t\t\t\t */\n"
+ "-\t\t\t\tzone_clear_flag(zone, ZONE_CONGESTED);\n"
+ "-\t\t\t\tzone_clear_flag(zone, ZONE_TAIL_LRU_DIRTY);\n"
+ "+\t\t\t\tclear_bit(ZONE_CONGESTED, &zone->flags);\n"
+ "+\t\t\t\tclear_bit(ZONE_DIRTY, &zone->flags);\n"
+ " \t\t\t}\n"
+ " \t\t}\n"
+ " \n"
+ "@@ -3708,11 +3708,11 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)\n"
+ " \tif (node_state(node_id, N_CPU) && node_id != numa_node_id())\n"
+ " \t\treturn ZONE_RECLAIM_NOSCAN;\n"
+ " \n"
+ "-\tif (zone_test_and_set_flag(zone, ZONE_RECLAIM_LOCKED))\n"
+ "+\tif (test_and_set_bit(ZONE_RECLAIM_LOCKED, &zone->flags))\n"
+ " \t\treturn ZONE_RECLAIM_NOSCAN;\n"
+ " \n"
+ " \tret = __zone_reclaim(zone, gfp_mask, order);\n"
+ "-\tzone_clear_flag(zone, ZONE_RECLAIM_LOCKED);\n"
+ "+\tclear_bit(ZONE_RECLAIM_LOCKED, &zone->flags);\n"
+ " \n"
+ " \tif (!ret)\n"
+ " \t\tcount_vm_event(PGSCAN_ZONE_RECLAIM_FAILED);\n"
+ "-- \n"
+ 2.0.4
 
-de3f8fc8d3e2574db030e3bb8e44680f205a4b8fc66a429b62fc0287e4bca291
+31d12aea8fe607abd6cf678b6b5b1f109cb95a06c3ff245b9e07d32361311f7a

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.