Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3431378yba; Tue, 23 Apr 2019 03:48:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxubpoY9RXkrvwSvGlqvLOFhYCyA4i1zQ4+25cy9L2lHpmEPsj+gwYeohJJcSN+j8SbH+FK X-Received: by 2002:a63:ed4e:: with SMTP id m14mr24438782pgk.182.1556016528350; Tue, 23 Apr 2019 03:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556016528; cv=none; d=google.com; s=arc-20160816; b=x1d3545mxThoa8Vidk5oHPQO5n+wPIZi8/s3P60/m72XVO/RQHSDSEvA7YE1pMTEar YOkzwv0VCxngNYVYFDxipd421Rsqcnrx4iWqv1I32odlskT0f3ibwhOoDyyV89M771Cf lYINjwUd9d1Z7hg9n3vO0wxr2xiIZVtMqXtbUFyNj5t+X0PjvWU55JAr+6iNY2ARf58K urjumC/+eRWgN0NhAna9TeVVq5yh/Kn1xCG5hd4yb6QXAFmal/7Q5oFVpllP3m10nYhi H/3QYAc5Qn1xseRbpIgUyJp3RI4vb+BX7/iI7KGK3xYDIo4REBjrmEXhntaQLpenOetU Hxgw== 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=I7wK+U4okHW9rsvcyKmYk5H6L/Mmu/w6eyeKgP3ZLYU=; b=toXRm1EP8ta0cHg7e/npWA8twjAs1eha+RIQurxAu/tobjTBPgTyH0/HMNymtnr8fZ g+4GKp1QvBRyy+pXT4imbV89LOfyxQQ6EyIkJ1zuJuYCJXCxPyj0e7Eihwmc5ZH4Z8An ekTyO0H8UgaSoQs8lomhVCi2BrVO1yxusMvRQPEJr1cK+Aba4jEt7wCc0QmMUYvDHHgJ zBy8MgmohvZI1Fz4+hx1FCO+bg2B+pqJmrLO3loO62cKe+PXe9d2ngA8Ws/K592cmsaW ecRYm4G84671kM4mE+eOR+JVjLuiiUVD81TKAmfiBL+ekRJ+DnyJe0tunwjv/W8ExrtL yDyw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p88si15592452pfi.142.2019.04.23.03.48.31; Tue, 23 Apr 2019 03:48:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbfDWKrL (ORCPT + 99 others); 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