[patch 108/131] mm: remove cold parameter for release_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
Subject: mm: remove cold parameter for release_pages

All callers of release_pages claim the pages being released are cache hot.
As no one cares about the hotness of pages being released to the
allocator, just ditch the parameter.

No performance impact is expected as the overhead is marginal.  The
parameter is removed simply because it is a bit stupid to have a useless
parameter copied everywhere.

Link: http://lkml.kernel.org/r/20171018075952.10627-7-mgorman@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
Acked-by: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Dave Chinner <david@xxxxxxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c  |    6 ++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c |    2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |    2 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.c   |    6 +++---
 drivers/gpu/drm/i915/i915_gem_userptr.c |    4 ++--
 drivers/gpu/drm/radeon/radeon_ttm.c     |    2 +-
 fs/fuse/dev.c                           |    2 +-
 include/linux/pagemap.h                 |    2 +-
 include/linux/swap.h                    |    2 +-
 mm/swap.c                               |    8 ++++----
 mm/swap_state.c                         |    2 +-
 11 files changed, 18 insertions(+), 20 deletions(-)

diff -puN drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -553,8 +553,7 @@ static int amdgpu_cs_parser_bos(struct a
 				 * invalidated it. Free it and try again
 				 */
 				release_pages(e->user_pages,
-					      e->robj->tbo.ttm->num_pages,
-					      false);
+					      e->robj->tbo.ttm->num_pages);
 				kvfree(e->user_pages);
 				e->user_pages = NULL;
 			}
@@ -691,8 +690,7 @@ error_free_pages:
 				continue;
 
 			release_pages(e->user_pages,
-				      e->robj->tbo.ttm->num_pages,
-				      false);
+				      e->robj->tbo.ttm->num_pages);
 			kvfree(e->user_pages);
 		}
 	}
diff -puN drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -347,7 +347,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_
 	return 0;
 
 free_pages:
-	release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false);
+	release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages);
 
 unlock_mmap_sem:
 	up_read(&current->mm->mmap_sem);
diff -puN drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -659,7 +659,7 @@ int amdgpu_ttm_tt_get_user_pages(struct
 	return 0;
 
 release_pages:
-	release_pages(pages, pinned, 0);
+	release_pages(pages, pinned);
 	return r;
 }
 
diff -puN drivers/gpu/drm/etnaviv/etnaviv_gem.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/etnaviv/etnaviv_gem.c
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -779,7 +779,7 @@ static struct page **etnaviv_gem_userptr
 	up_read(&mm->mmap_sem);
 
 	if (ret < 0) {
-		release_pages(pvec, pinned, 0);
+		release_pages(pvec, pinned);
 		kvfree(pvec);
 		return ERR_PTR(ret);
 	}
@@ -852,7 +852,7 @@ static int etnaviv_gem_userptr_get_pages
 		}
 	}
 
-	release_pages(pvec, pinned, 0);
+	release_pages(pvec, pinned);
 	kvfree(pvec);
 
 	work = kmalloc(sizeof(*work), GFP_KERNEL);
