Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7217626ybi; Wed, 5 Jun 2019 13:20:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5blPy2mVAdxSoTxHPAIgZIXAvy0yg02H8nn6+N0niE62Guw/Qy3mHeFFQnxnS+sPcyJSL X-Received: by 2002:a17:902:8490:: with SMTP id c16mr47479301plo.259.1559766044619; Wed, 05 Jun 2019 13:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559766044; cv=none; d=google.com; s=arc-20160816; b=hL0lIopwXTvKPh/Py6I/GI87RVJtfgttQDfpEGVYeIBIIKDyQsEXYf2J9Ezc25gSmk AiVEB5rct8w3Yn9B8KzJYQtNmrkhXEmi7ggF4xbumIroxEnGUNDFZxb9lcbFYv/ruWKr dNgEv1dumbbQ6P8n0l1ntS96UaE+xGZ19Sctys0t+xviZpdcKljI368R36Sy1vrJ1i1Z cSKEyHl7b++ZmwP4A7djmuoCfBFKqVC0x9tWt09JdSrTq5yzaOPDHLRsHkzNtES8yUVA OYC/Sj2wm5KqhsIS2q+1wD+U0/4GeOWSEwpmSPBK77ulMoNoOpBbbb0N/IY4OfGYZbLM QaaA== 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; bh=g+z8rl+Xnk+hyJFTOmEaUyUD6LMuuoZuScd2+zmF/k4=; b=FNHhT6nNEMG7EwUWI8ACFyMQuPRNbAqb32TqruA+Pl6y16nq4WI/F7l/0CUn1wgCiw mQg0jfDJubfPWYI5DXL6SQ6cg4J0dKx5wkzbCICBetz28COjNGFN7IWoOKeKVyxEpJ5i 4bppF+6CKY6NwamYf5D/T5bWOgRvETKOtOqpKUkNpDqrvqeUB1P9BE7i8a1RqN3DJRk2 IgBVuY8cuHQNL9xvnqdtr9GSceBof615yPgavHgECxZbT1Fi46NHMtIkdn0xuS12Pwf4 7oC5avtfXdY6UPC+R8oY/FsmrU/Sc1zdgSjHP5SgIUlN05lEVSvuyXuII95PemGnIQy+ Y4LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=0RyEuNgg; 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 a11si4797923pjq.11.2019.06.05.13.20.27; Wed, 05 Jun 2019 13:20:44 -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=0RyEuNgg; 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 S1726608AbfFEUTY (ORCPT + 99 others); Wed, 5 Jun 2019 16:19:24 -0400 Received: from merlin.infradead.org ([205.233.59.134]:55380 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfFEUTX (ORCPT ); Wed, 5 Jun 2019 16:19:23 -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=g+z8rl+Xnk+hyJFTOmEaUyUD6LMuuoZuScd2+zmF/k4=; b=0RyEuNggsxAYEPYnWLRJDg0KV /1Losu3NqHqPKcVN1gPdr/SezAkavzJvVPNwXWFF8DqrtP1m7ryACy70yAbTQOcYuUa6nsqROLms7 XD3mafLSmR57hUZYLm3v2t+uXGRqNWVzln2ViJsYprgVhvbqBo4hmLeLniUaMMycuiuPi55N81g/+ n/V5/1HuEyx8kSA+G9jDwmVvPH4AH7xyYl+fZmPk0D3EobDz4NwgqLe52qyZWizjtlDeB185Zu80l KkscESH2Utrs7qvOtPrsGCpzYSdEUTuWJqamn0YFsOXEsm+DGUvuLnGXnLq/5MwCIKqp8s15kqymz F2B1moiSA==; 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 1hYcND-00011A-Sy; Wed, 05 Jun 2019 20:19:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0A681207A2CF3; Wed, 5 Jun 2019 22:19:01 +0200 (CEST) Date: Wed, 5 Jun 2019 22:19:01 +0200 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org, Davidlohr Bueso , Linus Torvalds , Tim Chen , huang ying Subject: Re: [PATCH v8 15/19] locking/rwsem: Adaptive disabling of reader optimistic spinning Message-ID: <20190605201901.GB3402@hirez.programming.kicks-ass.net> References: <20190520205918.22251-1-longman@redhat.com> <20190520205918.22251-16-longman@redhat.com> <20190604092008.GJ3402@hirez.programming.kicks-ass.net> <8e7d19ea-f2e6-f441-6ab9-cbff6d96589c@redhat.com> <20190604173853.GG3419@hirez.programming.kicks-ass.net> <20190604181426.GH3419@hirez.programming.kicks-ass.net> <46e44f43-87fd-251b-3b83-89a8bb3b407f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46e44f43-87fd-251b-3b83-89a8bb3b407f@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 02:13:27PM -0400, Waiman Long wrote: > Using cmpxchg_double is actually more risky than I thought. I have been > trying to try to use cmpxchg_double for down_write, but I kept getting > kernel panics because the rwsem wasn't 16b-aligned. As rwsem is embedded > in quite a large number of structures, they all have to align properly > to make that work or the kernel will panic. That does seem too risky to > me. So I am dropping the idea of trying to use it. Urgh, that's another things that's been on the TODO list for a long long time, write code to verify the alignment of allocations :/ I'm suspecting quite a lot of that goes wrong all over the place.