Follow-up fixes to node-lru series v3
Subsystems (4)
cover Follow-up fixes to node-lru series v3
This is another round of fixups to the node-lru series. The most important patch is the last one which deals with a highmem accounting issue.
include/linux/mm_inline.h | 8 ++------ mm/vmscan.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 20 deletions(-)
Signature · 7 lines
2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 2/3 mm, vmscan: Release/reacquire lru_lock on pgdat change
With node-lru, the locking is based on the pgdat. As Minchan pointed out, there is an opportunity to reduce LRU lock release/acquire in check_move_unevictable_pages by only changing lock on a pgdat change.
--- mm/vmscan.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
mm/vmscan.c +11 -11
@@ -3775,24 +3775,24 @@ int page_evictable(struct page *page)void check_move_unevictable_pages (struct page **pages,int nr_pages) {struct lruvec *lruvec; -struct zone *zone =NULL ; +struct pglist_data *pgdat =NULL ;int pgscanned =0 ;int pgrescued =0 ;int i;for (i =0 ; i < nr_pages; i++) {struct page *page = pages[i]; -struct zone *pagezone; +struct pglist_data *pagepgdat =page_pgdat (page); pgscanned++; - pagezone =page_zone (page); -if (pagezone != zone) { -if (zone) -spin_unlock_irq (zone_lru_lock (zone)); - zone = pagezone; -spin_lock_irq (zone_lru_lock (zone)); + pagepgdat =page_pgdat (page); +if (pagepgdat != pgdat) { +if (pgdat) +spin_unlock_irq (&pgdat->lru_lock); + pgdat = pagepgdat; +spin_lock_irq (&pgdat->lru_lock); } - lruvec =mem_cgroup_page_lruvec (page, zone->zone_pgdat); + lruvec =mem_cgroup_page_lruvec (page, pgdat);if (!PageLRU (page) || !PageUnevictable (page))continue ;
@@ -3808,10 +3808,10 @@ void check_move_unevictable_pages(struct page **pages, int nr_pages) } } -if (zone) { +if (pgdat) {__count_vm_events (UNEVICTABLE_PGRESCUED , pgrescued);__count_vm_events (UNEVICTABLE_PGSCANNED , pgscanned); -spin_unlock_irq (zone_lru_lock (zone)); +spin_unlock_irq (&pgdat->lru_lock); } }#endif /* CONFIG_SHMEM */
Signature · 7 lines
2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 3/3 mm, vmstat: remove zone and node double accounting by approximating retries -fix
In reply to Mel GormanAs pointed out by Vlastimil, the atomic_add() functions are already assumed to be able to handle negative numbers. The atomic_sub handling was wrong anyway but this patch fixes it unconditionally.
This is a fix to the mmotm patch mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch
--- include/linux/mm_inline.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
include/linux/mm_inline.h +2 -6
@@ -10,12 +10,8 @@ extern atomic_t highmem_file_pages;static inline void acct_highmem_file_pages (int zid,enum lru_list lru,int nr_pages) { -if (is_highmem_idx (zid) &&is_file_lru (lru)) { -if (nr_pages >0 ) -atomic_add (nr_pages, &highmem_file_pages); -else -atomic_sub (nr_pages, &highmem_file_pages); - } +if (is_highmem_idx (zid) &&is_file_lru (lru)) +atomic_add (nr_pages, &highmem_file_pages); }#else static inline void acct_highmem_file_pages(int zid, enum lru_list lru,
Signature · 1 line
2.6.4
PATCH 1/3 mm, vmscan: Remove redundant check in shrink_zones()
In reply to Mel GormanAs pointed out by Minchan Kim, shrink_zones() checks for populated zones in a zonelist but a zonelist can never contain unpopulated zones. While it's not related to the node-lru series, it can be cleaned up now.
--- mm/vmscan.c | 3 --- 1 file changed, 3 deletions(-)
mm/vmscan.c +0 -3
@@ -2605,9 +2605,6 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc)for_each_zone_zonelist_nodemask (zone, z, zonelist, sc->reclaim_idx, sc->nodemask) { -if (!populated_zone (zone)) -continue ; -/* * Take care memory controller reclaiming has small influence * to global LRU.
Signature · 7 lines
2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones()
Quoted 7 lines · Mel Gorman
As pointed out by Minchan Kim,
shrink_zones()checks for populated zones in a zonelist but a zonelist can never contain unpopulated zones. While it's not related to the node-lru series, it can be cleaned up now.Suggested-by Minchan Kim <[email protected]>Signed-off-by Mel Gorman <[email protected]>
Ha, I didn't know that. But yeah, the zonelist building code excludes unpopulated zones from the start. Neat.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change
In reply to Mel GormanQuoted 5 lines · Mel Gorman
With node-lru, the locking is based on the pgdat. As Minchan pointed out, there is an opportunity to reduce LRU lock release/acquire in
check_move_unevictable_pagesby only changing lock on a pgdat change.Signed-off-by Mel Gorman <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix
In reply to Mel GormanQuoted 8 lines · Mel Gorman
As pointed out by Vlastimil, the
atomic_add()functions are already assumed to be able to handle negative numbers. Theatomic_subhandling was wrong anyway but this patch fixes it unconditionally.This is a fix to the mmotm patch mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch
Signed-off-by Mel Gorman <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Johannes Weiner
maintainerThe v3 is a bit misleading. It's on top of, not instead of, the v2 series with the same name sent out previously. We need both series.
Quoted 6 lines · Mel Gorman
This is another round of fixups to the node-lru series. The most important patch is the last one which deals with a highmem accounting issue.
include/linux/mm_inline.h | 8 ++------ mm/vmscan.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 20 deletions(-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones()
In reply to Mel GormanQuoted 7 lines · Mel Gorman
As pointed out by Minchan Kim,
shrink_zones()checks for populated zones in a zonelist but a zonelist can never contain unpopulated zones. While it's not related to the node-lru series, it can be cleaned up now.Suggested-by Minchan Kim <[email protected]>Signed-off-by Mel Gorman <[email protected]>
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change
In reply to Mel GormanQuoted 17 lines · Mel Gorman
With node-lru, the locking is based on the pgdat. As Minchan pointed out, there is an opportunity to reduce LRU lock release/acquire in
check_move_unevictable_pagesby only changing lock on a pgdat change.Signed-off-by Mel Gorman <[email protected]>--- mm/vmscan.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)mm/vmscan.c +0
-0@@ -3775,24 +3775,24 @@ int page_evictable(struct page *page)void check_move_unevictable_pages (struct page **pages,int nr_pages) {struct lruvec *lruvec;
mm/vmscan.c int page_evictable(struct page *page) · line 3785
Quoted 10 lines
mm/vmscan.c +2
-2-struct zone *zone =NULL ; +struct pglist_data *pgdat =NULL ;int pgscanned =0 ;int pgrescued =0 ;int i;for (i =0 ; i < nr_pages; i++) {struct page *page = pages[i]; -struct zone *pagezone; +struct pglist_data *pagepgdat =page_pgdat (page);
No need to initialize in here.
mm/vmscan.c int page_evictable(struct page *page) · line 3788
Quoted 9 lines
mm/vmscan.c +1
-6pgscanned++; - pagezone =page_zone (page); -if (pagezone != zone) { -if (zone) -spin_unlock_irq (zone_lru_lock (zone)); - zone = pagezone; -spin_lock_irq (zone_lru_lock (zone)); + pagepgdat =page_pgdat (page);
Double initialize. Please remove either one.
Quoted 27 lines
mm/vmscan.c +8
-3+if (pagepgdat != pgdat) { +if (pgdat) +spin_unlock_irq (&pgdat->lru_lock); + pgdat = pagepgdat; +spin_lock_irq (&pgdat->lru_lock); } - lruvec =mem_cgroup_page_lruvec (page, zone->zone_pgdat); + lruvec =mem_cgroup_page_lruvec (page, pgdat);if (!PageLRU (page) || !PageUnevictable (page))continue ;@@ -3808,10 +3808,10 @@ void check_move_unevictable_pages(struct page **pages, int nr_pages) } } -if (zone) { +if (pgdat) {__count_vm_events (UNEVICTABLE_PGRESCUED , pgrescued);__count_vm_events (UNEVICTABLE_PGSCANNED , pgscanned); -spin_unlock_irq (zone_lru_lock (zone)); +spin_unlock_irq (&pgdat->lru_lock); } }#endif /* CONFIG_SHMEM */ Signature · 1 line
2.6.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix
In reply to Mel GormanQuoted 8 lines · Mel Gorman
As pointed out by Vlastimil, the
atomic_add()functions are already assumed to be able to handle negative numbers. Theatomic_subhandling was wrong anyway but this patch fixes it unconditionally.This is a fix to the mmotm patch mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch
Signed-off-by Mel Gorman <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>