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: <47A8CA97.30008@cosmosbay.com>
Date:	Tue, 05 Feb 2008 21:44:07 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Pekka Paalanen <pq@....fi>
CC:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] x86 mmiotrace: fix relay-buffer-full flag for SMP

Pekka Paalanen a écrit :
> Relay has per-cpu buffers, but mmiotrace was using only a single flag
> for detecting buffer full/not-full transitions. The new code makes
> this per-cpu and actually counts missed events.
> 
> Signed-off-by: Pekka Paalanen <pq@....fi>
> ---
>  arch/x86/kernel/mmiotrace/mmio-mod.c |   26 ++++++++++++++++----------
>  1 files changed, 16 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/x86/kernel/mmiotrace/mmio-mod.c b/arch/x86/kernel/mmiotrace/mmio-mod.c
> index 82ae920..f492b65 100644
> --- a/arch/x86/kernel/mmiotrace/mmio-mod.c
> +++ b/arch/x86/kernel/mmiotrace/mmio-mod.c
> @@ -29,6 +29,7 @@
>  #include <asm/pgtable.h>
>  #include <linux/mmiotrace.h>
>  #include <asm/e820.h> /* for ISA_START_ADDRESS */
> +#include <asm/atomic.h>
>  
>  #include "kmmio.h"
>  #include "pf_in.h"
> @@ -47,9 +48,13 @@ struct trap_reason {
>  	int active_traces;
>  };
>  
> +/* Accessed per-cpu. */
>  static struct trap_reason pf_reason[NR_CPUS];
>  static struct mm_io_header_rw cpu_trace[NR_CPUS];
>  
> +/* Access to this is not per-cpu. */
> +static atomic_t dropped[NR_CPUS];
> +

Please dont introduce NR_CPUS new arrays, since people are working hard to zap 
them from kernel.

You probably can use a per_cpu variable ?

Thank you

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