From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755878AbYEYNor (ORCPT ); Sun, 25 May 2008 09:44:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753406AbYEYNoi (ORCPT ); Sun, 25 May 2008 09:44:38 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:39272 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbYEYNoh (ORCPT ); Sun, 25 May 2008 09:44:37 -0400 Date: Sun, 25 May 2008 09:44:36 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Thomas Gleixner cc: LKML , linux-rt-users , akpm@osdl.org, Ingo Molnar , Clark Williams , Peter Zijlstra , "Luis Claudio R. Goncalves" , Gregory Haskins , Linus Torvalds , Andi Kleen Subject: Re: [PATCH -v2] x86: enable preemption in delay In-Reply-To: Message-ID: References: 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 Sun, 25 May 2008, Steven Rostedt wrote: > + > + /* > + * It is possible that we moved to another CPU, and > + * since TSC's are per-cpu we need to calculate > + * that. The delay must guarantee that we wait "at > + * least" the amount of time. Being moved to another > + * CPU could make the wait longer but we just need to > + * make sure we waited long enough. Rebalance the > + * counter for this CPU. > + */ > + if (unlikely(cpu != smp_processor_id())) { > + cpu = smp_processor_id(); > + rdtscl(bclock); > + } > } > while ((now-bclock) < loops); BAH! expect version 3. :-p This was compiled tested. -- Steve > preempt_enable(); >