Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267571AbUIHM5O (ORCPT ); Wed, 8 Sep 2004 08:57:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267555AbUIHM4l (ORCPT ); Wed, 8 Sep 2004 08:56:41 -0400 Received: from mx1.elte.hu ([157.181.1.137]:5251 "EHLO mx1.elte.hu") by vger.kernel.org with ESMTP id S267568AbUIHMwH (ORCPT ); Wed, 8 Sep 2004 08:52:07 -0400 Date: Wed, 8 Sep 2004 14:53:39 +0200 From: Ingo Molnar To: Zwane Mwaikambo Cc: Andrew Morton , Linux Kernel Subject: Re: [patch] preempt-smp.patch, 2.6.9-rc1-bk14 Message-ID: <20040908125339.GA20132@elte.hu> References: <20040908111751.GA11507@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-ELTE-SpamVersion: MailScanner 4.31.6-itk1 (ELTE 1.2) SpamAssassin 2.63 ClamAV 0.73 X-ELTE-VirusStatus: clean X-ELTE-SpamCheck: no X-ELTE-SpamCheck-Details: score=-4.9, required 5.9, autolearn=not spam, BAYES_00 -4.90 X-ELTE-SpamLevel: X-ELTE-SpamScore: -4 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 27 * Zwane Mwaikambo wrote: > > to solve this problem i've introduced a new spinlock field, > > lock->break_lock, which signals towards the holding CPU that a > > spinlock-break is requested by another CPU. This field is only set if a > > CPU is spinning in a spinlock function [at any locking depth], so the > > default overhead is zero. I've extended cond_resched_lock() to check for > > this flag - in this case we can also save a reschedule. I've added the > > lock_need_resched(lock) and need_lockbreak(lock) methods to check for > > the need to break out of a critical section. > > Doesn't having break_lock within the same cacheline as lock bounce the > line around more? in fact this way it bounces less than if it were on a separate cacheline. Contention causes bouncing anyway. This way we already have the cacheline dirty and on the local CPU when we set break_lock, which the lockholder CPU bounces back when it breaks the lock and/or releases the lock. Ingo - 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/