Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp968939img; Fri, 22 Mar 2019 12:31:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKc7iCYzCi+XKbgBQvBe7BdfwGM8T7WXuM5STqTDHJvyaQpTv5vKjKY4d60P3sB6PGt/PP X-Received: by 2002:aa7:8b96:: with SMTP id r22mr10812719pfd.223.1553283078660; Fri, 22 Mar 2019 12:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553283078; cv=none; d=google.com; s=arc-20160816; b=TvF9zu7eXbOpilhcWoQtuXX96VPI231TCRW/PBRqvaBPWI+SZfYPP16oGjizYr/zLM dU2OddK05v4nw1V90YJZzXxec+PTPyVS4fRLlUstngWmfoXteC0y4uxwuTHXHnnpFcgT Mk5jpo5iyP2MUWhB5PW1i4sAlFPvP5oH8Z/GhdEeGoXLBTuUXsPWDVU6TtqPvLhZTFc8 mVGjMk8DcKrS7lyaHgrEc+B1xLAt9WobVY1R9kxvRKEmRn0iNURVrUy9nMsR7D0jDN6x H+bJqkobmbK5ztk1gjznAeNYBRPu38OHXdFynzQoseozhVqtq4hHY21E5ZdQoqCCDxZ1 QtMA== 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; bh=bki9ag23Jnskwv6LrOWkjA377Waw8lTNZbe18MF/Ijg=; b=LxMZwMz+ZBY2lDMFAXlKysA9iUvHYEut5M18An0Unqjzo2Y94W6qcnJ35NL2xIcJk3 3mFNjtUtdjNhY+lZwYCn51q6k/3B8A4ugjRPAs9mslx4koa6j30sW1x+cO6gVpMyAGPo BNNPwaUxINW3FAH5/qYXklwTg6yZR6D3Vxl8R/fU3kC4WWcQkO657KxKl/Twe3nyE1Mm mmb7YzcNV92VJCcIoZ1QgCqYoLXjwhRt3cWFcn1weesSWHTTsoe3kYfRE4KETvvmpp6N GPesSu1gNhKK6L+cEEf4Z1ccOWh8mi8qCxfT0SW85pjt86sVro3LmIZmN6mriqHxFwVr t43Q== ARC-Authentication-Results: i=1; mx.google.com; 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 n9si3481878pfi.193.2019.03.22.12.31.03; Fri, 22 Mar 2019 12:31:18 -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; 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 S1728032AbfCVTa1 (ORCPT + 99 others); Fri, 22 Mar 2019 15:30:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:35452 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727758AbfCVTa0 (ORCPT ); Fri, 22 Mar 2019 15:30:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B825BAFCF; Fri, 22 Mar 2019 19:30:22 +0000 (UTC) Date: Fri, 22 Mar 2019 12:30:10 -0700 From: Davidlohr Bueso To: Linus Torvalds Cc: Waiman Long , Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner , Linux List Kernel Mailing , "linux-alpha@vger.kernel.org" , "linux-alpha@vger.kernel.org" , linux-c6x-dev@linux-c6x.org, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k , linux-mips@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-arch , the arch/x86 maintainers , Arnd Bergmann , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , Tim Chen Subject: Re: [PATCH v5 1/3] locking/rwsem: Remove arch specific rwsem files Message-ID: <20190322193010.azb7rmmmaclhal35@linux-r8p5> References: <20190322143008.21313-1-longman@redhat.com> <20190322143008.21313-2-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Mar 2019, Linus Torvalds wrote: >Some of them _might_ be performance-critical. There's the one on >mmap_sem in the fault handling path, for example. And yes, I'd expect >the normal case to very much be "no other readers or writers" for that >one. Yeah, the mmap_sem case in the fault path is really expecting an unlocked state. To the point that four archs have added branch predictions, ie: 92181f190b6 (x86: optimise x86's do_page_fault (C entry point for the page fault path)) b15021d994f (powerpc/mm: Add a bunch of (un)likely annotations to do_page_fault) And using PROFILE_ANNOTATED_BRANCHES shows pretty clearly: (without resetting the counters) correct incorrect % Function File Line ------- --------- - -------- ---- ---- 4603685 34 0 do_user_addr_fault fault.c 1416 (bootup) 382327745 449 0 do_user_addr_fault fault.c 1416 (kernel build) 399446159 461 0 do_user_addr_fault fault.c 1416 (redis benchmark) It would probably wouldn't harm doing the unlikely() for all archs, or alternatively, add likely() to the atomic_long_try_cmpxchg_acquire in patch 3 and do it implicitly but maybe that would be less flexible(?) Thanks, Davidlohr