@@ -886,7 +886,7 @@ static void etnaviv_gem_userptr_release(
 	if (etnaviv_obj->pages) {
 		int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
 
-		release_pages(etnaviv_obj->pages, npages, 0);
+		release_pages(etnaviv_obj->pages, npages);
 		kvfree(etnaviv_obj->pages);
 	}
 	put_task_struct(etnaviv_obj->userptr.task);
diff -puN drivers/gpu/drm/i915/i915_gem_userptr.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/i915/i915_gem_userptr.c
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -554,7 +554,7 @@ __i915_gem_userptr_get_pages_worker(stru
 	}
 	mutex_unlock(&obj->mm.lock);
 
-	release_pages(pvec, pinned, 0);
+	release_pages(pvec, pinned);
 	kvfree(pvec);
 
 	i915_gem_object_put(obj);
@@ -668,7 +668,7 @@ i915_gem_userptr_get_pages(struct drm_i9
 		__i915_gem_userptr_set_active(obj, true);
 
 	if (IS_ERR(pages))
-		release_pages(pvec, pinned, 0);
+		release_pages(pvec, pinned);
 	kvfree(pvec);
 
 	return pages;
diff -puN drivers/gpu/drm/radeon/radeon_ttm.c~mm-remove-cold-parameter-for-release_pages drivers/gpu/drm/radeon/radeon_ttm.c
--- a/drivers/gpu/drm/radeon/radeon_ttm.c~mm-remove-cold-parameter-for-release_pages
+++ a/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -597,7 +597,7 @@ release_sg:
 	kfree(ttm->sg);
 
 release_pages:
-	release_pages(ttm->pages, pinned, 0);
+	release_pages(ttm->pages, pinned);
 	return r;
 }
 
diff -puN fs/fuse/dev.c~mm-remove-cold-parameter-for-release_pages fs/fuse/dev.c
--- a/fs/fuse/dev.c~mm-remove-cold-parameter-for-release_pages
+++ a/fs/fuse/dev.c
@@ -1636,7 +1636,7 @@ out_finish:
 
 static void fuse_retrieve_end(struct fuse_conn *fc, struct fuse_req *req)
 {
-	release_pages(req->pages, req->num_pages, false);
+	release_pages(req->pages, req->num_pages);
 }
 
 static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
diff -puN include/linux/pagemap.h~mm-remove-cold-parameter-for-release_pages include/linux/pagemap.h
--- a/include/linux/pagemap.h~mm-remove-cold-parameter-for-release_pages
+++ a/include/linux/pagemap.h
@@ -118,7 +118,7 @@ static inline void mapping_set_gfp_mask(
 	m->gfp_mask = mask;
 }
 
-void release_pages(struct page **pages, int nr, bool cold);
+void release_pages(struct page **pages, int nr);
 
 /*
  * speculatively take a reference to a page.
diff -puN include/linux/swap.h~mm-remove-cold-parameter-for-release_pages include/linux/swap.h
--- a/include/linux/swap.h~mm-remove-cold-parameter-for-release_pages
+++ a/include/linux/swap.h
@@ -510,7 +510,7 @@ static inline struct swap_info_struct *s
 #define free_page_and_swap_cache(page) \
 	put_page(page)
 #define free_pages_and_swap_cache(pages, nr) \
-	release_pages((pages), (nr), false);
+	release_pages((pages), (nr));
 
 static inline void show_swap_cache_info(void)
 {
diff -puN mm/swap.c~mm-remove-cold-parameter-for-release_pages mm/swap.c
--- a/mm/swap.c~mm-remove-cold-parameter-for-release_pages
+++ a/mm/swap.c
@@ -210,7 +210,7 @@ static void pagevec_lru_move_fn(struct p
 	}
 	if (pgdat)
 		spin_unlock_irqrestore(&pgdat->lru_lock, flags);
-	release_pages(pvec->pages, pvec->nr, 0);
+	release_pages(pvec->pages, pvec->nr);
 	pagevec_reinit(pvec);
 }
 
@@ -740,7 +740,7 @@ void lru_add_drain_all(void)
  * Decrement the reference count on all the pages in @pages.  If it
  * fell to zero, remove the page from the LRU and free it.
  */
-void release_pages(struct page **pages, int nr, bool cold)
+void release_pages(struct page **pages, int nr)
 {
 	int i;
 	LIST_HEAD(pages_to_free);
@@ -817,7 +817,7 @@ void release_pages(struct page **pages,
 		spin_unlock_irqrestore(&locked_pgdat->lru_lock, flags);
 
 	mem_cgroup_uncharge_list(&pages_to_free);
-	free_hot_cold_page_list(&pages_to_free, cold);
+	free_hot_cold_page_list(&pages_to_free, 0);
 }
 EXPORT_SYMBOL(release_pages);
 
@@ -837,7 +837,7 @@ void __pagevec_release(struct pagevec *p
 		lru_add_drain();
 		pvec->drained = true;
 	}
-	release_pages(pvec->pages, pagevec_count(pvec), 0);
+	release_pages(pvec->pages, pagevec_count(pvec));
 	pagevec_reinit(pvec);
 }
 EXPORT_SYMBOL(__pagevec_release);
diff -puN mm/swap_state.c~mm-remove-cold-parameter-for-release_pages mm/swap_state.c
--- a/mm/swap_state.c~mm-remove-cold-parameter-for-release_pages
+++ a/mm/swap_state.c
@@ -319,7 +319,7 @@ void free_pages_and_swap_cache(struct pa
 	lru_add_drain();
 	for (i = 0; i < nr; i++)
 		free_swap_cache(pagep[i]);
-	release_pages(pagep, nr, false);
+	release_pages(pagep, nr);
 }
 
 /*
_
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux