From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966Ab2C0QW4 (ORCPT ); Tue, 27 Mar 2012 12:22:56 -0400 Received: from smtp101.prem.mail.ac4.yahoo.com ([76.13.13.40]:46733 "HELO smtp101.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750796Ab2C0QWz (ORCPT ); Tue, 27 Mar 2012 12:22:55 -0400 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ahGljHkVM1kHOCb_aDqQ8gyXjsm80PesPSVZH8rGwZoQIzw rKHFJgQAhKKJXVsT4VestdmCfl859.lFev3eunewEOv0B1kFrsJsqh4SoIC_ 4Ut5n19a8WaLQK.mNh8u1mVGPYibYL0_TXqyxr7SqN9rCEzgA6eYqXdrUaYY dKcnouZFURS_MY88NbswBewoassZfTYjhzWPS1rzak.S0LbTyVoy7DRJD4zD 8Cvf4R4v0aXRH.Gg7_EHTPvv9Fhn3u.ZslbsnuIwAX1P4zE6cdps8aQg8ljR GLpJQBPLncH9_jHfJgytbFy6tTU7Rsbv_L9.KwUNN5MhDyP8hx5quPNg51fZ dHI6W1u71uFPr3OQ9UqwkniaoRgCTA0ceDbR1XRU_uABhxDt8J8qOw8a3C0f 2 X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Tue, 27 Mar 2012 11:22:48 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Gilad Ben-Yossef 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 Subject: Re: [RFC][PATCH 00/32] Nohz cpusets v2 (adaptive tickless kernel) In-Reply-To: Message-ID: References: <1332338318-5958-1-git-send-email-fweisbec@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.