Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753940AbaBDA6p (ORCPT ); Mon, 3 Feb 2014 19:58:45 -0500 Received: from zene.cmpxchg.org ([85.214.230.12]:56937 "EHLO zene.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbaBDA6j (ORCPT ); Mon, 3 Feb 2014 19:58:39 -0500 From: Johannes Weiner To: Andrew Morton Cc: Andi Kleen , Andrea Arcangeli , Bob Liu , Christoph Hellwig , Dave Chinner , Greg Thelen , Hugh Dickins , Jan Kara , KOSAKI Motohiro , Luigi Semenzato , Mel Gorman , Metin Doslu , Michel Lespinasse , Minchan Kim , Ozgun Erdogan , Peter Zijlstra , Rik van Riel , Roman Gushchin , Ryan Mallon , Tejun Heo , Vlastimil Babka , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [patch 01/10] mm: vmstat: fix UP zone state accounting Date: Mon, 3 Feb 2014 19:53:33 -0500 Message-Id: <1391475222-1169-2-git-send-email-hannes@cmpxchg.org> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1391475222-1169-1-git-send-email-hannes@cmpxchg.org> References: <1391475222-1169-1-git-send-email-hannes@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fengguang Wu's build testing spotted problems with inc_zone_state() and dec_zone_state() on UP configurations in out-of-tree patches. inc_zone_state() is declared but not defined, dec_zone_state() is missing entirely. Just like with *_zone_page_state(), they can be defined like their preemption-unsafe counterparts on UP. Signed-off-by: Johannes Weiner --- include/linux/vmstat.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index a67b38415768..a32dbd2c2155 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -179,8 +179,6 @@ extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp); #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) -extern void inc_zone_state(struct zone *, enum zone_stat_item); - #ifdef CONFIG_SMP void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int); void __inc_zone_page_state(struct page *, enum zone_stat_item); @@ -216,24 +214,12 @@ static inline void __mod_zone_page_state(struct zone *zone, zone_page_state_add(delta, zone, item); } -static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) -{ - atomic_long_inc(&zone->vm_stat[item]); - atomic_long_inc(&vm_stat[item]); -} - static inline void __inc_zone_page_state(struct page *page, enum zone_stat_item item) { __inc_zone_state(page_zone(page), item); } -static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) -{ - atomic_long_dec(&zone->vm_stat[item]); - atomic_long_dec(&vm_stat[item]); -} - static inline void __dec_zone_page_state(struct page *page, enum zone_stat_item item) { @@ -248,6 +234,21 @@ static inline void __dec_zone_page_state(struct page *page, #define dec_zone_page_state __dec_zone_page_state #define mod_zone_page_state __mod_zone_page_state +static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) +{ + atomic_long_inc(&zone->vm_stat[item]); + atomic_long_inc(&vm_stat[item]); +} + +static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) +{ + atomic_long_dec(&zone->vm_stat[item]); + atomic_long_dec(&vm_stat[item]); +} + +#define inc_zone_state __inc_zone_state +#define dec_zone_state __dec_zone_state + #define set_pgdat_percpu_threshold(pgdat, callback) { } static inline void refresh_cpu_vm_stats(int cpu) { } -- 1.8.5.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/