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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 6D360C43461 for ; Fri, 11 Sep 2020 19:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DAA822208 for ; Fri, 11 Sep 2020 19:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599851692; bh=0/6uWfJdJWAL9eJCKxmmwmOYYZ3cCsVfUmC8dzBhKfM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=kr4pw5YX6Yr1GnxSaLQms2bzoX8gQqQdq3+A7uaxVuuch2N6Z1/j+E8QyqktwZ6Le u1P95d9eWpK3s1QcigZrUYLA0VHgXc0XZJ0Tu9EawhC0IbHz/moPuKtlWRFf6f9uXn 0QAJB+Y9Su/WYZRW+Dtuw7qQpQMslkKrcx2jd6Wc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725849AbgIKTOu (ORCPT ); Fri, 11 Sep 2020 15:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgIKTOr (ORCPT ); Fri, 11 Sep 2020 15:14:47 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F43BC061573 for ; Fri, 11 Sep 2020 12:14:47 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id o8so15161737ejb.10 for ; Fri, 11 Sep 2020 12:14:47 -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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=Clxn1QsgKc2lKUePPSN2NAL/bI5bjfBFRul7KsPI2uaRRhC0MOrKjvIFIZdRmVowg5 Sj/tT1SzRVgDZ+3t3dHFGme2ZZ2AzNzf/iHPNpa3Fuz0WH5hvvP/wmiJL+the/L7uCVO 8PyXw3Q3ZjkkDqlxpbtvaLMr+QGOuNdWTmuIw= 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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=XK3/DsbOQ0e77ajJ4ws7o0O8IL5kx+phSfoV8JIOUw9WqSmbr9OjSCbvkVPgGFqLW1 zp4ZtCZRoTDIMTNXkRpjjp0p8LjM+rAmf46g3bOMnNd749JMsmUELOrZeB6sWHaubac6 6D5Z1lY+BLnx1TfFhbQcBlvw/tNTC6sCoVIe+C/VfvHQRRM5zInS73swmF5J34QNMwDR jJaHGg/FtDI/X49QIttBktz61zpEkDvUlVD9acd+QtJ18aSdPXpddXg9X3jiOJdU9KdO PaCE1ehDNfPXce4WQLJ7CcaAxFRhbBnK43o6WlL7Urmar7Nai7qcpFry+PH2lFBNEZk9 m75A== X-Gm-Message-State: AOAM530hA3W6jL9pcZNmUAqiZGAZ8sq5D3Q2SLib7iKfPoL1OLgUhtud igRhXTw5y75i4ssLeVsJLsD/UTgMgxa9AA== X-Google-Smtp-Source: ABdhPJwCX5zMi80QrbparanrNRkOlkgcGayrXj+sGbqbvy5/UUAMkZP909UBH6pvMarKtHtKbEgVIg== X-Received: by 2002:a17:906:660f:: with SMTP id b15mr3622559ejp.333.1599851685538; Fri, 11 Sep 2020 12:14:45 -0700 (PDT) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com. [209.85.208.53]) by smtp.gmail.com with ESMTPSA id g10sm2092755ejp.34.2020.09.11.12.14.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 12:14:45 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id w1so11227387edr.3 for ; Fri, 11 Sep 2020 12:14:45 -0700 (PDT) X-Received: by 2002:ac2:4ec7:: with SMTP id p7mr651524lfr.352.1599851382451; Fri, 11 Sep 2020 12:09:42 -0700 (PDT) MIME-Version: 1.0 References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> In-Reply-To: From: Linus Torvalds Date: Fri, 11 Sep 2020 12:09:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding To: Vasily Gorbik Cc: Jason Gunthorpe , John Hubbard , Gerald Schaefer , Alexander Gordeev , Peter Zijlstra , Dave Hansen , LKML , linux-mm , linux-arch , Andrew Morton , Russell King , Mike Rapoport , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Dave Hansen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Andrey Ryabinin , linux-x86 , linux-arm , linux-power , linux-sparc , linux-um , linux-s390 , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda 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 Fri, Sep 11, 2020 at 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how horrible it would be to convert all the other users, but a quick grep convinced me that yeah, it's only GUP that is this special, and we don't want to make this interface be the real one for everything else too.. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Date: Fri, 11 Sep 2020 19:09:25 +0000 Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding Message-Id: List-Id: References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vasily Gorbik Cc: Jason Gunthorpe , John Hubbard , Gerald Schaefer , Alexander Gordeev , Peter Zijlstra , Dave Hansen , LKML , linux-mm , linux-arch , Andrew Morton , Russell King , Mike Rapoport , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Dave Hansen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Andrey Ryabinin , linux-x86 , linux-arm , linux-power , linux-sparc , linux-um , linux-s390 , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda On Fri, Sep 11, 2020 at 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how horrible it would be to convert all the other users, but a quick grep convinced me that yeah, it's only GUP that is this special, and we don't want to make this interface be the real one for everything else too.. Linus 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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 BCA69C43461 for ; Fri, 11 Sep 2020 19:09:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2CD7D2220D for ; Fri, 11 Sep 2020 19:09:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Clxn1Qsg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CD7D2220D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 298406B0002; Fri, 11 Sep 2020 15:09:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 247FB6B0003; Fri, 11 Sep 2020 15:09:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1375B6B0037; Fri, 11 Sep 2020 15:09:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id F24516B0002 for ; Fri, 11 Sep 2020 15:09:47 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B1626181AEF10 for ; Fri, 11 Sep 2020 19:09:47 +0000 (UTC) X-FDA: 77251720014.30.quiet61_4d00fb3270f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 7F58D180B3AA7 for ; Fri, 11 Sep 2020 19:09:47 +0000 (UTC) X-HE-Tag: quiet61_4d00fb3270f1 X-Filterd-Recvd-Size: 5113 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Sep 2020 19:09:46 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id d15so6889709lfq.11 for ; Fri, 11 Sep 2020 12:09:46 -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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=Clxn1QsgKc2lKUePPSN2NAL/bI5bjfBFRul7KsPI2uaRRhC0MOrKjvIFIZdRmVowg5 Sj/tT1SzRVgDZ+3t3dHFGme2ZZ2AzNzf/iHPNpa3Fuz0WH5hvvP/wmiJL+the/L7uCVO 8PyXw3Q3ZjkkDqlxpbtvaLMr+QGOuNdWTmuIw= 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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=Ckr95a3rTfHlI/WnjAXtM326s27f27PY6sNwW1dIJX/mCMyO+2ENl2dw2Gb5uwrP/t SNrmOAxsoaRix8TqhS1nk51XIRgEomz+1oKrPNxSR6zdqcYPfMkawLa6uzJKDn0QOUlS VAcsrw5I0qO5R1w6H0AME399i4xG/7EMSsVYLIrAmJBLVvaIMX6u9U24I70zcn6zbcCD xEfNxcElWBWbWf3nnldrFsNpUit5tMyGfnfmaxFEatnsBrTn/hcmYvOgzbnl2/RVSlM7 pTbrNcf7UfwtTkvcrM/TgwGFZIIbCFQdPGvDZajC98Gp1rz85tij+AMscitdc4M8ALJZ bXFg== X-Gm-Message-State: AOAM533GGSNECYr197/137MBfCRxMK2/obfYpLbNAvVfzvbEAnCPiN9m PIHngtBz5UW+bhmm6ddxoDCC1T383ylcgA== X-Google-Smtp-Source: ABdhPJxkJvfMxSjYrHJpXT6iTE51mbbCBqcUoiYj77xg8A72wtHvkenyU6ITxydLn9cT1LcqdV6jVA== X-Received: by 2002:a05:6512:10d1:: with SMTP id k17mr1235210lfg.179.1599851385101; Fri, 11 Sep 2020 12:09:45 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id a12sm637381ljk.109.2020.09.11.12.09.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 12:09:43 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id u8so6930320lff.1 for ; Fri, 11 Sep 2020 12:09:42 -0700 (PDT) X-Received: by 2002:ac2:4ec7:: with SMTP id p7mr651524lfr.352.1599851382451; Fri, 11 Sep 2020 12:09:42 -0700 (PDT) MIME-Version: 1.0 References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> In-Reply-To: From: Linus Torvalds Date: Fri, 11 Sep 2020 12:09:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding To: Vasily Gorbik Cc: Jason Gunthorpe , John Hubbard , Gerald Schaefer , Alexander Gordeev , Peter Zijlstra , Dave Hansen , LKML , linux-mm , linux-arch , Andrew Morton , Russell King , Mike Rapoport , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Dave Hansen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Andrey Ryabinin , linux-x86 , linux-arm , linux-power , linux-sparc , linux-um , linux-s390 , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7F58D180B3AA7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 Fri, Sep 11, 2020 at 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how horrible it would be to convert all the other users, but a quick grep convinced me that yeah, it's only GUP that is this special, and we don't want to make this interface be the real one for everything else too.. Linus 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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 DA395C43461 for ; Fri, 11 Sep 2020 19:17:36 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 282CE22208 for ; Fri, 11 Sep 2020 19:17:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Clxn1Qsg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 282CE22208 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4Bp59n4ZnyzDqbB for ; Sat, 12 Sep 2020 05:17:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2a00:1450:4864:20::143; helo=mail-lf1-x143.google.com; envelope-from=torvalds@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=google header.b=Clxn1Qsg; dkim-atps=neutral Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Bp57j5ZxYzDqY1 for ; Sat, 12 Sep 2020 05:15:45 +1000 (AEST) Received: by mail-lf1-x143.google.com with SMTP id b22so3366112lfs.13 for ; Fri, 11 Sep 2020 12:15:45 -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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=Clxn1QsgKc2lKUePPSN2NAL/bI5bjfBFRul7KsPI2uaRRhC0MOrKjvIFIZdRmVowg5 Sj/tT1SzRVgDZ+3t3dHFGme2ZZ2AzNzf/iHPNpa3Fuz0WH5hvvP/wmiJL+the/L7uCVO 8PyXw3Q3ZjkkDqlxpbtvaLMr+QGOuNdWTmuIw= 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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=j0ADHkbii1BkMspl49WZHFgAMj9xRojYyRjyRXIs1dJPxa0+1s1wRpCWQsQj+pbjZJ ht5OwSFLiv+PeoCj1kTgdKSLQyTStodCB15xw/eX2W1kzzIQS736lbnBtBgUcvmjCXc1 Vw1QoGeI11a5sT4PLhwW7BbaTAOHdTNVx2OdHYZdFZ/gspZrvfdvs7YdvMvtLLOIz7Ft ZsloniMLU+mrWuWS4V9Kkz960zJmkDwQRDSKxT0VrqrjIYfq1yWOeIav4TuAF9ckOCTt cIAk7s4+Nh5GfUondcp0rMgTJSjaftZifX82JUokP5hduQDs/dpbtDkJ8rwkWcP/WgAk od2Q== X-Gm-Message-State: AOAM530VYsdLBNvpQtCS73fe4XluG7eAL7ubq+TxYYvnZ+26thPPAI1E SJJRJ0Xb//AfxgX4AYifU7xPsIuyvF00EQ== X-Google-Smtp-Source: ABdhPJxWnUwFdJbXBfRV7/kF258JBEMOXl6z44VKlns+9LviJjEFdll3lm33n1+yfigoW0nfSxtL+A== X-Received: by 2002:a19:42c4:: with SMTP id p187mr1238944lfa.149.1599851739553; Fri, 11 Sep 2020 12:15:39 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id w17sm542460lfk.95.2020.09.11.12.15.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 12:15:39 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id r24so13396553ljm.3 for ; Fri, 11 Sep 2020 12:15:39 -0700 (PDT) X-Received: by 2002:ac2:4ec7:: with SMTP id p7mr651524lfr.352.1599851382451; Fri, 11 Sep 2020 12:09:42 -0700 (PDT) MIME-Version: 1.0 References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> In-Reply-To: From: Linus Torvalds Date: Fri, 11 Sep 2020 12:09:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding To: Vasily Gorbik Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Dave Hansen , Dave Hansen , Paul Mackerras , linux-sparc , Alexander Gordeev , Claudio Imbrenda , Will Deacon , linux-arch , linux-s390 , 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 , Andrew Morton , linux-power , Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Sep 11, 2020 at 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how horrible it would be to convert all the other users, but a quick grep convinced me that yeah, it's only GUP that is this special, and we don't want to make this interface be the real one for everything else too.. Linus 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 5B109C43461 for ; Fri, 11 Sep 2020 19:18:16 +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 0297C22208 for ; Fri, 11 Sep 2020 19:18:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dnrLUd7a"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Clxn1Qsg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0297C22208 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=h6Syium46mC0sToSM/82L8CXapM/rJH51+TFKlFn5+w=; b=dnrLUd7a+8sqUkJxA62X9ybky l7Ez9cS2bgxTNe4yUlk3RJ1TaAVQjfttRxNqGmemNbUaIPHGJkfjADj91sI2/cQ8OCJamwHWUs8dl yijI3DHAazJe2ZJe5gLhMJEi6IDw1gaHDQnW6/CkSvcN2wUEFYn8/kjLTCKmZV/UPm2lz6WFb3iJg XYu4VFMsvusc1o8cY2qsxtfmQ3z0wQ4MG6o27lOdOeCJi8apYt2fqOD/Pw47aY0mabhnfcktxN0BY l2732LB713pLBJtQeuBDqLTiUY2RGSUuwg1ym+ccwluEDfWAc9PZTkyw29wsXfmEwqXF6OL2bbsDn qdrCGIBWQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGoXG-00083O-5L; Fri, 11 Sep 2020 19:16:38 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGoXC-00082v-Q8 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 19:16:35 +0000 Received: by mail-ej1-x644.google.com with SMTP id r7so15136567ejs.11 for ; Fri, 11 Sep 2020 12:16:34 -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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=Clxn1QsgKc2lKUePPSN2NAL/bI5bjfBFRul7KsPI2uaRRhC0MOrKjvIFIZdRmVowg5 Sj/tT1SzRVgDZ+3t3dHFGme2ZZ2AzNzf/iHPNpa3Fuz0WH5hvvP/wmiJL+the/L7uCVO 8PyXw3Q3ZjkkDqlxpbtvaLMr+QGOuNdWTmuIw= 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=lUTLfTAHN/JEc/vY2NZSlPv25B0eM9+I2UvpN7fipvE=; b=m4YzmUW3JVz/BjDy4c8/gsui1PssQq60CNGWR1faHy/rYExLZoPu/WhdB1eP8wPOs5 wcTujDb1BJgWEJx8zwonwGBipr/rRsTO/+5pPCqZmgeRWHH9CP3ztR/YQy7OAMyVWxaz 5P0UFZUbyN2V8M5SU/TwMtmm5F4BkoEst0MAhIOKRRrmB5Nxkond1E2nyIqT/evLMUGy dWoW7RK8HqJFOpLpsuDaKVrMUnXS17IdpnOEyIXZX6cDbP/MQuNw94khyZJXUECus6Cq AmB9ipC/W+kiqEqgQR6Lgjn9wB77sd0BRFG6oqvyFdw/ayAdQNl7Eb6yc41tZq38K66S K43Q== X-Gm-Message-State: AOAM530xwSYcO2qq1+pylKsjjUtTLjuqvUTj6t04ACqzTkj4HPeTbiuM MIPhsq5ssQIDqeGEsqiugyy7LjihHF96Zg== X-Google-Smtp-Source: ABdhPJwhBthTj5W+83a1YDW0HjIvRMxC/YBcbKKTYh9jaHFNOecykPDxlKCEwnQzRIr3SncpjFrfFg== X-Received: by 2002:a17:906:3506:: with SMTP id r6mr3452033eja.55.1599851793153; Fri, 11 Sep 2020 12:16:33 -0700 (PDT) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com. [209.85.218.47]) by smtp.gmail.com with ESMTPSA id j14sm2356452edr.91.2020.09.11.12.16.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 12:16:32 -0700 (PDT) Received: by mail-ej1-f47.google.com with SMTP id lo4so15153013ejb.8 for ; Fri, 11 Sep 2020 12:16:32 -0700 (PDT) X-Received: by 2002:ac2:4ec7:: with SMTP id p7mr651524lfr.352.1599851382451; Fri, 11 Sep 2020 12:09:42 -0700 (PDT) MIME-Version: 1.0 References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> In-Reply-To: From: Linus Torvalds Date: Fri, 11 Sep 2020 12:09:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding To: Vasily Gorbik X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_151634_863520_521ADA46 X-CRM114-Status: GOOD ( 14.67 ) 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 , Alexander Gordeev , Claudio Imbrenda , Will Deacon , linux-arch , linux-s390 , 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 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how horrible it would be to convert all the other users, but a quick grep convinced me that yeah, it's only GUP that is this special, and we don't want to make this interface be the real one for everything else too.. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel