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] [day] [month] [year] [list]
Message-ID: <0000013ac16cefd9-5db44ae3-c74f-4bac-a88e-caf1ff5ccdd6-000000@email.amazonses.com>
Date:	Fri, 2 Nov 2012 14:01:13 +0000
From:	Christoph Lameter <cl@...ux.com>
To:	Jesse Gross <jesse@...ira.com>
cc:	Shan Wei <shanwei88@...il.com>, dev@...nvswitch.org,
	NetDev <netdev@...r.kernel.org>,
	Kernel-Maillist <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH 4/9] net: openvswitch: use this_cpu_ptr per-cpu helper

On Thu, 1 Nov 2012, Jesse Gross wrote:

> On Thu, Nov 1, 2012 at 7:33 AM, Christoph Lameter <cl@...ux.com> wrote:
> > On Thu, 1 Nov 2012, Shan Wei wrote:
> >
> >> But for different field in same per-cpu variable, how to guarantee n_missed
> >> and n_hit are from same cpu?
> >> this_cpu_read(dp->stats_percpu->n_missed);
> >> [processor changed]
> >> this_cpu_read(dp->stats_percpu->n_hit);
> >
> > What does current guarantee that? If it is guaranteed then you can use the
> > __this_cpu_xxx ops.
>
> Preemption is disabled in all of the places where writes are done and
> all of the reads are from foreign CPUs.

Since preemption is disabled no processor change can occur. So its safe to
use __this_cpu ops throughout and they will operate on the current per cpu
area.

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