Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp354220ybk; Wed, 20 May 2020 01:07:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuTiKUCU860BXAxVtan6euKxkKAx7XyLQvFi+oW8E0rHgg9IeEnrkHvPM1nr49CsT1akCP X-Received: by 2002:a05:6402:b38:: with SMTP id bo24mr2380837edb.24.1589962036645; Wed, 20 May 2020 01:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589962036; cv=none; d=google.com; s=arc-20160816; b=EZnDpVqyL6aunDpuSkwxPi2PehHnmkWJ3vYZAOOBwaDiTSmlLqCFslMNuewsitinak NxXbV69YhwcJBD2OjkDZBvSZeYrER1wQE429xClBHo6+ZPOqXHXTmBpoUWH+fky1JjM+ VsGrguqNNk9Iuc4IlUmPaQ8JZt/myt/Ix/tlVS2nK6Fg4CUuY05E8Dx/87+dSby3fDSo MxDc5v6WOxqacJYKltWQH1OORLHkYv5MhUmyWY6MIv49XtBBXWlk/YvfbnV5x3PLSrAp esPCdmS/9+nk3z4tX5m6SBoMRUBCx4NeTQBu1EUvtG5zvVFCEpN9KALjOEZy+WA7jdYA ACaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MMh4r2XDfrH+QhUAjbGNaAAedxRKs2n77NOZ3gAlNgM=; b=nTZ09XRwaIoQ7dViUwU+HqsyTzpjq0nWuH06fUbGVHsO5QA56FcAVs9bzsbPZOwNrN 3bQS0cZGa96YteXLhMum3PbZVfo09v/0ZloH/mVj5oZLndctjK+kXJmo7pag2RwL0sr/ 2fGEKmoR93RtmLmTommBewNyShWbEQBFYCiExN+Ej7xRJkvofR7YYzbW04UTV0k0Ic9H W+Lg3TDOQvOePOVMxacQnOwQZCqmRCLg0MqPqOQPtlXAXOrrB04AI/Nr8YISo+NTx21T DNJEtC698M7Rdf4fsZPxegajGFZ2mW2l5aZGsAfw/76N+R+4PM3L6XYRpVsCD7rpeDXI lOEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=j1tBNZ3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si1043335eds.446.2020.05.20.01.06.54; Wed, 20 May 2020 01:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=j1tBNZ3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgETICz (ORCPT + 99 others); Wed, 20 May 2020 04:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETICy (ORCPT ); Wed, 20 May 2020 04:02:54 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E43E5C061A0E for ; Wed, 20 May 2020 01:02:53 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id g79so535132ybf.0 for ; Wed, 20 May 2020 01:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MMh4r2XDfrH+QhUAjbGNaAAedxRKs2n77NOZ3gAlNgM=; b=j1tBNZ3vq8QjvMUxKQLFkSaXLnMqXwQrzxwRSQwsFakURnOmf52OxUufogNpo15Vi+ TqcklyRtsYt6ye34t3EbcbPFOWiFoXFKBPkjjm97yJrD7k3ilSGHzcoiLsffHpQWknjo YATZgknEk4I7HHu7fnVchqq+bkDBzrh8l5gvO5p+v/4G0RHJ651mTilPUYKq2M2l1v9U rR2V24mTZajqpmBGTbQL3SzWGzXWL02NaqCLZjcquUlfitFdAKw3WhsUuC81K71ZBr+P QfwZ82hxj7CVZhB5ho1ZoDGwBUjyecyoU8I/PPQ/NgrVAcqzP9MAWcu+XW+TOijNZXxv 1S6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MMh4r2XDfrH+QhUAjbGNaAAedxRKs2n77NOZ3gAlNgM=; b=ZbNdgGpT1h3NQDXiHtCVQxXgFQ85yvalwRaKW4TufkMIe1bkg883psC29E6pvVXbY9 keLG4KWZdUWoYIW85tbvTO5ZwXQy8CAs5jftz3zET+KzOKK7slOdqT1dnLNO/FrBHvo2 /ME7HYqTTRrQmmc6xDhz73xp/W4J8F2aqxTpKkgBLXKRLI46ym9+Bxcd9JXee40/bK64 E5eMK/a0H+fpi28jMXsO01iR/XRacfYF6RfcToOVnFvjGRaiCwmg9JLunfW66h3V30VS QL7mrB6tQzS0uO6BV8tI2jBUZw4y9cgyN1wdCX6Bbx70OcwwQDswXluL0mzV71lkZoXA mymw== X-Gm-Message-State: AOAM530y4rIstlcFXoH+GCu6u59KiJSXUXSq66JlavHHuZqZcu1Jl2y9 JQYtn0EcYfqw2jrYonKca04x24KEjuEZ9KFcE6q2gw== X-Received: by 2002:a25:ab4c:: with SMTP id u70mr4884998ybi.298.1589961772695; Wed, 20 May 2020 01:02:52 -0700 (PDT) MIME-Version: 1.0 References: <20200422001422.232330-1-walken@google.com> <20200422001422.232330-11-walken@google.com> <20200422015829.GR5820@bombadil.infradead.org> <20200423015917.GA13910@bombadil.infradead.org> <20200424012612.GA158937@google.com> <20200424013958.GC158937@google.com> <20200519131009.GD189720@google.com> <7c540ac9-ba44-7187-5dc2-60b4c761e91c@linux.ibm.com> <20200519153251.GY16070@bombadil.infradead.org> <10d48b77-5c6e-2e10-84e6-16cdd76a45f1@nvidia.com> <9c45327f-5542-c033-ec5e-201e9b0583aa@nvidia.com> In-Reply-To: <9c45327f-5542-c033-ec5e-201e9b0583aa@nvidia.com> From: Michel Lespinasse Date: Wed, 20 May 2020 01:02:39 -0700 Message-ID: Subject: Re: [PATCH v5.5 10/10] mmap locking API: rename mmap_sem to mmap_lock To: John Hubbard Cc: Matthew Wilcox , Laurent Dufour , Andrew Morton , linux-mm , LKML , Peter Zijlstra , Vlastimil Babka , Liam Howlett , Jerome Glisse , Davidlohr Bueso , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Daniel Jordan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 12:32 AM John Hubbard wrote: > On 2020-05-19 19:39, Michel Lespinasse wrote: > >> That gives you additional options inside internal_get_user_pages_fast(), such > >> as, approximately: > >> > >> if (!(gup_flags & FOLL_FAST_ONLY)) > >> might_lock_read(¤t->mm->mmap_lock); > >> > >> ...not that that is necessarily a great idea, seeing as how it merely changes > >> "might lock" into "maybe might lock". :) > > > > I think that is completely fine, makes sure everyone not using > > FOLL_FAST_ONLY realizes that the call could block. > > > > Can I ask you to add that assertion in your patchset ? Based on > > Matthew's feedback, I would do it in my patchset, but it doesn't seem > > worth doing if we know this will conflict with your changes. > > Sure, that's no problem. Although it looks like my changes may land > in mmotm first, and then your patchset, so maybe the right move is to > make this change *after* both of those things happen, yes? I don't have a strong opinion on this. I would suggest you add the might_lock_read() assertion and whoever comes in second will deal with the conflict by changing mmap_sem to mmap_lock in that assertion. -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.