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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 73A9AC433E0 for ; Wed, 20 May 2020 08:02:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 228FB20708 for ; Wed, 20 May 2020 08:02:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="j1tBNZ3v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 228FB20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A17BE80007; Wed, 20 May 2020 04:02:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C880900002; Wed, 20 May 2020 04:02:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88FA180007; Wed, 20 May 2020 04:02:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 6F4E6900002 for ; Wed, 20 May 2020 04:02:54 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 380A8824805A for ; Wed, 20 May 2020 08:02:54 +0000 (UTC) X-FDA: 76836356268.03.shop37_709f432067811 X-HE-Tag: shop37_709f432067811 X-Filterd-Recvd-Size: 5071 Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 08:02:53 +0000 (UTC) Received: by mail-yb1-f195.google.com with SMTP id s37so534600ybe.13 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=nqcFYyH1N0yZ5iAhx/b3qTmpD2CjSt0bpE5T1pUjp51AQn9PWi5qv3KGL2/QJcznSs BrPjNg9JK6odoVIFB3R5BQUhoGJKBlWYGrCSy9VGBlln05GbYKP2rVQj5SEYP7QXsya+ 9RB/xHWjgR7PkywYanUI/s4qM5MK93DyBD+zDAbngW93b4cdISN9YlLH4QJ4+zMaikBQ B2QUYXSD98iuYric46/m78jYnjp0FbQUXCqUuJ+VhLtnsXiCLHPvaaVUyNx3Fh2UGlXv FGG6jz1e6h9OT37YQ1JSJ9Thfrf/4GPqWWjIn50A4PyhhnO+AK5inTS8kX7GOkBo5LnC OyVQ== X-Gm-Message-State: AOAM530BFPo9bZ8Z0bkuZNTQa8WBDVsieAzRemfA/W2KNTIICSmBe5Oa cSnLjTRRV/hwx9nB2b9n4AetlqmW6DBWLGW5gQ/5oA== X-Google-Smtp-Source: ABdhPJwQP7HRbxwX6H9f7OR6UQElQShg+ArQT0pXrQiBLvOhGRi2/6SEChtkn7AJjr2RHgYOnsxQYJKuH+CxrxrzCk4= 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" 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 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.