From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 368FBC433E7 for ; Mon, 19 Oct 2020 15:14:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 563C422363 for ; Mon, 19 Oct 2020 15:14:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MtCaBtJ5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 563C422363 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A27E16B007E; Mon, 19 Oct 2020 11:14:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D9A86B0080; Mon, 19 Oct 2020 11:14:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 915116B0081; Mon, 19 Oct 2020 11:14:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 65D506B007E for ; Mon, 19 Oct 2020 11:14:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EED731EE6 for ; Mon, 19 Oct 2020 15:14:24 +0000 (UTC) X-FDA: 77389021248.11.home33_0c022ca27238 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id AA21F180F8B8C for ; Mon, 19 Oct 2020 15:14:24 +0000 (UTC) X-HE-Tag: home33_0c022ca27238 X-Filterd-Recvd-Size: 2133 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Mon, 19 Oct 2020 15:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fPKhjFvX7s/li2p5PnTaBWubB/m1Dx3gc5qTCRzUVAE=; b=MtCaBtJ5IQ/x8oDWOCevBkygCj yEzyrsbN8NZUeRsNLZye91Ax14G4cADucQGCclbpc63l9DfUMm5hQ7fR+1N0RM34GBucA2FALk3kI qZpJHTNFSqLHo5DKTcrLrym4Kqtfb6GfHSLCojwq7Btx02s2pGX6M76pPttye73CTeoBwibx4xEYe 5iCtKZmQTiLNmnbgs+7dNsuqiySxQSijkfd33Z60uD/z3rG5dHM8aGYhIxcctDeeM008zH3xPltyV JsHS34NYRkM/XY3Zp/3wzmfxMHBSrX0WZu0awfp8zxFN5L1NM40NbTaIFGgs3knyLheYTnLVsJce2 0cAbqNQg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUWra-0008TX-8b; Mon, 19 Oct 2020 15:14:19 +0000 Date: Mon, 19 Oct 2020 16:14:18 +0100 From: Matthew Wilcox To: Xie Yongji Cc: mst@redhat.com, jasowang@redhat.com, akpm@linux-foundation.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org Subject: Re: [RFC 1/4] mm: export zap_page_range() for driver use Message-ID: <20201019151418.GT20115@casper.infradead.org> References: <20201019145623.671-1-xieyongji@bytedance.com> <20201019145623.671-2-xieyongji@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201019145623.671-2-xieyongji@bytedance.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 19, 2020 at 10:56:20PM +0800, Xie Yongji wrote: > Export zap_page_range() for use in VDUSE. I think you're missing a lot of MMU notifier work by calling this directly. It probably works in every scenario you've tested, but won't work for others. I see you're using VM_MIXEDMAP -- would it make sense to use VM_PFNMAP instead and use zap_vma_ptes()? Or would it make sense to change zap_vma_ptes() to handle VM_MIXEDMAP as well as VM_PFNMAP?