Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2035367imm; Thu, 14 Jun 2018 07:48:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL2HEF/e9BDB7t+gyd+tOLjgIqoxgxXsWjYI2ErKjiI6UaUZ4zjAv+hEuQtbNRhdlq6sGzj X-Received: by 2002:a17:902:988f:: with SMTP id s15-v6mr3390656plp.95.1528987707185; Thu, 14 Jun 2018 07:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528987707; cv=none; d=google.com; s=arc-20160816; b=1KuLhr0r5vwTGblzB92yyi0H6ettn1JwlaPZ59Vy2vV9VyCnGOPe0zWGQL6l2p/Yyl 9MDeVKMFgiWItAYX4WYNk6APJcs16vJ0HJx0iMdHGcN6W61y1tekawCsEF8gpUvnhIXn Wdm9T+WUMoLU61IOyn+SiF6/SwGRArn7ouBzG2rzIk7lM/oe6y9uDVmbhHTaB2Moyin3 r2IU6s2ISaZspkQusPmR1ubMXWsFVz5QAsLaUXxfLjbIlw17beBEQbkjtdu5duVGtq8C x8aXnFag33/Z30hucuzxQebs183eHWOsV90AuDD6an59OgLsFHVjUuqF/+TSEm9aUuT/ oItw== 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:dkim-signature:arc-authentication-results; bh=bzsp9R/0/TnIKNRQwr3DEN7SceKsbqc5Ixm+pnWo0j8=; b=gMcsMx+cFQrINeTK7u6jZUYKj9jpZfbVqaOqb0I7psenm4jxBlkOC0l3joEcQ7nbGM mvA2r1VlX6utMaP98Hx2vFZe3K0b4MvpoYfT6CPtLEswJCYKLLTlQxnnhcpwvO+vNOp5 Udn+c1bFifcXrXhTaBIOaAu8ooXmW1t38n37b6yaBESujEXwkcicFuAm+nKJ5yKC/41g pb0mVBIVZAjAMG8IwMxOip9o0dgvJ8hOP1qzYmPp+gv7DXnl8di6p94qtP+l03T7ORyY nVOtXKqewti1bU3C7pRUVzqbivdIytSQOnQh9tn217lIkTF/1rbm68KycLbPRT4nkZi5 oWCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=x6uEGeiW; 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 v11-v6si4508195pgf.380.2018.06.14.07.48.12; Thu, 14 Jun 2018 07:48:27 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=x6uEGeiW; 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 S1755457AbeFNOrb (ORCPT + 99 others); Thu, 14 Jun 2018 10:47:31 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40494 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755390AbeFNOr2 (ORCPT ); Thu, 14 Jun 2018 10:47:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bzsp9R/0/TnIKNRQwr3DEN7SceKsbqc5Ixm+pnWo0j8=; b=x6uEGeiWXHW+jBzjcMWRLT4ON OZPE2wxzoANWTR+a0lT1QGPvFczh/uuAvUBsJJRdZ5DW2wCBhvx/TF4Dr7XSiVDUFuzhiFlIYwrvx hC7sgtngA7REYdmF95ycXplBM4qn457vqjooHb+lEuHdcXphNBX6ezislsxYAbbRa8S9AVhYk9O8S 6CSp5+9XrKKYVR/dTSkHqs0xxB/GSKt23wsodJf2plhAD7NrTmq4imGfvhkyz0+zbMdjgyK0cyc5X moptAka5BKeXifA8IGsU8OGYCDaBUejYkGUyP6KR0lxbzmIRtikUL2B+U4gCS63pweTGxaNISxRWq rbJc3Dxbw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTTWh-0005GI-08; Thu, 14 Jun 2018 14:47:03 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A1D79201EA7C8; Thu, 14 Jun 2018 16:46:59 +0200 (CEST) Date: Thu, 14 Jun 2018 16:46:59 +0200 From: Peter Zijlstra To: Thomas Hellstrom Cc: Matthew Wilcox , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ingo Molnar , Jonathan Corbet , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Kate Stewart , Philippe Ombredanne , Greg Kroah-Hartman , linux-doc@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v2 1/2] locking: Implement an algorithm choice for Wound-Wait mutexes Message-ID: <20180614144659.GC12198@hirez.programming.kicks-ass.net> References: <20180614072922.8114-1-thellstrom@vmware.com> <20180614072922.8114-2-thellstrom@vmware.com> <20180614113604.GZ12198@hirez.programming.kicks-ass.net> <7eb10c22-57b3-1472-0a77-7f787f612217@vmware.com> <20180614132905.GA7841@bombadil.infradead.org> <425f4d5b-d414-de46-f388-55f1e6821ba6@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <425f4d5b-d414-de46-f388-55f1e6821ba6@vmware.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 14, 2018 at 03:43:04PM +0200, Thomas Hellstrom wrote: > It's intended to be enforced by storing the algorithm choice in the > WW_MUTEX_CLASS which must be common for an acquire context and the > ww_mutexes it acquires. However, I don't think there is a check that that > holds. I guess we could add it as a DEBUG_MUTEX test in ww_mutex_lock(). There is ww_mutex_lock_acquired(): DEBUG_LOCKS_WARN_ON(ww_ctx->ww_class != ww->ww_class) which should trigger if you try and be clever.