From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1686FC2D0B1 for ; Thu, 6 Feb 2020 13:59:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CB987214AF for ; Thu, 6 Feb 2020 13:59:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HMajmQiL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB987214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 610386B0003; Thu, 6 Feb 2020 08:59:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C1A56B0006; Thu, 6 Feb 2020 08:59:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AFF66B0007; Thu, 6 Feb 2020 08:59:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 2F6396B0003 for ; Thu, 6 Feb 2020 08:59:26 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DD00D181AC9C6 for ; Thu, 6 Feb 2020 13:59:25 +0000 (UTC) X-FDA: 76459859490.22.steel72_524aefa4b0637 X-HE-Tag: steel72_524aefa4b0637 X-Filterd-Recvd-Size: 3518 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 13:59:25 +0000 (UTC) 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; bh=xKf/vicJPKg2o3rM8u+ZwkeIDujiLpVjGtUMMCo9V1Q=; b=HMajmQiLhD7Qi8/ruJ5q6B2/8Q g2n3Uj7x73wcLaQhzNE9aHZRNCbUb+36Frg2t+E7fDiL5XewaDukcRyTl6VSnmynqe26thD+OsDsH Hq1fDkIE8uYyq+bRpH6unqSqVmywtwAnm+gcGtWPH0rmOu0qf+0X1ttX/MBCGCN0/xO9a6evJ3qtc FY8vJTUJ/HoUTToad4wrAXJi2DIRKQI3rXOVWnN7h3sa6sBuSF6mC0otf5VWiJ4t90V0vjhXiS/2o daFcStLRDhMCJKRRTma9RYZ4T+IPHCfKzTP9/3w3wiK8AxFkUgCn3XfNaZjeXQyppMaY7/wRbFYR4 dCR7J89A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1izhgi-00019A-2O; Thu, 06 Feb 2020 13:59:24 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 365623008A9; Thu, 6 Feb 2020 14:57:34 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9A6FA2B76D3B2; Thu, 6 Feb 2020 14:59:20 +0100 (CET) Date: Thu, 6 Feb 2020 14:59:20 +0100 From: Peter Zijlstra To: Matthew Wilcox Cc: SeongJae Park , Michal Hocko , Vlastimil Babka , "Kirill A. Shutemov" , linux-mm@kvack.org Subject: Re: Re: Splitting the mmap_sem Message-ID: <20200206135920.GS14914@hirez.programming.kicks-ass.net> References: <20200109170715.GV4951@dhcp22.suse.cz> <20200109173206.3731-1-sj38.park@gmail.com> <20200109201320.GO6788@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200109201320.GO6788@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 09, 2020 at 12:13:20PM -0800, Matthew Wilcox wrote: > One of the use cases that we're concerned about involves a high > percentage of page faults on a single large (terabytes) VMA (and a > highly multithreaded process). Moving the contention from a rwsem > in the mm_struct to a refcount in the VMA will not help performance > substantially for this user. This is why I never believed in the VMA-refcount approach, and why my patches used SRCU. > The proposal consists of three phases. In phase 1, we convert the > rbtree to the maple tree, and leave the locking alone. In phase 2, > we change the locking to a per-VMA refcount, looked up under RCU. > > This problem arises during phase 3 where we attempt to handle page > faults entirely under the RCU read lock. If we encounter problems, > we can fall back to acquiring the VMA refcount, but we need the > page allocation to fail rather than sleep (or magically drop the > RCU lock and return an indication that it has done so, but that > doesn't seem to be an approach that would find any favour). So why not use SRCU? You can do full blocking faults under SRCU and don't need no 'stinkin' refcounts ;-)