[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1468853426-12858-4-git-send-email-mgorman@techsingularity.net>
Date: Mon, 18 Jul 2016 15:50:26 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Weiner <hannes@...xchg.org>,
Minchan Kim <minchan@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix
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@...hsingularity.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
Powered by blists - more mailing lists