lkml.org 
[lkml]   [2012]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 00/32] Nohz cpusets v2 (adaptive tickless kernel)
On Tue, 27 Mar 2012, Gilad Ben-Yossef wrote:

> +static void vmstat_update(struct work_struct *w)
> +{
> + int cpu, this_cpu = smp_processor_id();
> + int sleepy_cpu_counter = 0;
> + static spinlock_t lock;
> +
> + if(spin_trylock(&lock)) {

Trylock would cause cache bouncing between vmstat runs on various
processors. The reason that vmstat_update exists is to avoid these cache
bounces. Please no exclusive cacheline acquisiton by all cpus by default.

The best method would be to assign a sacrifical lamb cpu and check if we
are running on that cpu. That way taking a lock can be avoided.



\
 
 \ /
  Last update: 2012-03-27 18:25    [W:0.160 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site