lkml.org 
[lkml]   [2016]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix
Date
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
\
 
 \ /
  Last update: 2016-07-18 17:41    [W:0.068 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site