From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262080AbVCNHDM (ORCPT ); Mon, 14 Mar 2005 02:03:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262081AbVCNHDM (ORCPT ); Mon, 14 Mar 2005 02:03:12 -0500 Received: from mx1.elte.hu ([157.181.1.137]:18130 "EHLO mx1.elte.hu") by vger.kernel.org with ESMTP id S262007AbVCNHCr (ORCPT ); Mon, 14 Mar 2005 02:02:47 -0500 Date: Mon, 14 Mar 2005 08:02:30 +0100 From: Ingo Molnar To: Hugh Dickins Cc: Andrew Morton , nickpiggin@yahoo.com.au, linux-kernel@vger.kernel.org Subject: Re: [PATCH] break_lock forever broken Message-ID: <20050314070230.GA24860@elte.hu> References: <20050311203427.052f2b1b.akpm@osdl.org> 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 * Hugh Dickins wrote: > @@ -187,6 +187,8 @@ void __lockfunc _##op##_lock(locktype##_ > cpu_relax(); \ > preempt_disable(); \ > } \ > + if ((lock)->break_lock) \ > + (lock)->break_lock = 0; \ while writing the ->break_lock feature i intentionally avoided overhead in the spinlock fastpath. A better solution for the bug you noticed is to clear the break_lock flag in places that use need_lock_break() explicitly. One robust way for that seems to be to make the need_lock_break() macro clear the flag if it sees it set, and to make all the other (internal) users use __need_lock_break() that doesnt clear the flag. I'll cook up a patch for this. Ingo