dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] mmu_notifier vs fs_reclaim lockdep annotations
@ 2020-11-25 16:25 Daniel Vetter
  2020-11-25 16:25 ` [PATCH v4 1/3] mm: Track mmu notifiers in fs_reclaim_acquire/release Daniel Vetter
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Daniel Vetter @ 2020-11-25 16:25 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, LKML, linux-xfs,
	linux-mm, linux-fsdevel

Hi all,

Just resending with the polish applied, no functional changes at all.

Previous versions.

v3: https://lore.kernel.org/dri-devel/20201120095445.1195585-1-daniel.vetter@ffwll.ch/
v2: https://lore.kernel.org/dri-devel/20200610194101.1668038-1-daniel.vetter@ffwll.ch/

Changes since v3:
- more acks/r-b
- typos in the kerneldoc fixed

Changes since v2:
- Now hopefully the bug that bombed xfs fixed.
- With unit-tests (that's the part I really wanted and never got to)
- might_alloc() helper thrown in for good.

I think if we have an ack/review from fs-devel this should be good to
land. Last version that landed in -mm (v2) broke xfs pretty badly.

Unfortuantely I don't have a working email from Qian anymore, who reported
the xfs issue. Maybe Dave Chinner instead?

Cheers, Daniel

Daniel Vetter (3):
  mm: Track mmu notifiers in fs_reclaim_acquire/release
  mm: Extract might_alloc() debug check
  locking/selftests: Add testcases for fs_reclaim

 include/linux/sched/mm.h | 16 ++++++++++++++
 lib/locking-selftest.c   | 47 ++++++++++++++++++++++++++++++++++++++++
 mm/mmu_notifier.c        |  7 ------
 mm/page_alloc.c          | 31 ++++++++++++++++----------
 mm/slab.h                |  5 +----
 mm/slob.c                |  6 ++---
 6 files changed, 86 insertions(+), 26 deletions(-)

-- 
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH 0/3] mmu_notifier fs fs_reclaim lockdep annotations
@ 2020-11-20  9:54 Daniel Vetter
  2020-11-20  9:54 ` [PATCH] drm/ttm: don't set page->mapping Daniel Vetter
  0 siblings, 1 reply; 27+ messages in thread
From: Daniel Vetter @ 2020-11-20  9:54 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, LKML, linux-xfs,
	linux-mm, linux-fsdevel

Hi all,

I've finally gotten around to polish of my lockdep anntotation patches
from a while ago:

https://lore.kernel.org/dri-devel/20200610194101.1668038-1-daniel.vetter@ffwll.ch/

That patch has been in -mm for a few days already, but it immediately hit
some issues with xfs.

Changes since v2:
- Now hopefully the bug that bombed xfs fixed.
- With unit-tests (that's the part I really wanted and never got to)
- might_alloc() helper thrown in for good.

The unit test stuff was the major drag until I figured out how to make
this very easy with the locking selftests.

Comments, review, testing all very much welcome.

Cheers, Daniel

Daniel Vetter (3):
  mm: Track mmu notifiers in fs_reclaim_acquire/release
  mm: Extract might_alloc() debug check
  locking/selftests: Add testcases for fs_reclaim

 include/linux/sched/mm.h | 16 ++++++++++++++
 lib/locking-selftest.c   | 47 ++++++++++++++++++++++++++++++++++++++++
 mm/mmu_notifier.c        |  7 ------
 mm/page_alloc.c          | 31 ++++++++++++++++----------
 mm/slab.h                |  5 +----
 mm/slob.c                |  6 ++---
 6 files changed, 86 insertions(+), 26 deletions(-)

-- 
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH] drm/ttm: don't set page->mapping
@ 2020-11-04 16:50 Daniel Vetter
  2020-11-05  7:59 ` Christian König
  0 siblings, 1 reply; 27+ messages in thread
From: Daniel Vetter @ 2020-11-04 16:50 UTC (permalink / raw)
  To: DRI Development
  Cc: Thomas Hellstrom, Daniel Vetter, Huang Rui, Brian Paul,
	Daniel Vetter, Christian Koenig

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 8861a74ac335..438ea43fd8c1 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -291,17 +291,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)
 {
@@ -320,7 +309,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.28.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2020-11-26  8:24 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 16:25 [PATCH v4 0/3] mmu_notifier vs fs_reclaim lockdep annotations Daniel Vetter
2020-11-25 16:25 ` [PATCH v4 1/3] mm: Track mmu notifiers in fs_reclaim_acquire/release Daniel Vetter
2020-11-25 16:25 ` [PATCH v4 2/3] mm: Extract might_alloc() debug check Daniel Vetter
2020-11-25 16:25 ` [PATCH v4 3/3] locking/selftests: Add testcases for fs_reclaim 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:16       ` Daniel Stone
     [not found]       ` <20201125181129.GA1858@infradead.org>
2020-11-25 23:57         ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2020-11-20  9:54 [PATCH 0/3] mmu_notifier fs fs_reclaim lockdep annotations Daniel Vetter
2020-11-20  9:54 ` [PATCH] drm/ttm: don't set page->mapping Daniel Vetter
2020-11-20 10:04   ` 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-04 16:50 Daniel Vetter
2020-11-05  7:59 ` Christian König
2020-11-05  9:11   ` Daniel Vetter
2020-11-05 12:29     ` Christian König
2020-11-05 12:50       ` Daniel Vetter
2020-11-05 12:56         ` Christian König
2020-11-05 13:20           ` Daniel Vetter
2020-11-05 13:22             ` Christian König
2020-11-05 14:31               ` Daniel Vetter
2020-11-05 14:38                 ` Daniel Vetter
2020-11-05 15:15                   ` Christian König
2020-11-05 16:37                     ` Daniel Vetter
2020-11-06  8:30                       ` Christian König

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).