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=-7.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 34D55C4727E for ; Wed, 30 Sep 2020 12:20:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 961DB2071E for ; Wed, 30 Sep 2020 12:20:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iHHnjk1V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 961DB2071E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F3EA66B0068; Wed, 30 Sep 2020 08:20:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF0A36B006C; Wed, 30 Sep 2020 08:20:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E06CC6B006E; Wed, 30 Sep 2020 08:20:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id CAD0F6B0068 for ; Wed, 30 Sep 2020 08:20:17 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8CD4C1730846 for ; Wed, 30 Sep 2020 12:20:17 +0000 (UTC) X-FDA: 77319635274.02.pull82_0c0e42927192 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 64747101B2300 for ; Wed, 30 Sep 2020 12:20:17 +0000 (UTC) X-HE-Tag: pull82_0c0e42927192 X-Filterd-Recvd-Size: 3923 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 12:20:16 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id g72so1100746qke.8 for ; Wed, 30 Sep 2020 05:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=a/ihWnKV+oV5XAtuuw5DACc3ncxXKguwA9r9mRzB0hc=; b=iHHnjk1VOSBJQ3iFruljNrZ+Wpeifr4x3pYrbU6YTfkITTkzAOPUmL0zBAdNDco0gs we7QqaU8lyo4ZSJvcqco4CEhvKaaBhPWurYSHiGAjJE0PNzSuJQXDQdNwt0zbWZwY/c7 7PR7ZBOPQduYF++bFnMoht+ADdKnBCMLvcU5pm9/9gLM1NG70jPc9My2cpXKB9Ho35He GV/kuMJtlI04kj3P8M09bI1uxV94D2xeh20XwTMAOn2Cyh8NFLkGn5qYkZgsbc0Dlpqb IUP2gakEhglI1oIWR6jWymCtocoXuh9IXxJtYHYY6+zdbPSeaPT9uWqpHdjsvwqWgOoU A2GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=a/ihWnKV+oV5XAtuuw5DACc3ncxXKguwA9r9mRzB0hc=; b=Ufx42UoIbvmnHLW9wtJw2vqHb5hYj3Tg5bZ0xN5HCSuoji5jCt/IdF2gMCpWXBhST5 zyBVO2aOtNTCvVn4y8vZ8YdSKWgyC7SkWOa10cIGKzi2FsHzQVNi6acElkQ/U0TAATvf A0ic7jaEpZc/yuj0eGD0rjPycxyvFl2PVqVPH9fv7M83K1/lwTDRhyuNMWfm3C5eZLp9 zLvWl2epAFk3xplJ1rXlPSM5m3WCDUUcQ4c/fTtgg6vr0X1oRSwWUH4xdu/us38pWocu g/+g7zT3GAAJNHDuZobS+e5Qon/7vg5kTgZH/ifA/AyGPb+PZ0AhwFwF6dzf/laRWZ3I qy3A== X-Gm-Message-State: AOAM533h+l7+qpVKEpl6kl0R4Y9rz4UxZLprTM1nJycmZ0hFmcfemJJA hD7YoTrjO2vWcyAQZjZeflfnMA== X-Google-Smtp-Source: ABdhPJwTRKRuWNsiDoXCyh1dXAKtzwNc6iFUgkI2e5VPtC4P/rXfuilDJCA6ONGo/slpu0AhW297gw== X-Received: by 2002:a37:658b:: with SMTP id z133mr2033278qkb.221.1601468416016; Wed, 30 Sep 2020 05:20:16 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id h199sm1858005qke.112.2020.09.30.05.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 05:20:15 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kNb5i-003vuI-Ng; Wed, 30 Sep 2020 09:20:14 -0300 Date: Wed, 30 Sep 2020 09:20:14 -0300 From: Jason Gunthorpe To: Jann Horn Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Eric W . Biederman" , Michel Lespinasse , Mauro Carvalho Chehab , Sakari Ailus Subject: Re: [PATCH 1/4] mm/gup_benchmark: Take the mmap lock around GUP Message-ID: <20200930122014.GB9916@ziepe.ca> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Sep 29, 2020 at 06:19:59PM -0700, Jann Horn wrote: > To be safe against concurrent changes to the VMA tree, we must take the > mmap lock around GUP operations (excluding the GUP-fast family of > operations, which will take the mmap lock by themselves if necessary). > > This code is only for testing, and it's only reachable by root through > debugfs, so this doesn't really have any impact; however, if we want to add > lockdep asserts into the GUP path, we need to have clean locking here. > > Signed-off-by: Jann Horn > --- Reviewed-by: Jason Gunthorpe Jason