From patchwork Wed Nov 20 09:55:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 3212531 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC2B0C045B for ; Wed, 20 Nov 2013 09:56:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C12C620648 for ; Wed, 20 Nov 2013 09:56:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 41F3A20703 for ; Wed, 20 Nov 2013 09:56:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8011106828; Wed, 20 Nov 2013 01:56:06 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp-outbound-2.vmware.com (smtp-outbound-2.vmware.com [208.91.2.13]) by gabe.freedesktop.org (Postfix) with ESMTP id 52A46106828 for ; Wed, 20 Nov 2013 01:56:05 -0800 (PST) Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A9F542A1B6; Wed, 20 Nov 2013 01:56:04 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id A555A4039B; Wed, 20 Nov 2013 01:56:04 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id E50CDC005F; Wed, 20 Nov 2013 01:56:22 -0800 (PST) Received: from ubuntu.localdomain (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Wed, 20 Nov 2013 01:56:21 -0800 (PST) From: Thomas Hellstrom To: jakob@vmware.com, dh.herrmann@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vma-manager: Don't unmap COW'd pages when zapping bo ptes Date: Wed, 20 Nov 2013 01:55:49 -0800 Message-Id: <1384941349-3550-1-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 1.7.10.4 Cc: Thomas Hellstrom , linux-graphics-maintainer@vmware.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Not sure if there are any user-space users of private bo mappings, but if there are, or will be, zapping the COW'd pages when, for example, moving a bo would confuse the user immensely since the net effect for the user would be that pages written to would lose their contents. Signed-off-by: Thomas Hellstrom Reviewed-by: Daniel Vetter --- include/drm/drm_vma_manager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h index c18a593..347077d 100644 --- a/include/drm/drm_vma_manager.h +++ b/include/drm/drm_vma_manager.h @@ -231,9 +231,9 @@ static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node, struct address_space *file_mapping) { if (file_mapping && drm_vma_node_has_offset(node)) - unmap_mapping_range(file_mapping, - drm_vma_node_offset_addr(node), - drm_vma_node_size(node) << PAGE_SHIFT, 1); + unmap_shared_mapping_range + (file_mapping, drm_vma_node_offset_addr(node), + drm_vma_node_size(node) << PAGE_SHIFT); } /**