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.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 62E85C10F14 for ; Tue, 23 Apr 2019 10:47:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C5832175B for ; Tue, 23 Apr 2019 10:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556016433; bh=5JHwWNTxDnLSWDGfvnXlo14z79f0zGUWxfLqGH3F0J0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=BWE78usAWbv+3ukdqDTrimZweD4fT2LAcxQP7WHIF50dqafV00aYXIuA3jjAyqlH4 qu42rIgYDDzTnBdOCyH+9DFEx4DgLrDm+VB9j05v1649HnfT15jT+wlOLlWCWe1b2W uhqMTzcioJpQhtv7qLrZYimfg+KV6lLLWOwrOrFE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727363AbfDWKrL (ORCPT ); Tue, 23 Apr 2019 06:47:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:48306 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726481AbfDWKrL (ORCPT ); Tue, 23 Apr 2019 06:47:11 -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 5E467AF1C; Tue, 23 Apr 2019 10:47:09 +0000 (UTC) Date: Tue, 23 Apr 2019 12:47:07 +0200 From: Michal Hocko To: Michel Lespinasse Cc: Laurent Dufour , Andrew Morton , Peter Zijlstra , "Kirill A. Shutemov" , Andi Kleen , dave@stgolabs.net, Jan Kara , Matthew Wilcox , aneesh.kumar@linux.ibm.com, Benjamin Herrenschmidt , mpe@ellerman.id.au, Paul Mackerras , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi , zhong jiang , Haiyan Song , Balbir Singh , sj38.park@gmail.com, Mike Rapoport , LKML , linux-mm , haren@linux.vnet.ibm.com, Nick Piggin , "Paul E. McKenney" , Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v12 00/31] Speculative page faults Message-ID: <20190423104707.GK25106@dhcp22.suse.cz> References: <20190416134522.17540-1-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon 22-04-19 14:29:16, Michel Lespinasse wrote: [...] > I want to add a note about mmap_sem. In the past there has been > discussions about replacing it with an interval lock, but these never > went anywhere because, mostly, of the fact that such mechanisms were > too expensive to use in the page fault path. I think adding the spf > mechanism would invite us to revisit this issue - interval locks may > be a great way to avoid blocking between unrelated mmap_sem writers > (for example, do not delay stack creation for new threads while a > large mmap or munmap may be going on), and probably also to handle > mmap_sem readers that can't easily use the spf mechanism (for example, > gup callers which make use of the returned vmas). But again that is a > separate topic to explore which doesn't have to get resolved before > spf goes in. Well, I believe we should _really_ re-evaluate the range locking sooner rather than later. Why? Because it looks like the most straightforward approach to the mmap_sem contention for most usecases I have heard of (mostly a mm{unm}ap, mremap standing in the way of page faults). On a plus side it also makes us think about the current mmap (ab)users which should lead to an overall code improvements and maintainability. SPF sounds like a good idea but it is a really big and intrusive surgery to the #PF path. And more importantly without any real world usecase numbers which would justify this. That being said I am not opposed to this change I just think it is a large hammer while we haven't seen attempts to tackle problems in a simpler way. -- Michal Hocko SUSE Labs 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.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=unavailable 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 E5007C282E1 for ; Tue, 23 Apr 2019 10:49:05 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 67E9821773 for ; Tue, 23 Apr 2019 10:49:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67E9821773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44pKv33YphzDqJM for ; Tue, 23 Apr 2019 20:49:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=kernel.org (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=mhocko@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44pKry4Sg7zDqJh for ; Tue, 23 Apr 2019 20:47:13 +1000 (AEST) 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 5E467AF1C; Tue, 23 Apr 2019 10:47:09 +0000 (UTC) Date: Tue, 23 Apr 2019 12:47:07 +0200 From: Michal Hocko To: Michel Lespinasse Subject: Re: [PATCH v12 00/31] Speculative page faults Message-ID: <20190423104707.GK25106@dhcp22.suse.cz> References: <20190416134522.17540-1-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , sergey.senozhatsky.work@gmail.com, Peter Zijlstra , Will Deacon , linux-mm , Paul Mackerras , Punit Agrawal , "H. Peter Anvin" , Mike Rapoport , Alexei Starovoitov , Andrea Arcangeli , dave@stgolabs.net, Minchan Kim , aneesh.kumar@linux.ibm.com, x86@kernel.org, Matthew Wilcox , Daniel Jordan , Ingo Molnar , David Rientjes , "Paul E. McKenney" , Haiyan Song , Nick Piggin , sj38.park@gmail.com, Jerome Glisse , Andi Kleen , kemi.wang@intel.com, "Kirill A. Shutemov" , Thomas Gleixner , Laurent Dufour , zhong jiang , Ganesh Mahendran , Yang Shi , linuxppc-dev@lists.ozlabs.org, LKML , Sergey Senozhatsky , vinayak menon , Andrew Morton , Tim Chen , haren@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon 22-04-19 14:29:16, Michel Lespinasse wrote: [...] > I want to add a note about mmap_sem. In the past there has been > discussions about replacing it with an interval lock, but these never > went anywhere because, mostly, of the fact that such mechanisms were > too expensive to use in the page fault path. I think adding the spf > mechanism would invite us to revisit this issue - interval locks may > be a great way to avoid blocking between unrelated mmap_sem writers > (for example, do not delay stack creation for new threads while a > large mmap or munmap may be going on), and probably also to handle > mmap_sem readers that can't easily use the spf mechanism (for example, > gup callers which make use of the returned vmas). But again that is a > separate topic to explore which doesn't have to get resolved before > spf goes in. Well, I believe we should _really_ re-evaluate the range locking sooner rather than later. Why? Because it looks like the most straightforward approach to the mmap_sem contention for most usecases I have heard of (mostly a mm{unm}ap, mremap standing in the way of page faults). On a plus side it also makes us think about the current mmap (ab)users which should lead to an overall code improvements and maintainability. SPF sounds like a good idea but it is a really big and intrusive surgery to the #PF path. And more importantly without any real world usecase numbers which would justify this. That being said I am not opposed to this change I just think it is a large hammer while we haven't seen attempts to tackle problems in a simpler way. -- Michal Hocko SUSE Labs