From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751736Ab2C1GrR (ORCPT ); Wed, 28 Mar 2012 02:47:17 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:42656 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317Ab2C1GrQ convert rfc822-to-8bit (ORCPT ); Wed, 28 Mar 2012 02:47:16 -0400 MIME-Version: 1.0 X-Originating-IP: [212.179.42.66] In-Reply-To: References: <1332338318-5958-1-git-send-email-fweisbec@gmail.com> Date: Wed, 28 Mar 2012 08:47:15 +0200 Message-ID: Subject: Re: [RFC][PATCH 00/32] Nohz cpusets v2 (adaptive tickless kernel) From: Gilad Ben-Yossef To: Christoph Lameter Cc: Frederic Weisbecker , LKML , linaro-sched-sig@lists.linaro.org, Alessio Igor Bogani , Andrew Morton , Avi Kivity , Chris Metcalf , Daniel Lezcano , Geoff Levand , Ingo Molnar , Max Krasnyansky , "Paul E. McKenney" , Peter Zijlstra , Stephen Hemminger , Steven Rostedt , Sven-Thorsten Dietrich , Thomas Gleixner , Zen Lin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 27, 2012 at 6:22 PM, Christoph Lameter wrote: > 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. > Right, I didn't think of that. > 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. Cool, I'll do it. Thanks Gilad > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html > Please read the FAQ at  http://www.tux.org/lkml/ -- Gilad Ben-Yossef Chief Coffee Drinker gilad@benyossef.com Israel Cell: +972-52-8260388 US Cell: +1-973-8260388 http://benyossef.com "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?"  -- Jean-Baptiste Queru