[PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-31 Thread jglisse
From: Jérôme Glisse 

Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 
Reviewed-by: Christian König 
Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
 }
 
 /**
- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
  * amdgpu_mn_invalidate_range_start - callback to notify about mm change
  *
  * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
 
 static const struct mmu_notifier_ops amdgpu_mn_ops = {
.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
 };
 
-- 
2.13.5



[PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-31 Thread jglisse
From: Jérôme Glisse 

Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 
Reviewed-by: Christian König 
Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
 }
 
 /**
- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
  * amdgpu_mn_invalidate_range_start - callback to notify about mm change
  *
  * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
 
 static const struct mmu_notifier_ops amdgpu_mn_ops = {
.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
 };
 
-- 
2.13.5



Re: [PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-30 Thread Christian König

Am 30.08.2017 um 01:54 schrieb Jérôme Glisse:

Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 


Reviewed-by: Christian König 

The general approach is Acked-by: Christian König 
.


It's something very welcome since I was one of the people (together with 
the Intel guys) which failed to recognize what this callback really does.


Regards,
Christian.


Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
  1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
  }
  
  /**

- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
   * amdgpu_mn_invalidate_range_start - callback to notify about mm change
   *
   * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
  
  static const struct mmu_notifier_ops amdgpu_mn_ops = {

.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
  };
  





Re: [PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-30 Thread Christian König

Am 30.08.2017 um 01:54 schrieb Jérôme Glisse:

Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 


Reviewed-by: Christian König 

The general approach is Acked-by: Christian König 
.


It's something very welcome since I was one of the people (together with 
the Intel guys) which failed to recognize what this callback really does.


Regards,
Christian.


Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
  1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
  }
  
  /**

- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
   * amdgpu_mn_invalidate_range_start - callback to notify about mm change
   *
   * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
  
  static const struct mmu_notifier_ops amdgpu_mn_ops = {

.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
  };
  





[PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-29 Thread Jérôme Glisse
Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 
Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
 }
 
 /**
- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
  * amdgpu_mn_invalidate_range_start - callback to notify about mm change
  *
  * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
 
 static const struct mmu_notifier_ops amdgpu_mn_ops = {
.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
 };
 
-- 
2.13.5



[PATCH 04/13] drm/amdgpu: update to new mmu_notifier semantic

2017-08-29 Thread Jérôme Glisse
Call to mmu_notifier_invalidate_page() are replaced by call to
mmu_notifier_invalidate_range() and thus call are bracketed by
call to mmu_notifier_invalidate_range_start()/end()

Remove now useless invalidate_page callback.

Signed-off-by: Jérôme Glisse 
Cc: amd-...@lists.freedesktop.org
Cc: Felix Kuehling 
Cc: Christian König 
Cc: Alex Deucher 
Cc: Kirill A. Shutemov 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Andrea Arcangeli 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
index 6558a3ed57a7..e1cde6b80027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
@@ -147,36 +147,6 @@ static void amdgpu_mn_invalidate_node(struct 
amdgpu_mn_node *node,
 }
 
 /**
- * amdgpu_mn_invalidate_page - callback to notify about mm change
- *
- * @mn: our notifier
- * @mn: the mm this callback is about
- * @address: address of invalidate page
- *
- * Invalidation of a single page. Blocks for all BOs mapping it
- * and unmap them by move them into system domain again.
- */
-static void amdgpu_mn_invalidate_page(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long address)
-{
-   struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn);
-   struct interval_tree_node *it;
-
-   mutex_lock(>lock);
-
-   it = interval_tree_iter_first(>objects, address, address);
-   if (it) {
-   struct amdgpu_mn_node *node;
-
-   node = container_of(it, struct amdgpu_mn_node, it);
-   amdgpu_mn_invalidate_node(node, address, address);
-   }
-
-   mutex_unlock(>lock);
-}
-
-/**
  * amdgpu_mn_invalidate_range_start - callback to notify about mm change
  *
  * @mn: our notifier
@@ -215,7 +185,6 @@ static void amdgpu_mn_invalidate_range_start(struct 
mmu_notifier *mn,
 
 static const struct mmu_notifier_ops amdgpu_mn_ops = {
.release = amdgpu_mn_release,
-   .invalidate_page = amdgpu_mn_invalidate_page,
.invalidate_range_start = amdgpu_mn_invalidate_range_start,
 };
 
-- 
2.13.5