From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbdKVUW1 (ORCPT ); Wed, 22 Nov 2017 15:22:27 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:50506 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbdKVUWZ (ORCPT ); Wed, 22 Nov 2017 15:22:25 -0500 Date: Wed, 22 Nov 2017 21:22:17 +0100 From: Peter Zijlstra To: Will Deacon Cc: Sebastian Ott , Ingo Molnar , Martin Schwidefsky , Heiko Carstens , linux-kernel@vger.kernel.org Subject: Re: [bisected] system hang after boot Message-ID: <20171122202217.GO3326@worktop> References: <20171122182659.GA22648@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171122182659.GA22648@arm.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 22, 2017 at 06:26:59PM +0000, Will Deacon wrote: > Now, I can't see what the break_lock is doing here other than causing > problems. Is there a good reason for it, or can you just try removing it > altogether? Patch below. The main use is spin_is_contended(), which in turn ends up used in __cond_resched_lock() through spin_needbreak(). This allows better lock wait times for PREEMPT kernels on platforms where the lock implementation itself cannot provide 'contended' state. In that capacity the write-write race shouldn't be a problem though. That said, I'd not be horribly sad to see this go, I've always found it to be quite the ugly hack and taking it out should provide some incentive for better lock implementations for the archs relying on this.