Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp991291imm; Wed, 23 May 2018 08:36:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpkYm0Ssity7Dvq+4MwYukVrD5mZDVlkSlHAwDNrfgcVyiEQ2HFlbUN4LE24LIctE7r8YJR X-Received: by 2002:a17:902:a717:: with SMTP id w23-v6mr3443619plq.130.1527089792875; Wed, 23 May 2018 08:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527089792; cv=none; d=google.com; s=arc-20160816; b=RgB3DULJ6n/tfK63yZDQUxYeZOOM6c3hHVHm8DeFzZjYVod2FmBR2V+Xhp5Xxtgbwk eq2WSSsLgjLPVurBYOiJE9JrOkXAPWvBQOGIr1HLd/dBus52Hjf7PwKvTzFaO6YBzna6 iY+4w7x6xPOxTuXhv0BrMNEc57/cD1y95O8JQG90Nlm1k2fy5TAGgLonvRkrvYZbIzAh 9Gs1dXwRMNNyVMPjDqEUQ6R9ql4ovrre0WPOpIQhXXJedh/wz2MfsGC/KZkoDxItpYyF eb9+66qK2qRAQZ0T3O4W2MBpHDpzIJTPS8K+sZR8+1OTcMu9jujZv/N4hKpBmhjNtNTV fbGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=5hF7IIzf+EXhyJOUM+sa/AuT7zfXmlZvjl1FA000a1M=; b=qwAWFqdqNb8yl2W7bKb40TVSdW2E/U6aTHEnm0jJyDl2TNaXEQVYlTIfJU70vZ2lmG L8S5s0wReBtmq1cEZgnOkc2jdHSOVk4UwyhOZUIMb1KOeIfwKgaY7M/fks95o6zq6mB5 H6lXhpuVD2St06aPEEcegMm5saLF+fA2On/pEYDr0tbQea083mHY84mY9+KDE7SGFoF/ 1efKLq0O99GixRM7RdX9drrgTQZ2I6OzlZCzRbbCf+O/P9ivGjyPIlUyPm1iecbjrZ+u Xwvv8sBUdfEz+9UE7pnrDSYwwH6Fn5F4dn1qOiMLQl8/AmmCUJmsCvPr0SRWz/82403l Sdjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5-v6si14939005pgn.339.2018.05.23.08.35.55; Wed, 23 May 2018 08:36:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933435AbeEWPfo (ORCPT + 99 others); Wed, 23 May 2018 11:35:44 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57282 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932578AbeEWPfk (ORCPT ); Wed, 23 May 2018 11:35:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C9341435; Wed, 23 May 2018 08:35:40 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0CE333F589; Wed, 23 May 2018 08:35:40 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id E28581AE2F68; Wed, 23 May 2018 16:36:07 +0100 (BST) Date: Wed, 23 May 2018 16:36:07 +0100 From: Will Deacon To: Linus Torvalds Cc: psodagud@codeaurora.org, Kees Cook , Andy Lutomirski , Will Drewry , Andrew Morton , Rik van Riel , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Eric Biggers , Frederic Weisbecker , sherryy@android.com, Vegard Nossum , Christoph Lameter , Andrea Arcangeli , Sasha Levin , Linux Kernel Mailing List , boqun.feng@gmail.com Subject: Re: write_lock_irq(&tasklist_lock) Message-ID: <20180523153607.GD2983@arm.com> References: <0879f797135033e05e8e9166a3c85628@codeaurora.org> <20180523130547.GF26965@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Boqun] On Wed, May 23, 2018 at 08:25:06AM -0700, Linus Torvalds wrote: > On Wed, May 23, 2018 at 6:05 AM Will Deacon wrote: > > > Please use a newer kernel. We've addressed this in mainline by moving > > arm64 over to the qrwlock implementation which (after some other changes) > > guarantees forward progress for well-behaved readers and writers. > > Oh, I didn't even realize that this wasn't x86, and that there was still > the very unfair rwlock issue on 4.14 on arm. > > Yeah, the queuing rwlocks shouldn't show the really pathological problems > we used to have long ago. Yup, although they do reveal new issues that Boqun has been running into recently with his lockdep improvements. The general pattern is if you have: P0: P1: P2: spin_lock(&slock) read_lock(&rwlock) write_lock(&rwlock) read_lock(&rwlock) spin_lock(&slock) then the CPUs can be queued on the rwlock such that P1 has the lock, then P2 is queued and then P0. If P0 has taken the spinlock, we have a deadlock which wouldn't arise with the non-queued version. In other words, qrwlock requires consistent locking order wrt spinlocks. Will