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.3 required=3.0 tests=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 1F5F5C11D3D for ; Thu, 27 Feb 2020 17:30:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF40F24691 for ; Thu, 27 Feb 2020 17:30:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF40F24691 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 644296B0005; Thu, 27 Feb 2020 12:30:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CD716B0006; Thu, 27 Feb 2020 12:30:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BD336B0007; Thu, 27 Feb 2020 12:30:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 308D66B0005 for ; Thu, 27 Feb 2020 12:30:46 -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 04EAD181AEF15 for ; Thu, 27 Feb 2020 17:30:46 +0000 (UTC) X-FDA: 76536596892.22.swing53_5df0c85061b2f X-HE-Tag: swing53_5df0c85061b2f X-Filterd-Recvd-Size: 3427 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Feb 2020 17:30:45 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 831F2AD72; Thu, 27 Feb 2020 17:30:43 +0000 (UTC) Subject: Re: [LSF/MM/BPF TOPIC] Replacing mmap_sem with finer grained locks To: Michel Lespinasse , lsf-pc@lists.linux-foundation.org Cc: linux-mm , Davidlohr Bueso , Jerome Glisse , Laurent Dufour , "Liam R. Howlett" , Matthew Wilcox , David Rientjes , Hugh Dickins , Peter Zijlstra , Jan Kara References: From: Vlastimil Babka Message-ID: <99450fb4-1780-ded8-2bea-5a14dd2a6ed0@suse.cz> Date: Thu, 27 Feb 2020 18:30:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2/14/20 2:03 PM, Michel Lespinasse wrote: > Hi, > > I would like to propose this topic for LSF/MM 2020. This is a > continuation of discussions that were started at LSF/MM 2019 and have > informally continued since between the copied folks and I. > > The fact that mmap_sem locks the entire MM is causing a lot of > problems. The fundamental design hasn't changed in 20+ years, though a > number of hacks have been added (such as releasing the mmap_sem during > page faults) to work around the worst issues with it. In modern > threaded workloads, we often see multiple threads running > non-overlapping memory operations, which end up unnecessarily blocking > on each other because mmap_sem only supports locking the entire MM > rather than just the address range each thread is operating on. > > I have been working on a patch set to replace the mmap_sem rwsem with > a range lock, which should resolve this issue. This is currently > implemented through the page fault path and some very narrow cases of > mmap(); I am working to broaden the scope of the mmap changes before > sending this patch set publicly; I also know Davidlohr and Vlastimil > have been working on similar approaches in the past. JFTR you probably mean Davidlohr and Jan here from SUSE, not me, I'm relatively new to this topic :) But obviously interested in attending. Thanks for the proposal! > Another approach that is being explored is speculative page faults; I > know Peter and Laurent have been working on this in the past and > Matthew is giving this another look at the moment. I think this is a > different angle to approach the problem from; I think this solution is > not as generic (my understanding is that it only works for the page > fault path), but more efficient for the cases that it handles. > > I really would like to get a new discussion about this, to discuss the > concrete proposals that people have been working on and set a > direction moving forward. >