Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13535771rwl; Wed, 4 Jan 2023 09:24:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXtZi1AVzO8FkHZNvrfP9u25uWBi5gk7Y8l/4Z/6GM5SNWjgVE4uzMHpBIQcDnCedB49b5w2 X-Received: by 2002:a17:907:a803:b0:7c3:15cc:76d0 with SMTP id vo3-20020a170907a80300b007c315cc76d0mr50228701ejc.47.1672853085376; Wed, 04 Jan 2023 09:24:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672853085; cv=none; d=google.com; s=arc-20160816; b=lwp7MQDRK++0lSyGkemwg7g6Xydl7nwvF/0QzobpEtPb7CD8CjIvkgBSlIqpE4QPYt 5I+7GlfTMQg/IcxX6UpPAQ1qQzDPTq27SgkAUSMJhfL0PDysGRaQ4Pt3/yQCEoH0NLk8 d+yPXYJaCHyz3MexCIIWWbD18QbTHA9IGuBuUYW8qIeta3jI9sEzm9qQXRZExR6yG8FI epkvmlSWoFFQ1U2UJi0GTiQ+8Hqsdw6Jf/NAEcIdFpJPsV8PMyG8WRW0Q0Gpusvo5/YG z7vpEwxsw4lIJsPCWuFCk8jERYMIQFF7SMIxrC6MBP/RHBfhexcSh/LkLhzqWdXddsmJ vYuQ== 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=6EzsGSC3holClBSPQw8EocT+rCm9w6LTUpG8IqXLKaM=; b=STJbpgliqpfKz63bty3EJHkIvljW3KaLQYSIbRau8LY2M0ki9qCh5NDixPcvFRukGS T4Spy1twNQVJ8FX0Q9DwO1SGgzJdnauCS2OEn1pd/apS14pAUfeqFpN1LPQ3+PpCt/wx U6NzblRl4CpjhrQpJlRVHkEVGMvL7JXaXAcz4S5/kX0PTtRco6Ky4Yg4WE9KJ/MnAJQn wK79WLFLNqZf/0DyAyca2n449vgiuHjyUl/gtcuroeyA5KyjU5vTaRLl5DmlyQr9FGNQ WwpUBASg97uJlbLBMhBPR0lvQxKS6FUpYn9g2C/xSizKEuRYoKyQZFAri1z18kTklAmB enog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KmfhUiP1; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wt14-20020a170906ee8e00b0084ca4bdbc7asi15177656ejb.780.2023.01.04.09.24.31; Wed, 04 Jan 2023 09:24:45 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=KmfhUiP1; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239945AbjADQuU (ORCPT + 57 others); Wed, 4 Jan 2023 11:50:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240173AbjADQsJ (ORCPT ); Wed, 4 Jan 2023 11:48:09 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A6FC4732A for ; Wed, 4 Jan 2023 08:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672850693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6EzsGSC3holClBSPQw8EocT+rCm9w6LTUpG8IqXLKaM=; b=KmfhUiP1Z4CC5XYWE1y6bb4X3paTR4BHLNiHsyvkK1hSy9BNhGkpmIauh4f2QAVKtFrtS6 Bsse17u+qgjcH6bQQEQ8giUdoCi6b/cvkKsoyb74VQWJ4rqr/zwJu6eHjoHaFMu3Xxp2gJ CtAJd4AYtX+NswBVrw5S6W57LY8xFss= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-413-YOoYbGWUO_WgRxhhQyXtfw-1; Wed, 04 Jan 2023 11:44:52 -0500 X-MC-Unique: YOoYbGWUO_WgRxhhQyXtfw-1 Received: by mail-qk1-f197.google.com with SMTP id bp6-20020a05620a458600b006ffd3762e78so23472998qkb.13 for ; Wed, 04 Jan 2023 08:44:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6EzsGSC3holClBSPQw8EocT+rCm9w6LTUpG8IqXLKaM=; b=XVyoIHNFJ6KmxHaTjEdrJHuZftI5qBCnubHreXEVOUYXYszAvWVmw+Nv7Q85SWLVZv YNvtJKo9gWg/pCYMU1DsgOxHsyfCgN9g/vYV3XN5L7g1JTFUcoW6IYrxDi+4ZTjfu2dt 9QAYz8x+tmjy5bE4Z2Fq/KL1vCpIHMr2dK+Z0KFYcW7S59i+jU1WTW/Uzxwe2mKLiWmF cO+Kbu0ldNO5xHZtQmkD/2i2ZMd78MboAWZkHEFOynHjkVGJnA+0bTBd3QnXz8V34Pn5 8AUILqYMc0HLTcoQGUv9njFO8f4JNIzEVJc7a5ytI+fpbjpl/n5evX26reyJ64nQtPqn x9ww== X-Gm-Message-State: AFqh2kqegtM0xMcJy03nJvFVz67fyF8wQ+3pd9ZWnsPU+TIFXTNNKaCK FHNWP5r5w99e5KtKriKxvqGiO6tVnv5/dfNPAmvrToNiqmFMJPAc9r8RXiMqQ/D0aBG2IPVYn4c iAiX7d1wqmso9bAvEOIofuk6d X-Received: by 2002:a05:622a:124b:b0:3ab:7bb3:4707 with SMTP id z11-20020a05622a124b00b003ab7bb34707mr50094157qtx.64.1672850692361; Wed, 04 Jan 2023 08:44:52 -0800 (PST) X-Received: by 2002:a05:622a:124b:b0:3ab:7bb3:4707 with SMTP id z11-20020a05622a124b00b003ab7bb34707mr50094133qtx.64.1672850692030; Wed, 04 Jan 2023 08:44:52 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-39-70-52-228-144.dsl.bell.ca. [70.52.228.144]) by smtp.gmail.com with ESMTPSA id u22-20020a05620a455600b006fb112f512csm24300165qkp.74.2023.01.04.08.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 08:44:51 -0800 (PST) Date: Wed, 4 Jan 2023 11:44:49 -0500 From: Peter Xu To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, Christoph Hellwig , David Hildenbrand , Michal Hocko , Nadav Amit , Matthew Wilcox , Vlastimil Babka , Rik van Riel , Will Deacon , Michael Ellerman , Palmer Dabbelt , Christian Borntraeger , Dave Hansen , Christian Brauner , Eric Dumazet , Andrew Morton Subject: Re: [PATCH] mm: remove zap_page_range and create zap_vma_pages Message-ID: References: <20230104002732.232573-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230104002732.232573-1-mike.kravetz@oracle.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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, Jan 03, 2023 at 04:27:32PM -0800, Mike Kravetz wrote: > zap_page_range was originally designed to unmap pages within an address > range that could span multiple vmas. While working on [1], it was > discovered that all callers of zap_page_range pass a range entirely within > a single vma. In addition, the mmu notification call within zap_page > range does not correctly handle ranges that span multiple vmas. When > crossing a vma boundary, a new mmu_notifier_range_init/end call pair > with the new vma should be made. > > Instead of fixing zap_page_range, do the following: > - Create a new routine zap_vma_pages() that will remove all pages within > the passed vma. Most users of zap_page_range pass the entire vma and > can use this new routine. > - For callers of zap_page_range not passing the entire vma, instead call > zap_page_range_single(). > - Remove zap_page_range. > > [1] https://lore.kernel.org/linux-mm/20221114235507.294320-2-mike.kravetz@oracle.com/ > Suggested-by: Peter Xu > Signed-off-by: Mike Kravetz Acked-by: Peter Xu -- Peter Xu