Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37124220rwd; Tue, 11 Jul 2023 09:43:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoD+Ttl4JLdOirSaA8Mt+lsu4ZQMmZArTHSf/Ylfp3FuzyqMX/WTlG6CYZ0a3s2ihfw7OI X-Received: by 2002:a05:6a20:948a:b0:12e:79c0:6eba with SMTP id hs10-20020a056a20948a00b0012e79c06ebamr16444558pzb.13.1689093830107; Tue, 11 Jul 2023 09:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689093830; cv=none; d=google.com; s=arc-20160816; b=pibczgfid+b9lZjweie0ZLeW3F8rnU8B9DzPCEuzPz7e6vWl7fMeB+ioCcBwsPq9+r OrZh0fN8Y3g4ImTRcYuO8TppPcLKHIAXPo3/LCH+WEkhA/vfWkHUHZhJE/hM2ulnQXo4 cIFTdObYWNnOAM8bXc1aCxpiAz0wX2wWjd7t0nPFL8FphxOLKoQ+ay0txDbETyxr3+b/ bcdh5rPzZPYTP2EWfoFOVPiK7wM/C5Wk2UQiViM8Iw1SuiEITgdCQv2Wb7fPZsatPicD QAOGKakVrSpfCIbFREU4K1G7EvL3fxt6/o+MVNncTMo9q4tOdrEZNpFWUKZYNUIr9BOb G1HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=DdgLHjoV4bKS9Y98q58pFf+T0XmV0gVspD1CmrLbFiw=; fh=gpxf8+6wJ2I4cqaEEGGed+TSPX7NXkBzGHq3McMUbdc=; b=d+ZtuAunU7bK1L5E6VpE8NcQ91eJJ35x4JLUONSwS5xFxZ5sC8wCszWpjVWs7qhZrW euvjgpFKT5PPlQSkTMspiqCkwioPukxq2KjGg7zOCkD15TKORuhZKkUlOd278yqqMn9T Y3kJUMuhqZ9VekyB12/HtNTCF+eqaG/EBiReR99b4UrQbyBQUXiVM7NQZ9r7ODmuFIgq AUIAvKbtFSRGidGfzNYfKrUbRz0uu+ng5rMHjXkbDz+WVZnvp042heJ5QX/hDre+w1Fp Yqcz58a2gk10b/ZL5niabFFBEKBVi+Z2icgd6Dd8UEHdFJ8ds4nqfQVRPD5wiesz0fn1 Xe/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="7WC/6DtR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 194-20020a6301cb000000b005533ed46a70si1711537pgb.814.2023.07.11.09.43.36; Tue, 11 Jul 2023 09:43:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="7WC/6DtR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbjGKQNl (ORCPT + 99 others); Tue, 11 Jul 2023 12:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbjGKQNi (ORCPT ); Tue, 11 Jul 2023 12:13:38 -0400 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECD2E6F for ; Tue, 11 Jul 2023 09:13:35 -0700 (PDT) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-5701eaf0d04so67166317b3.2 for ; Tue, 11 Jul 2023 09:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689092014; x=1691684014; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=DdgLHjoV4bKS9Y98q58pFf+T0XmV0gVspD1CmrLbFiw=; b=7WC/6DtRB9A57/9p81qiAbeeCg2Sr8V6m2g3eS+Qcppfm9mHNWKZfMIuZ1vj5TScTf zbmhE/s5i+obRLTSWGaFHsfVNJseY0BcRLmCW/SHg1uoyQ0i2Ud+ZISNhTSTW/sb4q7K zaPJPS1oYWrHDFuJdZ45TNsYThtZtbVfpcsNYM/bXO2C4pU+ZzHfWHm2EY122aLcKyxP dZdWV2g78I2zQCDRq4c+bo1SLxRmQ7PyzGAwnIKXJhBHChstvjdXwm/jk3O924aFJf5G tjh8yrtjteFmpHK09YBX8bmvZ2w8JzO/M3xr/lyMjo/fluxZs/NFMMmQgGZQhprdoGCp 2YjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689092014; x=1691684014; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DdgLHjoV4bKS9Y98q58pFf+T0XmV0gVspD1CmrLbFiw=; b=WIiB/K7tnXVyAcUjjpCEf9RqxjCaI0A0C+im2ZGItvB0/PWlzxaXib13XZoojBmPpy /vKIFFBapDuXQEcP5UJ6Tz4kU3N8yMTLYOVTAFFGoCqAZYGxUv9JGaGBj5CZcWqKmksV dvsgDYKhGY6VlcLtMITZoTx+N7HfoXU4gFFB6QBw8P5LYZKOxiaaN8WQ7ksB3vkF0miJ GI711z6mh13sywTjQR95uP/f21fTXrHaUXR7v7MIDp4EGMnOmnNVMjCGKPQAXADf8Ryz WsRE2d5c0bSGAdvCf9zlZcui7Y+YfvITPD0tmEiB+d+fnuol2FmUUO8uATPShItukxjc UA/A== X-Gm-Message-State: ABy/qLZFJZdYGv7ccl7NeF4oiLu5dc2ITDuzl/SmjHNSazdzM28kNeu0 5dBAGOVQ0dEgAq/k/C5wY6m0bA== X-Received: by 2002:a0d:d647:0:b0:577:228f:467f with SMTP id y68-20020a0dd647000000b00577228f467fmr15743604ywd.36.1689092014433; Tue, 11 Jul 2023 09:13:34 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id i65-20020a819144000000b0057072e7fa77sm637283ywg.95.2023.07.11.09.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 09:13:34 -0700 (PDT) Date: Tue, 11 Jul 2023 09:13:18 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Mark Brown cc: Hugh Dickins , Lorenzo Stoakes , Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org, regressions@leemhuis.info, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 12/32] mm/vmalloc: vmalloc_to_page() use pte_offset_kernel() In-Reply-To: Message-ID: References: <696386a-84f8-b33c-82e5-f865ed6eb39@google.com> <42279f1f-7b82-40dc-8546-86171018729c@sirena.org.uk> <901ae88d-ad0c-4e9d-b199-f1566cc62a00@lucifer.local> <977ddee4-35f0-fcd1-2fd-1c3057e7ea2a@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Jul 2023, Mark Brown wrote: > On Mon, Jul 10, 2023 at 09:34:42PM -0700, Hugh Dickins wrote: > > > I suppose I should ask you to try reverting this 0d1c81edc61e alone > > from 6.5-rc1: the consistency of your bisection implies that it will > > "fix" the issues, and it is a commit which we could drop. It makes > > me a little nervous, applying userspace-pagetable validation to kernel > > pagetables, so I don't want to drop it; and it would really be cargo- > > culting to drop it without understanding. But we could drop it. > > I did look at that, it doesn't revert cleanly by itself. ... Right, that ptep_get() wrapper on the next line came in on top. The patch to revert just 0d1c81edc61e is this: --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -703,10 +703,11 @@ struct page *vmalloc_to_page(const void if (WARN_ON_ONCE(pmd_bad(*pmd))) return NULL; - ptep = pte_offset_kernel(pmd, addr); + ptep = pte_offset_map(pmd, addr); pte = ptep_get(ptep); if (pte_present(pte)) page = pte_page(pte); + pte_unmap(ptep); return page; }