Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1471773 > unrolled thread

[PATCH 1/2] staging: lustre: fix unstable pages tracking

Started byArnd Bergmann <arnd@arndb.de>
First post2016-08-29 14:30 +0200
Last post2016-09-01 04:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] staging: lustre: fix unstable pages tracking Arnd Bergmann <arnd@arndb.de> - 2016-08-29 14:30 +0200
    [PATCH 2/2] staging: lustre: hide unused variable Arnd Bergmann <arnd@arndb.de> - 2016-08-29 14:30 +0200
      Re: [PATCH 2/2] staging: lustre: hide unused variable James Simmons <jsimmons@infradead.org> - 2016-09-01 04:00 +0200
    Re: [PATCH 1/2] staging: lustre: fix unstable pages tracking James Simmons <jsimmons@infradead.org> - 2016-09-01 04:00 +0200

#1471773 — [PATCH 1/2] staging: lustre: fix unstable pages tracking

FromArnd Bergmann <arnd@arndb.de>
Date2016-08-29 14:30 +0200
Subject[PATCH 1/2] staging: lustre: fix unstable pages tracking
Message-ID<sbtRn-7g9-7@gated-at.bofh.it>
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")
---
 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

[toc] | [next] | [standalone]


#1471777 — [PATCH 2/2] staging: lustre: hide unused variable

FromArnd Bergmann <arnd@arndb.de>
Date2016-08-29 14:30 +0200
Subject[PATCH 2/2] staging: lustre: hide unused variable
Message-ID<sbtRo-7g9-25@gated-at.bofh.it>
In reply to#1471773
After a code cleanup, we get a harmless warning about a variable
that is unused when CONFIG_FS_POSIX_ACL is disabled:

drivers/staging/lustre/lustre/llite/xattr.c: In function 'll_xattr_get_common':
drivers/staging/lustre/lustre/llite/xattr.c:312:24: error: unused variable 'lli' [-Werror=unused-variable]

This puts the variable declaration into the same #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1e1f9ff406fd ("staging: lustre: llite: break ll_getxattr_common into 2 functions")
---
 drivers/staging/lustre/lustre/llite/xattr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
index f252c26ec30f..7b8d4699a71a 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -309,7 +309,9 @@ static int ll_xattr_get_common(const struct xattr_handler *handler,
 {
 	char fullname[strlen(handler->prefix) + strlen(name) + 1];
 	struct ll_sb_info *sbi = ll_i2sbi(inode);
+#ifdef CONFIG_FS_POSIX_ACL
 	struct ll_inode_info *lli = ll_i2info(inode);
+#endif
 	int rc;
 
 	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
-- 
2.9.0

[toc] | [prev] | [next] | [standalone]


#1474017 — Re: [PATCH 2/2] staging: lustre: hide unused variable

FromJames Simmons <jsimmons@infradead.org>
Date2016-09-01 04:00 +0200
SubjectRe: [PATCH 2/2] staging: lustre: hide unused variable
Message-ID<scpsl-1In-7@gated-at.bofh.it>
In reply to#1471777
> After a code cleanup, we get a harmless warning about a variable
> that is unused when CONFIG_FS_POSIX_ACL is disabled:
> 
> drivers/staging/lustre/lustre/llite/xattr.c: In function 'll_xattr_get_common':
> drivers/staging/lustre/lustre/llite/xattr.c:312:24: error: unused variable 'lli' [-Werror=unused-variable]
> 
> This puts the variable declaration into the same #ifdef.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 1e1f9ff406fd ("staging: lustre: llite: break ll_getxattr_common into 2 functions")

Reviewed-by: James Simmons <jsimmons@infradead.org>

> ---
>  drivers/staging/lustre/lustre/llite/xattr.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
> index f252c26ec30f..7b8d4699a71a 100644
> --- a/drivers/staging/lustre/lustre/llite/xattr.c
> +++ b/drivers/staging/lustre/lustre/llite/xattr.c
> @@ -309,7 +309,9 @@ static int ll_xattr_get_common(const struct xattr_handler *handler,
>  {
>  	char fullname[strlen(handler->prefix) + strlen(name) + 1];
>  	struct ll_sb_info *sbi = ll_i2sbi(inode);
> +#ifdef CONFIG_FS_POSIX_ACL
>  	struct ll_inode_info *lli = ll_i2info(inode);
> +#endif
>  	int rc;
>  
>  	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
> -- 
> 2.9.0
> 
> 

[toc] | [prev] | [next] | [standalone]


#1474016

FromJames Simmons <jsimmons@infradead.org>
Date2016-09-01 04:00 +0200
Message-ID<scpsl-1In-3@gated-at.bofh.it>
In reply to#1471773
> 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
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web