linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jinshan Xiong <jinshan.xiong@intel.com>,
	Lai Siyao <lai.siyao@intel.com>, Bobi Jam <bobijam.xu@intel.com>,
	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
Date: Thu, 1 Sep 2016 02:58:40 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1609010257100.21057@casper.infradead.org> (raw)
In-Reply-To: <20160829122023.3018966-1-arnd@arndb.de>


> 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 <arnd@arndb.de>
> 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 <jsimmons@infradead.org>

> ---
>  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
> 
> 

      parent reply	other threads:[~2016-09-01  1:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 12:20 [PATCH 1/2] staging: lustre: fix unstable pages tracking Arnd Bergmann
2016-08-29 12:20 ` [PATCH 2/2] staging: lustre: hide unused variable Arnd Bergmann
2016-09-01  1:59   ` James Simmons
2016-09-01  1:58 ` James Simmons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.1609010257100.21057@casper.infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=arnd@arndb.de \
    --cc=bobijam.xu@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jinshan.xiong@intel.com \
    --cc=lai.siyao@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=mgorman@techsingularity.net \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).