Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445578

[PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix
Date 2016-07-18 17:00 +0200
Message-ID <rWibw-7xJ-25@gated-at.bofh.it> (permalink)
References <rWibv-7xJ-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


As 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

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 include/linux/mm_inline.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index d29237428199..bcc4ed07fa90 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -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,
-- 
2.6.4

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Mel Gorman <mgorman@techsingularity.net> - 2016-07-18 17:00 +0200
  Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting  by approximating retries -fix Johannes Weiner <hannes@cmpxchg.org> - 2016-07-18 18:20 +0200
  Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting  by approximating retries -fix Minchan Kim <minchan@kernel.org> - 2016-07-19 02:00 +0200

csiph-web