Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6188343rwl; Thu, 29 Dec 2022 08:44:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvz+zl4dti2CKPmzsJ9D0GKp9X4qGfKyyj984mgkyR71/c1HrUFmLq45DHbiguEUB9v8w2L X-Received: by 2002:a17:902:b782:b0:192:6fc5:60 with SMTP id e2-20020a170902b78200b001926fc50060mr18981512pls.25.1672332297822; Thu, 29 Dec 2022 08:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672332297; cv=none; d=google.com; s=arc-20160816; b=fYOq2C5LDVIPapECD4mNm2GTBzyATVXTkv3uRQ/qai7CRUYmbnLRiHpYzRfZ5UaDYF lI1HyHttL5FdQe7Kxb6jCjxDn/xsn4x3fahLNrBqZsWZlFa+k27nxdSqkH45ePIQ9kah VGAGhqav9M3VQNn7aRt+irmrxVTd+VJwIDHKCgkSPJIynUHr6dj3nbAuhcFA/o/P1g7U JvV9xVcXuMlKe3vw6HsjLtoeTWmzHCujDfoxeKGCK03JvgG4P3xbn0ZNk9T+VV5rcKAS GUQynCk133xI8lvX8Q6i9F1TKMjfsv/8N3dDUhqgPTkvsHOqqRbWAp8qnpxZETdGlbfR QOEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=Ec85AyiKc77bI9XsP5tX5lamemx/Nh18BP3PMc4R5sU=; b=MT73oqrKCCFDq6zBA0N+m7GnOEbN2smDg0yKTZNVvpF4+NGWDNoC90BzQLje/xxAy9 zuzpdeTzo6PQUuoLABRn4QMwJ9kn80FDsfCgi9nk8qHJFNmn4YEaQG54J7EzIcfUYw8v NbpBfhFVdLyoBDKZ6BTxSXKBvvm87Z6qfaRn3tYXtKBLGTYLPxAPXkwUF+/5aDJ9KzaR Ls1RhtUF9idQcdc/rW7Zw7LhtR6ne3HVe5p6SCwgoyt7taHz4yCsrOfT5VXRwPS8avhB VkaGkcokNhe0dx4Toh/83Htpzz93ffT3WxfuaBDvj19thnxjiv9m1tpF6nycq6cM/nL5 Jxtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=JyJ1Hotx; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170902ced100b001895031955bsi20437643plg.576.2022.12.29.08.44.49; Thu, 29 Dec 2022 08:44:57 -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=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=JyJ1Hotx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233792AbiL2QXH (ORCPT + 61 others); Thu, 29 Dec 2022 11:23:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbiL2QW0 (ORCPT ); Thu, 29 Dec 2022 11:22:26 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CA813DE0 for ; Thu, 29 Dec 2022 08:22:24 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id h7-20020a17090aa88700b00225f3e4c992so10723205pjq.1 for ; Thu, 29 Dec 2022 08:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=Ec85AyiKc77bI9XsP5tX5lamemx/Nh18BP3PMc4R5sU=; b=JyJ1HotxL5h5gP0PAUr+bSyy8u1zOFXKWz1ZfgSiQeQvzYRYtdYK5A29TTv7eUyBSq O6WUTpHiy10Kl0hHmRgy/d9fal5bMY/E/lNTQ2LCgCfG8iVu/uN6+Uj5ExC6mHOnsXiu 0ohB97kr44YJgmKniWXNLUoVi+8oVMmtdexytQrx6+rzrxhktuoTfzAedL35hCbYbn09 5yB5XsMVIjKdTNReT5H6YpQsO7a4nnDDcbUBIjnPH2H4vmdpB5S32Eq6ZsH3EXQnBVqu h/JxK+dWLoxFuxlgdjXCLEO7aHIvjXxyMe2Wjpx0m1kdrzxduQK6w3r0Q8wQ2fW6djA1 pXZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ec85AyiKc77bI9XsP5tX5lamemx/Nh18BP3PMc4R5sU=; b=JZz8QFyB4MdEECpnD2qbinxtQeiT5akirW6VWNiApE+rUsxiHAAudKx2I2UJFRwNRw 6RB07ULv5c19I0pWaJrbKf9QPHPS0xTa1FZMp+EaBby9/0NpDIop6thF6qTYSe0RzvBi DRb7Hlcwq9j7MdRR2mRAuYl0qp7/RQNtX8i7ineQgIYzuj+JJDYRROPLZ9VPEot9rNGx E1RNiQfio8k3uHWd0PzVdvvuc+DAfKS+QSb+y+qAnLtv7q1l6kwtoI4ehx3OsFhI0WlR yRP35Z84RGsrv4N4rFjAQUsCgvuAvU5uxyRI9d4l+61B0w1+lwlOsD35+Z806/RGzzWK SBFw== X-Gm-Message-State: AFqh2kqZeC8cC8vmZJXq+bEcbd0nqPoRvztAge/nSnRB1BXFXDx5Ytbe cGvrKler3AK5uOPN3+AQhgkCXw== X-Received: by 2002:a17:902:a981:b0:187:403c:7a3b with SMTP id bh1-20020a170902a98100b00187403c7a3bmr25977484plb.69.1672330943683; Thu, 29 Dec 2022 08:22:23 -0800 (PST) Received: from localhost ([135.180.226.51]) by smtp.gmail.com with ESMTPSA id o4-20020a170902bcc400b0019254c19697sm13000824pls.289.2022.12.29.08.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 08:22:23 -0800 (PST) Date: Thu, 29 Dec 2022 08:22:23 -0800 (PST) X-Google-Original-Date: Thu, 29 Dec 2022 07:51:42 PST (-0800) Subject: Re: [RFC PATCH] mm: remove zap_page_range and change callers to use zap_vma_page_range In-Reply-To: <20221216192012.13562-1-mike.kravetz@oracle.com> 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, david@redhat.com, mhocko@suse.com, peterx@redhat.com, nadav.amit@gmail.com, willy@infradead.org, vbabka@suse.cz, riel@surriel.com, Will Deacon , mpe@ellerman.id.au, borntraeger@linux.ibm.com, dave.hansen@linux.intel.com, brauner@kernel.org, edumazet@google.com, akpm@linux-foundation.org, mike.kravetz@oracle.com From: Palmer Dabbelt To: mike.kravetz@oracle.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Fri, 16 Dec 2022 11:20:12 PST (-0800), mike.kravetz@oracle.com 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 as calls > should be vma specific. > > Instead of fixing zap_page_range, change all callers to use the new > routine zap_vma_page_range. zap_vma_page_range is just a wrapper around > zap_page_range_single passing in NULL zap details. The name is also > more in line with other exported routines that operate within a vma. > We can then remove zap_page_range. > > Also, change madvise_dontneed_single_vma to use this new routine. > > [1] https://lore.kernel.org/linux-mm/20221114235507.294320-2-mike.kravetz@oracle.com/ > Suggested-by: Peter Xu > Signed-off-by: Mike Kravetz > --- > arch/arm64/kernel/vdso.c | 4 ++-- > arch/powerpc/kernel/vdso.c | 2 +- > arch/powerpc/platforms/book3s/vas-api.c | 2 +- > arch/powerpc/platforms/pseries/vas.c | 2 +- > arch/riscv/kernel/vdso.c | 4 ++-- > arch/s390/kernel/vdso.c | 2 +- > arch/s390/mm/gmap.c | 2 +- > arch/x86/entry/vdso/vma.c | 2 +- > drivers/android/binder_alloc.c | 2 +- > include/linux/mm.h | 7 ++++-- > mm/madvise.c | 4 ++-- > mm/memory.c | 30 ------------------------- > mm/page-writeback.c | 2 +- > net/ipv4/tcp.c | 6 ++--- > 14 files changed, 22 insertions(+), 49 deletions(-) [snip] > diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c > index e410275918ac..a405119da2c0 100644 > --- a/arch/riscv/kernel/vdso.c > +++ b/arch/riscv/kernel/vdso.c > @@ -127,10 +127,10 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns) > unsigned long size = vma->vm_end - vma->vm_start; > > if (vma_is_special_mapping(vma, vdso_info.dm)) > - zap_page_range(vma, vma->vm_start, size); > + zap_vma_page_range(vma, vma->vm_start, size); > #ifdef CONFIG_COMPAT > if (vma_is_special_mapping(vma, compat_vdso_info.dm)) > - zap_page_range(vma, vma->vm_start, size); > + zap_vma_page_range(vma, vma->vm_start, size); > #endif > } Acked-by: Palmer Dabbelt # RISC-V Thanks!