Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6293613rwl; Thu, 29 Dec 2022 10:16:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaaNPYRIhM1kyBWB99GpHjfsJ2XNJDYozSlxIlwypSMm3witF2EkoVsapI+aacxzRfKS9g X-Received: by 2002:a05:6a21:6d90:b0:b0:3318:ab59 with SMTP id wl16-20020a056a216d9000b000b03318ab59mr45899079pzb.14.1672337761310; Thu, 29 Dec 2022 10:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672337761; cv=none; d=google.com; s=arc-20160816; b=raxx9h6LFhZq5oIz1yRdtsFruGCTcqx7z2SAvDDy0t4JT0VglUFV7QF6lnZxZZie3n 3uqwSkwM/B7DY3yOviH9OADOwPduWvOmnZ1c/qRd578ywiKy2FubRqhg4IYVUG+DftAf CNW0yhrXAGekZYw7wrsjpmeB7TdIdAy8xXNPAUhRInWpKqTbWrNZFXRwK7gu6iRKKkMU Db8iKz4cm8DW7/+H3jsc35kLb5lFiBgqFD+kCFyR/zCYTa94aKJ2yis52+s3h0B6lplL CrNiapkX0fuy1ocmeYlSU/JytkqIBxMROqJf7hrxpfG2I8x439fJqSjIie8eZT5XsFI5 zr+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O6Ikrs1CIxHfi8Ue6kwk76aDhiVwW97NYJ5AhQiikWY=; b=b5e3xeB2WTIepMr0WPDqcrUa+hDnQYvzLNY83LMZdpT7sFsVnCMdikscJS+ev7YaFI o67MPfjuHRaCbgshtzvAV5WmCTQJEmXx8TWYS28VXiMTn8vmLWFWMR20Mu0+LLoz3Deh vHLO+s30L3zgwptx4c7SoIPcoBd18Cn3iaUhL7cQ9Lal3H8LQB8nbSdjadtc2hOl7GWJ 7DvUyXBpiSFYb9brJIhnCqv8L+vyIWqwzcNCm4MlUvaBeQHkZMQwyQnl715zBqqOdHLS UTGuTSwYQTanM7YzlxrOqoLkFW8o/0ZQGNVFIUAiTlpSJfCv3KqIFV8+qBvPZk6BD6Gq 9Dxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fZJ91ZHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020a056a00240d00b0056be3585c3asi20460916pfh.266.2022.12.29.10.15.51; Thu, 29 Dec 2022 10:16:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fZJ91ZHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234111AbiL2RcO (ORCPT + 61 others); Thu, 29 Dec 2022 12:32:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbiL2Rb0 (ORCPT ); Thu, 29 Dec 2022 12:31:26 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FC815813 for ; Thu, 29 Dec 2022 09:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=O6Ikrs1CIxHfi8Ue6kwk76aDhiVwW97NYJ5AhQiikWY=; b=fZJ91ZHH4wjOdmJFKpknmM2JjI ls0n0/1hxa4PVs+RaxBEjxjrk4pI42FWPiAnjtNaKauJuvjhv3Xa7M+buiGTIYLkoF9QItIdP+N3R +Qqb3MWEu6NwN5QK8kLvrU0VRZd+T4/Yzu5S1NaHPEYCmplvs7+Vc4wuiLTGrtmTJy5SXLINYPOBt muE8v74cPqxViZwA0t/J9AL3MJk11Kqp06oNSbfHirv8WqJKupT2QEZ6SSx7hFJuEm825pwiZKVtF rnzyceNMthtUK9ir1LVYqnvCak6NLRNGKOLk5tRutpVoWpmWsvprSRQoFafG66UwygxMa/CBlq8Ny h/Wo9xSw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAwkN-00A11E-Ng; Thu, 29 Dec 2022 17:31:15 +0000 Date: Thu, 29 Dec 2022 17:31:15 +0000 From: Matthew Wilcox To: Lorenzo Stoakes Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, liam.howlett@oracle.com, surenb@google.com, ldufour@linux.ibm.com, michel@lespinasse.org, vbabka@suse.cz, linux-kernel@vger.kernel.org Subject: Re: [QUESTION] about the maple tree and current status of mmap_lock scalability Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 29, 2022 at 05:10:28PM +0000, Lorenzo Stoakes wrote: > On Thu, Dec 29, 2022 at 04:51:37PM +0000, Matthew Wilcox wrote: > > The mmap_lock is taken for many, many things. [snip] > > I am currently describing the use of this lock (for 6.0) in the book and it is > striking just how broadly it's used. I'm diagramming it out for 'core' users, > i.e. non-driver and non-some other things, but even constraining that leaves a > HUGE number of users. I fear this would be overwhelming. I don't think anybody would disagree that the mmap_lock needs to be split up like the BKL was, but we didn't do that by diagramming it out. Instead, we introduced new smaller locks that protected much better-defined things until eventually we were able to kill the BKL entirely. That's what I'm trying to do here -- there is one well-defined thing that the maple tree lock will protect, and that's the structure of the maple tree. It doesn't protect the data pointed to by the pointers stored in the tree, just the maple tree itself. > I've also documented the 'unexpected' uses of the > page_table_lock, which seems to have been significantly improved over time but > still a few cases remain! Now, I think this is useful. There's probably few enough abuses of the PTL that my brain can wrap itself around which ones are legitimate and then deal with the inappropriate ones. > Am happy to give you (+ anybody else on MAINTAINERS list) an early copy of the > relevant bit (once I've finished the diagrams anyway) if that'd be helpful! I'm definitely interested in the PTL. Thank you for the offer! > Now if you guys could stop obsoleting my work that'd be great ;) Never! How else will you get interest in the Second Edition Covering Linux 7.0? ;-)