From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806AbYI2H1l (ORCPT ); Mon, 29 Sep 2008 03:27:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751939AbYI2H1c (ORCPT ); Mon, 29 Sep 2008 03:27:32 -0400 Received: from smtp-out.google.com ([216.239.33.17]:21178 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787AbYI2H1b (ORCPT ); Mon, 29 Sep 2008 03:27:31 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:cc:subject: references:in-reply-to:content-type:content-transfer-encoding; b=VCvIGcFUIQaQK7dszwy/ura9te65nShPo7FmniwYEr7lwhO3KCwoL/Wmg/EIzaDxD 37WWbNQV20bOlCIfn8nTA== Message-ID: <48E0834D.6010608@google.com> Date: Mon, 29 Sep 2008 00:27:09 -0700 From: dean gaudet User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Andi Kleen CC: Pardo , linux-kernel@vger.kernel.org, mbligh@google.com, briangrant@google.com, nil@google.com, jyasskin@google.com Subject: Re: Faster getcpu() and sched_getcpu() References: <87wsgwp6gh.fsf@basil.nowhere.org> In-Reply-To: <87wsgwp6gh.fsf@basil.nowhere.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andi Kleen wrote: > I'm still not sure why you say no redzone is that expensive? Do you > have numbers? I know it's a few instructions, but it shouldn't > be that expensive. > > it depends on the processor involved and the kernel config options -- i.e. if frame pointers are enabled then the stack frame guarantees a store operation (push rbp) and on processors which do memops in-order this delays the other memops in the vsyscall (i.e. testing the cache or executing SIDT). it was 2 or 3 cycles difference in most cases iirc. -dean