lkml.org 
[lkml]   [2014]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] doc: Add remote CPU access details and others to this_cpu_ops.txt
On Wed, 16 Jul 2014, Pranith Kumar wrote:

> +You can also do the following to convert the datap offset to an address
> +
> + struct data *p = this_cpu_ptr(&datap);
> +
> +but, passing of pointers calculated via this_cpu_ptr to other cpus is
> +unusual and should be avoided.
> +
> +Such remote accesses to per CPU data are not guaranteed to be atomic
> +anymore. You will have to use atomic_t and rely on the standard atomic
> +operations for these remote accesses to be atomic.

The use of atomic_t implies a remote write operation to a percpu area.

atomic_t needs to be avoided. If data needs to be modified from multiple
cpus then it usually does not belong into a percpu area.


\
 
 \ /
  Last update: 2014-07-17 16:41    [W:0.168 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site