Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2583245rwd; Mon, 22 May 2023 00:43:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ziaPN1mvfsbugkbrGmgIAVS8T4KXsZyArzsgmyyVZaS9vWoKuC8DV1rD3L14asbKHtv97 X-Received: by 2002:a05:6a00:130b:b0:64d:3e7f:7121 with SMTP id j11-20020a056a00130b00b0064d3e7f7121mr11402580pfu.22.1684741419625; Mon, 22 May 2023 00:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684741419; cv=none; d=google.com; s=arc-20160816; b=mV3s1SXvf035srYBnvRUp+SQC4DuOzYwMshVi0LOJkPEQzaeRKZyQPVDFmxFk/xTSG CxeTyYOju4CMcA3Etq9G8ZM62/OmugvKF7QFbxFAhZBDz5E/hP7ohi90MqkL7ojMqOGV CJ7EJuE0eo21Vl+eoE39hyiuw9WXndFXGE+eyymTfTYXZuppRUa9bQgebzL5zfDeep/I nIo/Zmnp3P/1Z0AXf9ysgnMKYxewVtEPLPqdOIcaTxGqUtaTGU3FYlEftnE4OalByr/P nrC3Vyd4nRYpwrPI49RDOXKw8cd6tgi3btW7kaz4RufkpLKzTWjKuxCwW8xXjgsHe6BU s7zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ye1aYEuIFNfv2NxsNvtn+fUja3/DYESm+lSDId7JG3g=; b=StH9CKeLHoAxgbxZ06DcYFWX0rV5tfiReTOnTXpPTaDfm0o8GcSbk4ksW1L5kiRvFz arYCrq4GGpJb3N46EkgLH58RgQ1h4NWw81NhQ2GB2BtJnFoVxCTsoj3n1usLPPssG3ID ZzUe2AONVibweZ0cPMpt9VddugY3gVKeJCdJxmMpJpI0SYUSw5nb+xtB52/IrjL3pWeq 7dcywzcAcVbG1u0TU77pHbD2IQXdAJ6pZ1WDXmyziO6NTRAVk6eyVOo6CqcmDZffaPXB SMMCIcHEm5a2q9wjFLBCqP9mT68NsS55SnGkZAx4uF++sACcv0nN9ejsGwvqqbN2xmju R05w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="fM+/hnIJ"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p26-20020aa79e9a000000b0064caecf02e8si4434603pfq.153.2023.05.22.00.43.27; Mon, 22 May 2023 00:43:39 -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=@gmail.com header.s=20221208 header.b="fM+/hnIJ"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232620AbjEVH1c (ORCPT + 99 others); Mon, 22 May 2023 03:27:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232514AbjEVH1U (ORCPT ); Mon, 22 May 2023 03:27:20 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10817E6 for ; Mon, 22 May 2023 00:27:18 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f606a89795so3254885e9.2 for ; Mon, 22 May 2023 00:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684740436; x=1687332436; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ye1aYEuIFNfv2NxsNvtn+fUja3/DYESm+lSDId7JG3g=; b=fM+/hnIJV7bCdtGbRxg5kYbtSIChX4OadVUC2pc9Vd1xRAXocmoKtL8t9SU6mj/vXu S/6kvYBACzXDB8A8oYwQ7Ulcs2IoWyGAEIjqyJctkLyqAk/K/zkpi2sQejz9TajVUr1r N6ugp3qec7BJKWublpUzBBUDQVeV16x537tY0LmSjmfMjrPKjGV454r0r0fNuvwV04UJ SPNp0I5ZsRiL/nIsLY2KzzqXkl8LTr06dnqvhzn9INcjsQ3+54WT5Kvygel32cSoJFM0 tHt0BsQ4hBlyctoORNxqGqoMZE8zN8ghGfE218GBOZvyM2Kg+LnX2evBrRecEOfmx1HB 0TNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684740436; x=1687332436; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ye1aYEuIFNfv2NxsNvtn+fUja3/DYESm+lSDId7JG3g=; b=h3HQUZ85uT7aH16zr5zuzmBGTmCXUp+0PZOrj6PQandeSolg2HX+aw7DG2aLt5UvdX jFZ6UqpXaW66/GWq1AM3IWMJg6qY0KxpEx8ruXlOO1VQ4H+TXUSiPQDa0Hsfq3/I+O75 xoNpCB4XisJnV1l7Uptbir6uahOJf7tKhLYtqRzR8h74vvpTrpyqL3bw2bjvpewxJfwr Dn/OFqpoCrIYLYhAp+ctGdZdZFzRKHQKOV/Whlag3beIaufoTrMGEZQxepjUNE+z12QW WD4l+GmCTUIvnGS0rs60U2Tie5FAwJNhuihwxYOJc5DJJSFzF0HiUmev+gOnn0Nq+4pp BMxA== X-Gm-Message-State: AC+VfDw/xU74Se8tVegYvgrkuO6FKPHsuCy/vo0wpXI44PVOQGYe6pmv eKmqg5rI+6hotwA/kAzjPmOtn0plN98ZTQ== X-Received: by 2002:a1c:4b08:0:b0:3f5:bc8:e398 with SMTP id y8-20020a1c4b08000000b003f50bc8e398mr6850864wma.13.1684740436168; Mon, 22 May 2023 00:27:16 -0700 (PDT) Received: from localhost (host81-154-179-160.range81-154.btcentralplus.com. [81.154.179.160]) by smtp.gmail.com with ESMTPSA id m17-20020a7bcb91000000b003f6050d35c9sm1742602wmi.20.2023.05.22.00.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 00:27:14 -0700 (PDT) Date: Mon, 22 May 2023 08:27:14 +0100 From: Lorenzo Stoakes To: Hugh Dickins Cc: 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 , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 12/31] mm/vmalloc: vmalloc_to_page() use pte_offset_kernel() Message-ID: <8c744725-5f58-4656-823b-997a302085f6@lucifer.local> References: <68a97fbe-5c1e-7ac6-72c-7b9c6290b370@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Sun, May 21, 2023 at 10:04:07PM -0700, Hugh Dickins wrote: > vmalloc_to_page() was using pte_offset_map() (followed by pte_unmap()), > but it's intended for userspace page tables: prefer pte_offset_kernel(). > > Signed-off-by: Hugh Dickins > --- > mm/vmalloc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 9683573f1225..741722d247d5 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -703,11 +703,10 @@ struct page *vmalloc_to_page(const void *vmalloc_addr) > if (WARN_ON_ONCE(pmd_bad(*pmd))) > return NULL; > > - ptep = pte_offset_map(pmd, addr); > + ptep = pte_offset_kernel(pmd, addr); > pte = *ptep; > if (pte_present(pte)) > page = pte_page(pte); > - pte_unmap(ptep); > > return page; > } > -- > 2.35.3 > Looks good to me, Reviewed-by: Lorenzo Stoakes