From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
linux-mm@kvack.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Thomas Hellstrom <thellstrom@vmware.com>,
Brian Paul <brianp@vmware.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Christian Koenig <christian.koenig@amd.com>,
Huang Rui <ray.huang@amd.com>
Subject: [PATCH] drm/ttm: don't set page->mapping
Date: Fri, 20 Nov 2020 10:54:45 +0100 [thread overview]
Message-ID: <20201120095445.1195585-5-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20201120095445.1195585-1-daniel.vetter@ffwll.ch>
Random observation while trying to review Christian's patch series to
stop looking at struct page for dma-buf imports.
This was originally added in
commit 58aa6622d32af7d2c08d45085f44c54554a16ed7
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Fri Jan 3 11:47:23 2014 +0100
drm/ttm: Correctly set page mapping and -index members
Needed for some vm operations; most notably unmap_mapping_range() with
even_cows = 0.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
but we do not have a single caller of unmap_mapping_range with
even_cows == 0. And all the gem drivers don't do this, so another
small thing we could standardize between drm and ttm drivers.
Plus I don't really see a need for unamp_mapping_range where we don't
want to indiscriminately shoot down all ptes.
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
---
drivers/gpu/drm/ttm/ttm_tt.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index da9eeffe0c6d..5b2eb6d58bb7 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -284,17 +284,6 @@ int ttm_tt_swapout(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
return ret;
}
-static void ttm_tt_add_mapping(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
-{
- pgoff_t i;
-
- if (ttm->page_flags & TTM_PAGE_FLAG_SG)
- return;
-
- for (i = 0; i < ttm->num_pages; ++i)
- ttm->pages[i]->mapping = bdev->dev_mapping;
-}
-
int ttm_tt_populate(struct ttm_bo_device *bdev,
struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
{
@@ -313,7 +302,6 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
if (ret)
return ret;
- ttm_tt_add_mapping(bdev, ttm);
ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
ret = ttm_tt_swapin(ttm);
--
2.29.2
next prev parent reply other threads:[~2020-11-20 9:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 9:54 [PATCH 0/3] mmu_notifier fs fs_reclaim lockdep annotations Daniel Vetter
2020-11-20 9:54 ` [PATCH 1/3] mm: Track mmu notifiers in fs_reclaim_acquire/release Daniel Vetter
2020-11-20 18:23 ` Jason Gunthorpe
2020-11-20 9:54 ` [PATCH 2/3] mm: Extract might_alloc() debug check Daniel Vetter
2020-11-20 17:19 ` Randy Dunlap
2020-11-20 17:31 ` Daniel Vetter
2020-11-20 18:07 ` Jason Gunthorpe
2020-11-24 14:34 ` Daniel Vetter
2020-11-24 15:27 ` Jason Gunthorpe
2020-11-20 9:54 ` [PATCH 3/3] locking/selftests: Add testcases for fs_reclaim Daniel Vetter
2020-11-20 12:31 ` Peter Zijlstra
2020-11-20 9:54 ` Daniel Vetter [this message]
2020-11-20 10:04 ` [PATCH] drm/ttm: don't set page->mapping Christian König
2020-11-20 10:05 ` Daniel Vetter
2020-11-20 10:08 ` Christian König
2020-11-20 15:01 ` Daniel Vetter
2020-11-25 16:25 [PATCH v4 0/3] mmu_notifier vs fs_reclaim lockdep annotations Daniel Vetter
2020-11-25 16:25 ` [PATCH] drm/ttm: don't set page->mapping Daniel Vetter
2020-11-25 16:28 ` Daniel Vetter
2020-11-25 18:06 ` Jason Gunthorpe
2020-11-25 18:11 ` Christoph Hellwig
2020-11-25 23:57 ` Jason Gunthorpe
2020-11-26 7:20 ` Christoph Hellwig
2020-11-25 18:16 ` Daniel Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201120095445.1195585-5-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=brianp@vmware.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ray.huang@amd.com \
--cc=thellstrom@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).