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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 2072EC433E2 for ; Fri, 11 Sep 2020 16:47:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD109206A2 for ; Fri, 11 Sep 2020 16:47:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XQmOLpb3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="LzixW8IE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD109206A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K0m+FeiI3ypdVbvpahwdagT8pujf8fqOag9vWKrWM2s=; b=XQmOLpb3ofrxfQIyIBqQFZBRI aaHcgGbN9JTFVEdjxzYB+6uWJMugWCnKliYI0ouwU3mpPYXldy6qkHQQcSDDVknSvM0Ks5X5rQI8S SBNbsBPxqqEw+1tVCHs5OAil3mEw4uhA8NscE73G0/UNcB4/QJ+ZRTy+NDRr2GRXMJ4oHNimiCEqH ehgxPYsJvOPsK31apOTCz5/bPbu2NOmVSDQOOMUjNrrfUrOa+4BEeDh5AkybP+Yzmk2PRPlgaSmZy wJ9bLGXOlA1WRTS1wvZPORlmfPyaCdKhFJzzxYWVrIRL8dF+NeMDXwVysjeyVJTfC42Eqdo2YZ23M wMO4L91yg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGmBS-00023C-Uz; Fri, 11 Sep 2020 16:45:59 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGmBO-00021S-RX for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 16:45:56 +0000 Received: by mail-ej1-x643.google.com with SMTP id o8so14637582ejb.10 for ; Fri, 11 Sep 2020 09:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ymUunqCLw2vPuQ1VbXcUDi5LPgcqHOLwtMhV+h1hP00=; b=LzixW8IE64pueJHPc4pkVfB4hu8uL7V9KR6+6qOQDiBrSui1M4vSI9xeqysgklBESL 0IQ4jxvW89dAuyt0txhLnLuupNLcl3TzUTNbKM8yk1mUHFyRH5GgOM7DPBaXlmnovHXl RwxBgeTE5qnMUevVAeinQ8lEe8Rzs7ehh51xA= 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=ymUunqCLw2vPuQ1VbXcUDi5LPgcqHOLwtMhV+h1hP00=; b=b8xh3YXGgFdo8lkZk4ZL7+XKNE6DclMt+FN8C73agnPnPhdaLZ+cvVE+YNqVfPUKFU x14InHaLznEOm3h4+udVt70iK7xQGt5o5wC3CGMz7sbdY6OWjShDg6Xqbtn1pbP5MWDM 7nzod2prAhdOWWz95lFZPPn9Ro4IDk/F63XI2w2fPTgmupQlwbsVx9O/RB3B242V3SIb WuZarcYWz19RLdRskg2eyTYXIkkfvtMYh6yYjbXLpgNBhQka/Tk4i/COZgGWCzlgdd/X 0XlugMd47kZ33H7wIEIjxC+XgQydssrxpNQxP1s3QAq+q/6OBKGbqFcCQ8PYY2ivCX0p nYkA== X-Gm-Message-State: AOAM532WJZ37nwG16ge7PfzK3ppzh6nY36jop/QX+p4RPGKq0yAi1MjV aIKhIMzub1zTXojSUgZR1HXQZuY2rgeaiQ== X-Google-Smtp-Source: ABdhPJys1CJs739KBwkaHjNgcAjBhjElAHwQ/jiIEC1NTM2hFIO5n8I1cQDeh/7YjJ2BOD6fwfrQUA== X-Received: by 2002:a17:906:ae8f:: with SMTP id md15mr2752635ejb.131.1599842753211; Fri, 11 Sep 2020 09:45:53 -0700 (PDT) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id h10sm1877956ejt.93.2020.09.11.09.45.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 09:45:52 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id e22so150723edq.6 for ; Fri, 11 Sep 2020 09:45:51 -0700 (PDT) X-Received: by 2002:ac2:5594:: with SMTP id v20mr585120lfg.344.1599842749970; Fri, 11 Sep 2020 09:45:49 -0700 (PDT) MIME-Version: 1.0 References: <0dbc6ec8-45ea-0853-4856-2bc1e661a5a5@intel.com> <20200909142904.00b72921@thinkpad> <20200909192534.442f8984@thinkpad> <20200909180324.GI87483@ziepe.ca> <20200910093925.GB29166@oc3871087118.ibm.com> <20200910181319.GO87483@ziepe.ca> <0c9bcb54-914b-e582-dd6d-3861267b6c94@nvidia.com> <20200910221116.GQ87483@ziepe.ca> <20200911121955.GA10250@oc3871087118.ibm.com> In-Reply-To: <20200911121955.GA10250@oc3871087118.ibm.com> From: Linus Torvalds Date: Fri, 11 Sep 2020 09:45:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding To: Alexander Gordeev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_124554_932488_AF8CE2A4 X-CRM114-Status: GOOD ( 15.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , Dave Hansen , Paul Mackerras , linux-sparc , Claudio Imbrenda , Will Deacon , linux-arch , linux-s390 , Vasily Gorbik , Christian Borntraeger , Richard Weinberger , linux-x86 , Russell King , Jason Gunthorpe , Ingo Molnar , Catalin Marinas , Andrey Ryabinin , Gerald Schaefer , Heiko Carstens , Arnd Bergmann , John Hubbard , Jeff Dike , linux-um , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , linux-arm , linux-mm , LKML , Michael Ellerman , Andrew Morton , linux-power , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 11, 2020 at 5:20 AM Alexander Gordeev wrote: > > What if the entry is still pud_present, but got remapped after > READ_ONCE(*pudp)? IOW, it is still valid, but points elsewhere? That can't happen. The GUP walk doesn't hold any locks, but it *is* done with interrupts disabled, and anybody who is modifying the page tables needs to do the TLB flush, and/or RCU-free them. The interrupt disable means that on architectures where the TLB flush involves an IPI, it will be delayed until afterwards, but it also acts as a big RCU read lock hammer. So the page tables can get modified under us, but the old pages won't be released and re-used. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel