Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp656150yba; Thu, 18 Apr 2019 07:30:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzx8/tuDrLG/hg9rOkZh334L55mFRcmngRFlKSwk2kt3cqM+acuemmHAGC/Mfu2CjzlsblZ X-Received: by 2002:a17:902:ab87:: with SMTP id f7mr95426607plr.85.1555597827468; Thu, 18 Apr 2019 07:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555597827; cv=none; d=google.com; s=arc-20160816; b=FMt4b/SaOrPv7s2aHqXbGvNM8QvFfiqv5OT34KhAEg4WWdkapDRHW45nxKSHWUt/2s W+viqOwkOhdA4UWoSPhAJc0aZQrFl5ehOuDNLgnfR30ThzzI8uNxl4yelN+Zqw4nyTrc UbHHIRF9/0TILQLWw+MW+fxcYYuPNrq2SUSPOO0JWDnEFqr5yYq4NpF+AygkwcAZ7kqM +zjY51CgmONP0cXbEM+fe1nZz6oHF5ZOOggeMewxgnqx6qA9jDFEMn4WrHRDswLBh/0M Hk2gjWuKWDt1FrVcpJlHgx3Q4zhqYJx8MlvDB2ao1LQxhFdU1lWV37Eo/X2gkjV5Gi0E pDcw== 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=MzNRznmnd3KIUUKFNOUhJMiTmRbrG25oVTa4vHxjdo0=; b=Ct3a05sGUqYR/y43EOEAeq5jhAmuHScUDAzi/FZr3j3ZXQWfW09uWfOGH1Y0uqHH9v RQfmnX1WYHsmo+vDmxjxPKbv7I1rig/CAYX4NQDdhEcfwwA9S6SUGbZwVSGTjeO5ayZf 7EsKMHcXE7RNyEl/hoyTdzQIJqyqcEPz1Q/X4j9XT8QIicsKjNuqTJxWUeBt5JYHGkIp +VOmSoSM5xPFRTFmDD211AwN08kawMbbWawOGOPDgYSKW7Ru8aQN/I9cegAZSc3/fw72 lyp38Wq5AIkvh0CLlr/dyMcSdsVN4kAods4zSQ1UN11PUwRHOquFHD+nddpZHsD30CWk zKAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ifHWCy7L; 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 b18si1966496pgj.500.2019.04.18.07.30.10; Thu, 18 Apr 2019 07:30:26 -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=ifHWCy7L; 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 S2389402AbfDRO2s (ORCPT + 99 others); Thu, 18 Apr 2019 10:28:48 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40716 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389083AbfDRO2s (ORCPT ); Thu, 18 Apr 2019 10:28: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=MzNRznmnd3KIUUKFNOUhJMiTmRbrG25oVTa4vHxjdo0=; b=ifHWCy7LFfwD4AUNLHcOZAala 6EJ+2gBZy9lzh/S+Qipr1cGE+4tgfGa/n0M/3AAi63lO3aGaWZX1uGO0zDUpBX8+WNmUKYqroTGQa EP0z7P6u5HXgjJEotF/VcVNwG6Cd5sATjlEL0DJGFZDBBB7zANd3+3ES9ayZsk/4yWwbqI9oX0vEh LroHVxzl93L0nGhHVRlQ8bV+GDoLUujZbrDKOevI58QQWWYooyrhH+Kvit9p4sfgZBDSh9nlYc7YZ kGY2lGFtqEtnvQ9SyPAUT31of05Rnlg8WhgbUOkOL4F7K6bLFhU3ptT5ONFFHK6QowRzooYltGBU6 ZUCCeFvdg==; 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 1hH81Z-0002vY-PO; Thu, 18 Apr 2019 14:28:26 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AC15629B9B7B6; Thu, 18 Apr 2019 16:28:22 +0200 (CEST) Date: Thu, 18 Apr 2019 16:28:22 +0200 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org, Davidlohr Bueso , Linus Torvalds , Tim Chen , huang ying Subject: Re: [PATCH v4 15/16] locking/rwsem: Merge owner into count on x86-64 Message-ID: <20190418142822.GC12232@hirez.programming.kicks-ass.net> References: <20190413172259.2740-1-longman@redhat.com> <20190413172259.2740-16-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190413172259.2740-16-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 Sat, Apr 13, 2019 at 01:22:58PM -0400, Waiman Long wrote: > +#ifdef CONFIG_X86_64 > +#define RWSEM_MERGE_OWNER_TO_COUNT > +#endif > +#ifdef RWSEM_MERGE_OWNER_TO_COUNT > + > +#ifdef __PHYSICAL_MASK_SHIFT > +#define RWSEM_PA_MASK_SHIFT __PHYSICAL_MASK_SHIFT > +#else > +#define RWSEM_PA_MASK_SHIFT 52 > +#endif I really dislike how this hardcodes x86_64. It would be much better to have a CONFIG variable that gives us the PA_BITS. Then all an architecture needs to do is set that right. FWIW: arch/arm64/Kconfig:config ARM64_PA_BITS_48 arch/arm64/Kconfig:config ARM64_PA_BITS_52 So ARM64 could also use this -- provided we get that overflow thing sorted.