Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp808238imj; Thu, 7 Feb 2019 12:09:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IYORrPomFshaN9FzDpgN5JfXK+ER4rUkoQjtx4vCcPiGy4wNi0GB0P05xtQ4JhmjPxwEtDz X-Received: by 2002:a17:902:765:: with SMTP id 92mr18509435pli.242.1549570185036; Thu, 07 Feb 2019 12:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549570185; cv=none; d=google.com; s=arc-20160816; b=b4mWu7BGhvrvotaWpVQCMJrEeRP1bPBjKTyLKyvMdCbRFbX6gYdTnnxzUajEtbKJlU Gom0xo1oQpTX9v2nJrwUNfHwronHE5aib5k51qTEqilcEfIsUpB+N7LSBHbfyTXP8/oV rsF9NqTxr3+85oqOlq8pY67KQ20X476jp2x5pRrBlkaTSXuU8OeHSX+5seMahip+sIBd /rcPEQXZnCH5XYqrUoRUC4qNnGtCcd5lkh61/daz75VxLMetDiYhhG58WPfmxLE1Y3wL b5KESDpFcIKjqX6v1crj+CFxYAJy5v7iF55SItuz4MRxiers7mwlxLGkKgBXn3IFDZ4E 5uaw== 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=5xbR3lmkLsZWCIh6h7Aa8GknY2hnP1GcabXBkOS1m1g=; b=jaghn5iVKfpV9zpdP347i9Wmp+6i3Aw8wuof6+A4NXlFvpWGI2JiD6NKtsj4Tpe2ax 1yLqEuKslqTY2Dwflah30ehHFzCChEClWBZHQZflfI9XlJWYXh8naht1uVEXvziDO49a qjXRMg30UpAAAN+VgMZbAJepslDPPIEfGo9Nj/m6/fB+bITLrHFd6MZVAuzys4HbD57n 64jxbXbfYSwWTFBdfS1109eXlG9HjYjrSw2WnYzxWPa0nYZfKXM/diJi6e0cutbV8+Rc 21ypLc192HTscChdJCL3+om7IjhnGNAob2C6q4c9XQFwzsUh+i+My9ZuWinK4ysPqS9L 511A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Qko/1MTu"; 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 u7si11136767pfu.270.2019.02.07.12.09.29; Thu, 07 Feb 2019 12:09:45 -0800 (PST) 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="Qko/1MTu"; 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 S1727380AbfBGUJA (ORCPT + 99 others); Thu, 7 Feb 2019 15:09:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47038 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbfBGUI7 (ORCPT ); Thu, 7 Feb 2019 15:08:59 -0500 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=5xbR3lmkLsZWCIh6h7Aa8GknY2hnP1GcabXBkOS1m1g=; b=Qko/1MTupML1YqLxtp37l+JzW pIHKua82tq1vFOPixQloQYSCQAZmiGtgkSULylu5QmueNi8zcl4NrP1PvKdqnCCzuKZWOr/PI2qvp /3BzPOZExniFQl0VOLbvMtuR7C/CWmUExwylfvl+TI6j5vXfTb+j5TArGjpF8Ct5dKZnxlGWQTel3 U1n+3f9369ORyNVoIMYznuusdh9beS0XDYVdHK4X6p4yXLoZowCIdiGHUR2aJMbJPfIsNM2KRS5an l5YlcsXAeO0fnkFaJw2s4jPWw1hMm6OhqetZhXRPBcVyg0O2OIDZxU6uG3glXT74EBn/8IleVzzkM 9kXkG6dyw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1grpyc-0006rj-5n; Thu, 07 Feb 2019 20:08:50 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8164E2059AC77; Thu, 7 Feb 2019 21:08:48 +0100 (CET) Date: Thu, 7 Feb 2019 21:08:48 +0100 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org, x86@kernel.org, Arnd Bergmann , Borislav Petkov , "H. Peter Anvin" , Davidlohr Bueso , Linus Torvalds , Andrew Morton , Tim Chen Subject: Re: [PATCH-tip 15/22] locking/rwsem: Merge owner into count on x86-64 Message-ID: <20190207200848.GH32477@hirez.programming.kicks-ass.net> References: <1549566446-27967-1-git-send-email-longman@redhat.com> <1549566446-27967-16-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1549566446-27967-16-git-send-email-longman@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 Thu, Feb 07, 2019 at 02:07:19PM -0500, Waiman Long wrote: > On 32-bit architectures, there aren't enough bits to hold both. > 64-bit architectures, however, can have enough bits to do that. For > x86-64, the physical address can use up to 52 bits. That is 4PB of > memory. That leaves 12 bits available for other use. The task structure > pointer is also aligned to the L1 cache size. That means another 6 bits > (64 bytes cacheline) will be available. Reserving 2 bits for status > flags, we will have 16 bits for the reader count. That can supports > up to (64k-1) readers. 64k readers sounds like a number that is fairly 'easy' to reach, esp. on 64bit. These are preemptible locks after all, all we need to do is get 64k tasks nested on enough CPUs. I'm sure there's some willing Java proglet around that spawns more than 64k threads just because it can. Run it on a big enough machine (ISTR there's a number of >1k CPU systems out there) and voila.