Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1948411imm; Thu, 14 Jun 2018 06:30:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKdD2XiRZ98qeYVEuDVsZW0yX1PxoIUBpTSTPop7jiRmlIEtmjjjs+RqirbluEdQiiAiQvT X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr3047287plz.282.1528983000501; Thu, 14 Jun 2018 06:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528983000; cv=none; d=google.com; s=arc-20160816; b=t/TTAlwyAMOoUpsHGD2mTHWF6LysZAFgvrn8Ojk/52hySd77IsoGF30+dfBl+nJ2xp utEBbhWHZ4rD+fRSM0NdFZXAxjJw0swXlkqvXc4pZT/VqkN93m3Ht828nj25hpJJJV4G OaK0596G9UmTWdnE/hqCyohf0Lkz0+t64hYwqUmnOCgBtIU2upFdvKQa0/3aVzhnqM0J f3dr2xJNuYFI3rw4/WlseltqTgnyUhdTR0HJOWiA1eTZTHEfSa6B5hvrB+aB8KJc7VtH raWut6de98LPglUKJZtV3hokb50PyDhXwRlKSOWrnGY0fOETQt9Ibf/FrtzKcEAxMRjU bA/A== 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=D3M0+L7De5Rde1cWkG3InPvn6WoDJpf7xOqvxEmkc2g=; b=VW7iH2e7ermo86TEex3i5lf2Yqtig26qptHAQ/4cQem0M5mV5jqj6s2t73n7ZvQ5Tw BebgJIK6ajYI9vikRzfPHHZ1Ss0w+a6jCMynwbnHuZsHKgQunhC5IocsO3ejnryL8T1F ATToFvG0rQybxYbWAbUbbn6N9Ce7x4Lx4g0Yi7jdtZjASE8HiYqGhfgiElGqnjxUSmah inyPW2JlL7I44ZgsJaRCnJZiCyQtxglfL5U7avcSOOAYi1CKKnQWA13FnXDnfxxhpr5x 2cugvDyqxPLJs1Dh3yZNd8sqoiizfhwMZgrRA2iVCVWlDX5fFdikY9ttfeZHjvRchhpt rZAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HWg55sEP; 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 x11-v6si5298382pln.442.2018.06.14.06.29.46; Thu, 14 Jun 2018 06:30:00 -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=bombadil.20170209 header.b=HWg55sEP; 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 S1755275AbeFNN3M (ORCPT + 99 others); Thu, 14 Jun 2018 09:29:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41892 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755092AbeFNN3K (ORCPT ); Thu, 14 Jun 2018 09:29:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=D3M0+L7De5Rde1cWkG3InPvn6WoDJpf7xOqvxEmkc2g=; b=HWg55sEP9sVRlKsKAiAlcfGTE a1GdHyCnfPcMqPyHyPQb0lsCP7X6k1IYTZ2Y2HxzNnw2nJjWX34B+ecPwJooQHdQyYy5v420Wx4Q/ U4w145BWbwQhk1sqzmn32TLQRsvW4t0gGHd4oiiWp+na0ImN8nXt3R8Yf1Uv43CRbd52cC2pAa3fz mpMyQSiRPRo499UOi3PpCgadKBGWUG/88GdpBRz1/UThuwpZUUCqgtYbwrpiNbY0YUTE17hAJFVS4 3v5pY8vu44u0c/p8d0PLSkdmXX/eSXEgUn2P0TFw7fW35JMVVyMIwn2+iwrzMhunuSyd5zLolmU4o F5LaQo1rA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTSJF-00047h-Vg; Thu, 14 Jun 2018 13:29:05 +0000 Date: Thu, 14 Jun 2018 06:29:05 -0700 From: Matthew Wilcox To: Thomas Hellstrom Cc: Peter Zijlstra , 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: <20180614132905.GA7841@bombadil.infradead.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7eb10c22-57b3-1472-0a77-7f787f612217@vmware.com> User-Agent: Mutt/1.9.2 (2017-12-15) 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 01:54:15PM +0200, Thomas Hellstrom wrote: > On 06/14/2018 01:36 PM, Peter Zijlstra wrote: > > Currently you don't allow mixing WD and WW contexts (which is not > > immediately obvious from the above code), and the above hard relies on > > that. Are there sensible use cases for mixing them? IOW will your > > current restriction stand without hassle? > > Contexts _must_ agree on the algorithm used to resolve deadlocks. With > Wait-Die, for example, older transactions will wait if a lock is held by a > younger transaction and with Wound-Wait, younger transactions will wait if a > lock is held by an older transaction so there is no way of mixing them. Maybe the compiler should be enforcing that; ie make it a different type?