Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5737183ybi; Tue, 4 Jun 2019 11:16:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqym9LXSdASsSe4GRlmwOhcue6Um9MBc7MJ4jJCYwnpsfTi6YhCNdgMbS6+57i/rvN3NMZBP X-Received: by 2002:a65:5688:: with SMTP id v8mr37218703pgs.138.1559672197278; Tue, 04 Jun 2019 11:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559672197; cv=none; d=google.com; s=arc-20160816; b=gu9t13GEsHxHHfsMfNbgTnrB5R13vHvOWxyvALROmEi0HDOe9d5EhUPucWgzHTCdbP wktI3lgCrPMPJQH6sGVfCM+xa2BfD+rGF7HhRVdoYXidwaRmrapLZnvKD3wbYsBmCnvF DD/EYkqMz0lsYr6OGFYIeoWE9gm9b3ksM0352lAAGscqw7Vkiri7H9lLYhXDONGeaCl0 /wOQh1PrNmpLt8ihlGtFqDlEnbF01QeDOvpXFwUhEGuaVsXgSO9K0UutKGH4Xl05hOj1 vXz6vhAthVSnwrW2vpIO1U+P12SsYneN3dqqqCDzNDLoxWppya9Lh2Br53xZF6i5Wnei 5x1Q== 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=QHMRtkbg/vKvfRo8sZE/mY2gYzUHuRCKTR/YthVWl8c=; b=Pe+KgpZzlfLVWwrNmJejnSkyBmL7kgo5Fqhmb0Dn1lIdQNjfj6tTfT+js3aqL642c2 SmiR8f0PUMPP9ug1tzjgF2AmZh7gOnerG5tOZM13Z16NS7U9qTrB02E49NcH7HfC/+O8 wQcoYDW6C5UmRAF6AvfWYQlfPzTcaNDPL2AVIvdnikrCafOlNZ2DWDwZ5Fz1VknLKOuI QUiKa+bZ1TU29OdFWVbptkTBGDL+ds4u1phjJ4Yl3rFtb53JMXUpVPaXqGZf3OCKeUMz IIxD59h90GLWywaY9EF0RZZYDfAOXY4IC1QZjGh0vSBpLa2ZNGdZJQx82Go6U6QNvuXh 8MeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="ra2EEE/O"; 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 l11si21550464pgp.438.2019.06.04.11.16.20; Tue, 04 Jun 2019 11:16:37 -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="ra2EEE/O"; 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 S1726656AbfFDSOt (ORCPT + 99 others); Tue, 4 Jun 2019 14:14:49 -0400 Received: from merlin.infradead.org ([205.233.59.134]:41818 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfFDSOs (ORCPT ); Tue, 4 Jun 2019 14:14:48 -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=QHMRtkbg/vKvfRo8sZE/mY2gYzUHuRCKTR/YthVWl8c=; b=ra2EEE/Ob/ezj0iKYgP/I/wYc I3qXruB7acYxBCHDSjG5Q0+g9oP6uX/bov2hBRJXKr6aHlx17pc1ks61TmkBSHps5Ybt+uqiFojeV Zx2kp2oIUkzb0357uqIoShpsDBdXsit8Pwd4pNNZ6UN5xCIAlF2HcANkC4fd2eE9oFaQuUjldKKHo Wm82OcsT+9sV/7+wsLcLX2psc3Iug6uQRzihCDnDKPA7LwPrMiB8ZyM6uwo31kIZB3CTb1KN7WyLa wGjmD1GNg+C3BKy73Td+CJC5vCiEgUBeaagGFS+9c5V7KvvMOvzBYLSpwC7+UIStoYgx5cgHaw6N3 oW30DAoiw==; 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 1hYDx7-00082X-Al; Tue, 04 Jun 2019 18:14:29 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AB814209638E7; Tue, 4 Jun 2019 20:14:26 +0200 (CEST) Date: Tue, 4 Jun 2019 20:14:26 +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: <20190604181426.GH3419@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jun 04, 2019 at 02:04:34PM -0400, Waiman Long wrote: > On 6/4/19 1:38 PM, Peter Zijlstra wrote: > > On Tue, Jun 04, 2019 at 01:30:00PM -0400, Waiman Long wrote: > >>> That's somewhat inconsistent wrt the type. I'll make it unsigned long, > >>> as that is what makes most sense, given there's a pointer inside. > >> Thank for spotting that, I will fix it. > > I fixed a whole bunch of them; please find the modified patches here: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=locking/core > > Thanks for reviewing the patches. > > So how do you think about the overall state of this patchset? Do you > think it is mature enough to go into 5.3? So far so good :-) > Or if you want more time to think about solving the RT thread issue, we > can merge just patches 1-16 and play with the last threes for some more > time. I am fine with that too as improving RT tasks is not my main > focus. I like patch 16 as it led me to discover the rwsem reader wakeup > bug as I hit the negative dentry count WARN_ON message in my testing. My brain gave out around patch 14.. I'll try again tomorrow. But I'm thinking we should be able to do as you suggest and get -16 merged. > I worked on this owner merging patch mainly to alleviate the need to use > cmpxchg for reader lock. cmpxchg_double() is certainly one possible > solution though it won't work on older CPUs. We can have a config option > to use cmpxchg_double as it may increase the size of other structures > that embedded rwsem and impose additional alignment constraint. cmpxchg8b was introduced with the Pentium (for PAE IIRC, it enabled atomic 64bit PTEs, but Linux never used it for that) and every Intel/AMD thereafter has had it. AFAIK there's no x86_64 chip without cmpxchg16b.