From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751891AbcGROub (ORCPT ); Mon, 18 Jul 2016 10:50:31 -0400 Received: from outbound-smtp03.blacknight.com ([81.17.249.16]:57335 "EHLO outbound-smtp03.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbcGROu3 (ORCPT ); Mon, 18 Jul 2016 10:50:29 -0400 From: Mel Gorman To: Andrew Morton Cc: Johannes Weiner , Minchan Kim , Vlastimil Babka , Linux-MM , LKML , Mel Gorman Subject: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Date: Mon, 18 Jul 2016 15:50:26 +0100 Message-Id: <1468853426-12858-4-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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