From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 14 Jun 2001 13:32:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 14 Jun 2001 13:32:38 -0400 Received: from pizda.ninka.net ([216.101.162.242]:58545 "EHLO pizda.ninka.net") by vger.kernel.org with ESMTP id ; Thu, 14 Jun 2001 13:32:20 -0400 From: "David S. Miller" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15144.62749.724491.941190@pizda.ninka.net> Date: Thu, 14 Jun 2001 10:32:13 -0700 (PDT) To: root@chaos.analogic.com Cc: Linux kernel Subject: Re: SMP spin-locks In-Reply-To: In-Reply-To: X-Mailer: VM 6.75 under 21.1 (patch 13) "Crater Lake" XEmacs Lucid Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Richard B. Johnson writes: > Spin-locks now transfer control to the .text.lock segment. > This is a separate segment that can be at an offset that > is far away from the currently executing code. That may > cause the cache to be reloaded. Further, each spin-lock > invocation generates separate code within that segment. > > Question 1: Why? Because this increases the code density of the common case, getting the lock immediately. > Question 2: What is the purpose of the code sequence, "repz nop" > generated by the spin-lock code? Is this a processor BUG work-around? > `as` doesn't "like" this sequence and, Intel doesn't seem to > document it. It is a hint to the processor that we are executing a spinlock loop (it does something wrt. keeping the cacheline of the lock in shared state when possible). I believe it is documented in the Pentium 4 manuals, previous chips ignore this sequence and treat it as a pure nop from what I understand. Later, David S. Miller davem@redhat.com