Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751097AbVJFPel (ORCPT ); Thu, 6 Oct 2005 11:34:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751098AbVJFPel (ORCPT ); Thu, 6 Oct 2005 11:34:41 -0400 Received: from gold.veritas.com ([143.127.12.110]:38550 "EHLO gold.veritas.com") by vger.kernel.org with ESMTP id S1751097AbVJFPel (ORCPT ); Thu, 6 Oct 2005 11:34:41 -0400 Date: Thu, 6 Oct 2005 16:34:04 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Linus Torvalds cc: Kirill Korotaev , Ingo Molnar , linux-kernel@vger.kernel.org, Andrew Morton , xemul@sw.ru, Andrey Savochkin , st@sw.ru Subject: Re: SMP syncronization on AMD processors (broken?) In-Reply-To: Message-ID: References: <434520FF.8050100@sw.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 06 Oct 2005 15:34:40.0804 (UTC) FILETIME=[77BC9640:01C5CA8B] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 791 Lines: 25 On Thu, 6 Oct 2005, Linus Torvalds wrote: > > If you want to notify another CPU that you want the spinlock, then you > need to set the "flag" variable _outside_ of the spinlock. > > Spinlocks are not fair, not by a long shot. They never have been, and they > never will. Fairness would be extremely expensive indeed. That reminds me: ought cond_resched_lock to be doing something more? int cond_resched_lock(spinlock_t *lock) { int ret = 0; if (need_lockbreak(lock)) { spin_unlock(lock); cpu_relax(); ret = 1; spin_lock(lock); } - 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/