From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761221AbcIAB6t (ORCPT ); Wed, 31 Aug 2016 21:58:49 -0400 Received: from casper.infradead.org ([85.118.1.10]:54012 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754608AbcIAB6s (ORCPT ); Wed, 31 Aug 2016 21:58:48 -0400 Date: Thu, 1 Sep 2016 02:58:40 +0100 (BST) From: James Simmons To: Arnd Bergmann cc: Oleg Drokin , Andreas Dilger , Mel Gorman , Greg Kroah-Hartman , Jinshan Xiong , Lai Siyao , Bobi Jam , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] staging: lustre: fix unstable pages tracking In-Reply-To: <20160829122023.3018966-1-arnd@arndb.de> Message-ID: References: <20160829122023.3018966-1-arnd@arndb.de> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160901_025840_465074_98CA9D8A X-CRM114-Status: GOOD ( 20.30 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > A patch to change to page accounting code (in v4.8-rc1) conflicts with > a change to lustre (in staging-next for v4.9), and fortunately gets > detected using a gcc warning: > > In file included from /git/arm-soc/include/linux/mm.h:1001:0, > from /git/arm-soc/include/linux/highmem.h:7, > from /git/arm-soc/drivers/staging/lustre/lustre/osc/../../include/linux/libcfs/linux/libcfs.h:46, > from /git/arm-soc/drivers/staging/lustre/lustre/osc/../../include/linux/libcfs/libcfs.h:36, > from /git/arm-soc/drivers/staging/lustre/lustre/osc/osc_cl_internal.h:45, > from /git/arm-soc/drivers/staging/lustre/lustre/osc/osc_page.c:40: > drivers/staging/lustre/lustre/osc/osc_page.c: In function 'unstable_page_accounting': > include/linux/vmstat.h:117:2: error: array subscript is above array bounds [-Werror=array-bounds] > atomic_long_add(x, &vm_zone_stat[item]); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/vmstat.h:117:2: error: array subscript is above array bounds [-Werror=array-bounds] > atomic_long_add(x, &vm_zone_stat[item]); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > This changes the function to use the correct interface for accounting in the > "node" rather than the "zone". > > Signed-off-by: Arnd Bergmann > Fixes: d806f30e639b ("staging: lustre: osc: revise unstable pages accounting") > Fixes: 11fb998986a7 ("mm: move most file-based accounting to the node") Thanks for fixing things. I couldn't reproduce this problem on x86. Reviewed-by: James Simmons > --- > drivers/staging/lustre/lustre/osc/osc_page.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c > index 583a0af2d388..c8889eabc402 100644 > --- a/drivers/staging/lustre/lustre/osc/osc_page.c > +++ b/drivers/staging/lustre/lustre/osc/osc_page.c > @@ -789,7 +789,7 @@ out: > > /** > * Atomic operations are expensive. We accumulate the accounting for the > - * same page zone to get better performance. > + * same page pgdat to get better performance. > * In practice this can work pretty good because the pages in the same RPC > * are likely from the same page zone. > */ > @@ -797,28 +797,28 @@ static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc, > int factor) > { > int page_count = desc->bd_iov_count; > - void *zone = NULL; > + pg_data_t *last = NULL; > int count = 0; > int i; > > for (i = 0; i < page_count; i++) { > - void *pz = page_zone(desc->bd_iov[i].bv_page); > + pg_data_t *pgdat = page_pgdat(desc->bd_iov[i].bv_page); > > - if (likely(pz == zone)) { > + if (likely(pgdat == last)) { > ++count; > continue; > } > > if (count > 0) { > - mod_zone_page_state(zone, NR_UNSTABLE_NFS, > + mod_node_page_state(pgdat, NR_UNSTABLE_NFS, > factor * count); > count = 0; > } > - zone = pz; > + last = pgdat; > ++count; > } > if (count > 0) > - mod_zone_page_state(zone, NR_UNSTABLE_NFS, factor * count); > + mod_node_page_state(last, NR_UNSTABLE_NFS, factor * count); > } > > static inline void add_unstable_page_accounting(struct ptlrpc_bulk_desc *desc) > -- > 2.9.0 > >