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.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, 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 4BE56C43603 for ; Thu, 12 Dec 2019 14:25:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D2CAC21655 for ; Thu, 12 Dec 2019 14:24:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="xp88kSuL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2CAC21655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 40C718E0005; Thu, 12 Dec 2019 09:24:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BD0D8E0001; Thu, 12 Dec 2019 09:24:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AB818E0005; Thu, 12 Dec 2019 09:24:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 113858E0001 for ; Thu, 12 Dec 2019 09:24:59 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id A20178249980 for ; Thu, 12 Dec 2019 14:24:58 +0000 (UTC) X-FDA: 76256711076.10.money03_659b1ad25b65b X-HE-Tag: money03_659b1ad25b65b X-Filterd-Recvd-Size: 3940 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Dec 2019 14:24:58 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id u17so2511148lja.4 for ; Thu, 12 Dec 2019 06:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F8qTuaEJDZkypLSf0idyr6skTRsxiuUReLd1bPEwIwc=; b=xp88kSuL/BV5h70GEAZ7ZMCYU/pGnXmT+67SPOu3/6nZuiNmxkAG8LalVk3ffnAvyK 8aHC+hXuS4GRCIFwQKeV1oJoKorAF+kY0Ouf9KR+hTetgTG9tRoPfiMgTC4XsZdV332A nXrXImxd0+h5TawtawgZ39rhGxCEbZwAXHuvNQNn+rywtoIl5fZMX4mXYez22L0i9Ebw 1BwqN5gBLslIbdsH/mC8oB4enbdWL7q2PlAUB+zE4x8HVw+3yVN9HOHvoCkPfgCfFW2J E/9F3s/iNnyD9QJg9/2T10kiramIemeryTz5lnE2hzXYKuKKHvXjYtlac1M7ztvk2jij yg/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=F8qTuaEJDZkypLSf0idyr6skTRsxiuUReLd1bPEwIwc=; b=X9A5vEJ+vS/IkcGY5Qe3z9wQHBqZfKLbeAY85Ic95kGlT1xXVIdG4bDuCGfqt3+VDb w5ZelPCXLFwiawpulD9qwACAp4hnva4VEE0ubN8wDkMlPS1Hk6Hw3Kz5cu8Et7UzLiIA oLawuzOnjxSQ1qnv8X3YEhC+woIOrpclaH/7T3JtZ8117lAoozs5LZBffIhk9SakwFFz /8WX7zpgcVoOQv1xPdj5L/wVLDYLha3XK2SSocHjyGkjTjbTfhGIobrSIfdvtFFVoaMS dOguVMlR759KRcCwNg2lBnynEvyPeE9Br8rspLuZJ+batRqv6uHu9dF07pjsCT0RE06R dsUw== X-Gm-Message-State: APjAAAX/HSCI/fVjgvSbFplgFDx9EuJuA7nAATQ4Wyz/sICB3U0rauYJ c1Gj00MNLT1k3DITXEmQGpVPkw== X-Google-Smtp-Source: APXvYqxEXlq4h6lVyBiEx3cU6cCby4cE6wb5E77fpRVnokHls8BPmsvRxMLi0XxuL2L8aft8njHHiw== X-Received: by 2002:a2e:3a12:: with SMTP id h18mr6094126lja.81.1576160696620; Thu, 12 Dec 2019 06:24:56 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id r2sm2996670lfn.13.2019.12.12.06.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 06:24:55 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 217FA100ABE; Thu, 12 Dec 2019 17:24:57 +0300 (+03) Date: Thu, 12 Dec 2019 17:24:57 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: linux-mm@kvack.org Subject: Re: Splitting the mmap_sem Message-ID: <20191212142457.zqp4mawjz7frpyvk@box> References: <20191203222147.GV20752@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191203222147.GV20752@bombadil.infradead.org> User-Agent: NeoMutt/20180716 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 Tue, Dec 03, 2019 at 02:21:47PM -0800, Matthew Wilcox wrote: > My preferred solution to the mmap_sem scalability problem is to allow > VMAs to be looked up under the RCU read lock then take a per-VMA lock. > I've been focusing on the first half of this problem (looking up VMAs > in an RCU-safe data structure) and ignoring the second half (taking a > lock while holding the RCU lock). Do you see this approach to be regression-free for uncontended case? I doubt it will not cause regressions for signle-threaded applications... > We currently only have one ->map_pages() callback, and it's > filemap_map_pages(). It only needs to sleep in one place -- to allocate > a PTE table. I think that can be allocated ahead of time if needed. No, filemap_map_pages() doesn't sleep. It cannot. Whole body of the function is under rcu_read_lock(). It uses pre-allocated page table. See do_fault_around(). -- Kirill A. Shutemov