Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5894881ybi; Wed, 12 Jun 2019 10:15:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqymmJ6Aba9y6VMWptDbsUnZGRdTnym2VYD3ogfTKCYeTkIZqyM+H1GayKIM47OcaSAbJ9Za X-Received: by 2002:aa7:8ac9:: with SMTP id b9mr77409487pfd.260.1560359724608; Wed, 12 Jun 2019 10:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560359724; cv=none; d=google.com; s=arc-20160816; b=0y73R9cOcIH7eEqQCwUiYl63w0OI7bXsUFVta09GbDS7ZD2Bwvjzzz1uorre36H3Ed qUQWeujJMG4/iYdERbZQhxIpeVduSEoiZ0Zi8YdMEpyCGqjKNAWUSfJ6dyRd08bDxYmX h9m9lXQzXgKmWl/n3ZLdXw7JXG+4ogaiuIjfbY5lgD//yYgwPRaLKX3n8r2Z43w/garv bfDjs+oabpqBJSFplEdNm/hSAuZDD9Q5oq+ZmZOdTKVfkCD2wUXckCF3VjIMOMCpfo1j FhkORpYPOr9xkOhin/eGdmipmeQbhpjsu/gL5VixIXKKi6nOK/mRjtIKbwUVnVNm1AJ9 dRHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=gPZ2OTJlcxRx/9elhuFx8X5f5MbNH4kT8T99tBfgsnQ=; b=v9Aot6/a1p1kbl19lvwplC3ssXnGE0QoxFLnyOgYtL+Ldex+sugLIgVGUiAT0oSAgs ZNLv3Srpdu4wsHvJSZkZNm4B2IEZSM5Tj2vfhVkyLiZ6mLPbx4nFea7NH7teZCPN5xlF fEtSDxAf8wJzP8BKOgUcvgPCLyKBYJrXPwIaQ+iDnm5QNaYmEQeg6OK68jTxmLle/liO OI3CTutTntwoiTAoJtC/xv4hDtnXpaoviC+d6/9Mt020regu23uBcJH9+q+nW7vIw4t7 ZGpDcf/yBjMZRmUorv9KrJ6e2R8Mgr3Uk3Jqg3yse1FetrI4u7czSWBOPIOjKIAOtDS+ vClw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@vmwopensource.org header.s=mail header.b=g9JQd7iX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si376803pjo.3.2019.06.12.10.15.08; Wed, 12 Jun 2019 10:15:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@vmwopensource.org header.s=mail header.b=g9JQd7iX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438794AbfFLMUY (ORCPT + 99 others); Wed, 12 Jun 2019 08:20:24 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:46845 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438786AbfFLMUX (ORCPT ); Wed, 12 Jun 2019 08:20:23 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id B32C43F792; Wed, 12 Jun 2019 14:20:15 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=vmwopensource.org header.i=@vmwopensource.org header.b=g9JQd7iX; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -3.099 X-Spam-Level: X-Spam-Status: No, score=-3.099 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, URIBL_RED=0.001] autolearn=ham autolearn_force=no Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=vmwopensource.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YFDHihGaaJKs; Wed, 12 Jun 2019 14:20:05 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id D94A63F771; Wed, 12 Jun 2019 14:20:03 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 6C3313619A3; Wed, 12 Jun 2019 14:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vmwopensource.org; s=mail; t=1560342003; bh=6NfMWfvQeoRy9SPu4DRek4214/12osldJKiSUF/Om8o=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=g9JQd7iXbBFiJ9k/DFvRCemp/a055P3v1B/2XGHSPrmLckFXXamHhLxVJb7ZMt9f5 jYLGqeoMp1N46VhXUk47+FPdynyWNASQeTHzpZ9jHQ6CUrTYeWqqkzDzRovkQI4o8Z Sf04V6HvJKonDRhebjhwGvZ/BTi//2F1blpTwSKE= Subject: Re: [PATCH v5 3/9] mm: Add write-protect and clean utilities for address space ranges To: Christoph Hellwig Cc: dri-devel@lists.freedesktop.org, linux-graphics-maintainer@vmware.com, pv-drivers@vmware.com, linux-kernel@vger.kernel.org, nadav.amit@gmail.com, Thomas Hellstrom , Andrew Morton , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , Souptick Joarder , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , linux-mm@kvack.org, Ralph Campbell References: <20190612064243.55340-1-thellstrom@vmwopensource.org> <20190612064243.55340-4-thellstrom@vmwopensource.org> <20190612112349.GA20226@infradead.org> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: Date: Wed, 12 Jun 2019 14:20:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190612112349.GA20226@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/12/19 1:23 PM, Christoph Hellwig wrote: > On Wed, Jun 12, 2019 at 08:42:37AM +0200, Thomas Hellström (VMware) wrote: >> From: Thomas Hellstrom >> >> Add two utilities to a) write-protect and b) clean all ptes pointing into >> a range of an address space. >> The utilities are intended to aid in tracking dirty pages (either >> driver-allocated system memory or pci device memory). >> The write-protect utility should be used in conjunction with >> page_mkwrite() and pfn_mkwrite() to trigger write page-faults on page >> accesses. Typically one would want to use this on sparse accesses into >> large memory regions. The clean utility should be used to utilize >> hardware dirtying functionality and avoid the overhead of page-faults, >> typically on large accesses into small memory regions. > Please use EXPORT_SYMBOL_GPL, just like for apply_to_page_range and > friends. Sounds reasonable if this uses already EXPORT_SYMBOL_GPL'd functionality. I'll respin. > Also in general new core functionality like this should go > along with the actual user, we don't need to repeat the hmm disaster. I see in your later message that you noticed the other patches. There's also user-space functionality in mesa that excercises this. /Thomas