lkml.org 
[lkml]   [2011]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write()
From
Date
On Tue, 2011-09-20 at 09:57 -0500, Christoph Lameter wrote:

> this_cpu_xx functions are made for those locations that have
> preemption enabled. If you can use those function (classic case is a
> per cpu counter increment in the network subsystem) then you can avoid
> preempt disable/enable or get_cpu/put_cpu.

If the variables are used for a very short time, then the latencies
introduced by a simple:

var = get_cpu_var(my_var);
if (var)
do_something_quick();
put_cpu_var(my_var);

Otherwise if that do_something_quick(); migrates, it may be doing
something it shouldn't be doing!

-- Steve



\
 
 \ /
  Last update: 2011-09-20 17:21    [W:0.325 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site