Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp505801pxk; Fri, 11 Sep 2020 12:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzra8tPxbwjOj+hCCzv3ntbFtmcMuLYjdzHUqsnFMjTQVs4mIt1VzpdjHL7CpDI9Bq++7sr X-Received: by 2002:aa7:dcd9:: with SMTP id w25mr3874376edu.280.1599853271264; Fri, 11 Sep 2020 12:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599853271; cv=none; d=google.com; s=arc-20160816; b=qyO7ZQQ1VxigPgTNpUcMlYQF8W0PpoVi7YwRlbAJQKYTzUue614hNuvfUmoaR+boSL GIkzIZeqmFV5gruWzudzCjo8iIeOEpHU5rJApCZ/Jb4CEk1mtA+QlZxI9HMHc8pNdQH5 k4t2JOkIlHBnOyvCX8Z0ABkFbyTMVnaqbd25Ko3SceZfW2v9JJeC/ojpTaZzckBXsNsf ot4UCTQ2ScygsGf2n4zmUVj6uAt6cr4p8JnnY5YtWIG/53AJXBjVp8diM2E6ckHGAwKD 3LpeGDzGnbzryuEaeT68/Uua/CFIHKXrCz/tvCVxGARLtO/NxxpSEIzfappe+NtC9Iwm 0bQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BK+tuqq8QDNrIoMgEZ8skJmt+wwLfpOudGjevs6T6M8=; b=BvrBN8Ts8+nWThomKv7qTgdOkt49dGEjnoEP6Bl0hTRIzi6ZDOFkqpdxnIIGht9hMK 1xLscdJ7EhtLsZ0tw91+KZpFw0z8ee8XUAzMiuIuStfZGG0HseeEb2r8x7CHPIHncPWC AzDW2Blkjt6Q/4FLvFmnDfeYPj8grR7B5o2HNX/s6znzDfIlpEKSS/hFhhSgu96PA/6e MGyKhLoVnS3NEPcSyS5PfklgxfRMqiz/dbGu3i2itQcMTIgZxnXUFGT+36dGPcaKulZJ TzKWpdbUk2rEddPKzkaN+AxmgSZ+t00c2/6Sfsbad0rB6NsKtcZOn2TuiZd+L922u5zC iFmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=pR94XQpt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si1959749ejb.217.2020.09.11.12.40.48; Fri, 11 Sep 2020 12:41:11 -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=@ziepe.ca header.s=google header.b=pR94XQpt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725935AbgIKTkG (ORCPT + 99 others); Fri, 11 Sep 2020 15:40:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbgIKTkD (ORCPT ); Fri, 11 Sep 2020 15:40:03 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64D09C0613ED for ; Fri, 11 Sep 2020 12:40:02 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id 19so8830780qtp.1 for ; Fri, 11 Sep 2020 12:40:02 -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=BK+tuqq8QDNrIoMgEZ8skJmt+wwLfpOudGjevs6T6M8=; b=pR94XQptn8bYWaLD/i62y0BbH4X2j7wiJqZGlqseUoyJZSGJ0zI0HKYeJ35DMYKrYj WbhjcV6+xwWxfqIPSocDLvuU4le3AHcBTI0Kkw63m7PTGBSfCFh8H4C0gtlUJ6ddWvCd XcdsVVT9YWUzwHhTOFC4l3Lbeao4TtBRlS8AFvOhX/pLbALT6BgXMIp8At2yTcyVWT+X /Gi+2KyTFER9vciFK2XRsy2Nx/3JqByhLTyHCxqiGpqrTEcqOAYJOLnNIo+XUP+DsmVi X10VcO/OtSw+SdWqS+NdVAAiGzoxEsRPjZQhGjyOxN9ZUZUawxj+MaNI5ivGNv9YOJ5y bbyg== 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=BK+tuqq8QDNrIoMgEZ8skJmt+wwLfpOudGjevs6T6M8=; b=cau/2PTuLKXb6vnMnkeHxKYYg0c+127lZp1nWUFyowoPlfzoZ/Xrn3I27V5f3Cv9cI xaXHM5nOk7oRI6dtb5t6ha+xs91q7Dk6gnF2QyZekT90zqFPK/Oo3DlsA2wddRUa+wAf BGjvj8TFpJXhvzW1iIy67eTpsShL+VR2vliHmYh384DbB/Co/DxFCu4dnZ2fkw7GW0ND NoYzRnDO4m7BRdBMjqhoq2hghG3EXAe6knjOzkBv67+craD3sc8JpxSETDH5m2a/yGXK J4orNN1MlTm+MtuA35jRF8E6X7PPuUoKRedMGQ8E3/X727QKoZXKsqqEDiZns+3vQd7m dJ8w== X-Gm-Message-State: AOAM530mSV5JR2w1DphR+pt7QVwFajr2zdGm19n4KGBxymoJPhehLDUp TGL5jQlozdnDX0HsVyYO0iVy5g== X-Received: by 2002:ac8:3a06:: with SMTP id w6mr3467667qte.255.1599853201602; Fri, 11 Sep 2020 12:40:01 -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 o4sm3733647qkk.75.2020.09.11.12.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 12:40:00 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kGots-0059mB-64; Fri, 11 Sep 2020 16:40:00 -0300 Date: Fri, 11 Sep 2020 16:40:00 -0300 From: Jason Gunthorpe To: Vasily Gorbik Cc: John Hubbard , Linus Torvalds , 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 Subject: Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding Message-ID: <20200911194000.GB1221970@ziepe.ca> References: <20200911070939.GB1362448@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 09:03:06PM +0200, Vasily Gorbik wrote: > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index e8cbc2e795d5..e899d3506671 100644 > +++ b/include/linux/pgtable.h > @@ -1427,6 +1427,16 @@ typedef unsigned int pgtbl_mod_mask; > #define mm_pmd_folded(mm) __is_defined(__PAGETABLE_PMD_FOLDED) > #endif > > +#ifndef p4d_offset_lockless > +#define p4d_offset_lockless(pgdp, pgd, address) p4d_offset(&pgd, address) > +#endif > +#ifndef pud_offset_lockless > +#define pud_offset_lockless(p4dp, p4d, address) pud_offset(&p4d, address) > +#endif > +#ifndef pmd_offset_lockless > +#define pmd_offset_lockless(pudp, pud, address) pmd_offset(&pud, address) Needs brackets: &(pgd) These would probably be better as static inlines though, as only s390 compiles will type check pudp like this. Jason