lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071120130201.GE10127@Krystal>
Date:	Tue, 20 Nov 2007 08:02:01 -0500
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	clameter@....com
Cc:	ak@...e.de, akpm@...ux-foundation.org, travis@....com,
	linux-kernel@...r.kernel.org
Subject: Re: [rfc 19/45] cpu alloc: NFS statistics

* clameter@....com (clameter@....com) wrote:
> Signed-off-by: Christoph Lameter <clameter@....com>
> ---
>  fs/nfs/iostat.h |    8 ++++----
>  fs/nfs/super.c  |    2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/fs/nfs/iostat.h
> ===================================================================
> --- linux-2.6.orig/fs/nfs/iostat.h	2007-11-15 21:17:24.391404458 -0800
> +++ linux-2.6/fs/nfs/iostat.h	2007-11-15 21:25:33.167654066 -0800
> @@ -123,7 +123,7 @@ static inline void nfs_inc_server_stats(
>  	int cpu;
>  
>  	cpu = get_cpu();
> -	iostats = per_cpu_ptr(server->io_stats, cpu);
> +	iostats = CPU_PTR(server->io_stats, cpu);
>  	iostats->events[stat] ++;

Is there a way to change this into a CPU_ADD ?

>  	put_cpu_no_resched();

Why put_cpu_no_resched here ?

>  }
> @@ -139,7 +139,7 @@ static inline void nfs_add_server_stats(
>  	int cpu;
>  
>  	cpu = get_cpu();
> -	iostats = per_cpu_ptr(server->io_stats, cpu);
> +	iostats = CPU_PTR(server->io_stats, cpu);
>  	iostats->bytes[stat] += addend;
>  	put_cpu_no_resched();

Why put_cpu_no_resched here ?

>  }
> @@ -151,13 +151,13 @@ static inline void nfs_add_stats(struct 
>  
>  static inline struct nfs_iostats *nfs_alloc_iostats(void)
>  {
> -	return alloc_percpu(struct nfs_iostats);
> +	return CPU_ALLOC(struct nfs_iostats, GFP_KERNEL | __GFP_ZERO);
>  }
>  
>  static inline void nfs_free_iostats(struct nfs_iostats *stats)
>  {
>  	if (stats != NULL)
> -		free_percpu(stats);
> +		CPU_FREE(stats);
>  }
>  
>  #endif
> Index: linux-2.6/fs/nfs/super.c
> ===================================================================
> --- linux-2.6.orig/fs/nfs/super.c	2007-11-15 21:17:24.399404478 -0800
> +++ linux-2.6/fs/nfs/super.c	2007-11-15 21:25:33.171654143 -0800
> @@ -529,7 +529,7 @@ static int nfs_show_stats(struct seq_fil
>  		struct nfs_iostats *stats;
>  
>  		preempt_disable();
> -		stats = per_cpu_ptr(nfss->io_stats, cpu);
> +		stats = CPU_PTR(nfss->io_stats, cpu);
>  
>  		for (i = 0; i < __NFSIOS_COUNTSMAX; i++)
>  			totals.events[i] += stats->events[i];
> 
> -- 

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