mm: remove cold parameter for release_pages
authorMel Gorman <mgorman@techsingularity.net>
Thu, 16 Nov 2017 01:37:55 +0000 (17:37 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:06 +0000 (18:21 -0800)
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@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/i915/i915_gem_userptr.c
drivers/gpu/drm/radeon/radeon_ttm.c
fs/fuse/dev.c
include/linux/pagemap.h
include/linux/swap.h
mm/swap.c
mm/swap_state.c

index 60d8bedb694db733a707405a0b50da4fe0c0265c..cd664832f9e8c7e45895ddeb43bba487f15b4471 100644 (file)
@@ -553,8 +553,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
                                 * 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);
                }
        }
index 6149a47fe63d5edbd4f2561bd5e500f3a4078746..0bda8f2a188ab017fb353f07cb13cc42b91c6e15 100644 (file)
@@ -347,7 +347,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
        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);
index bc746131987ffda438988f7b11bbb413b4c335c3..d792959fac43b9e43dc7950f424744f69a702236 100644 (file)
@@ -659,7 +659,7 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
        return 0;
 
 release_pages:
-       release_pages(pages, pinned, 0);
+       release_pages(pages, pinned);
        return r;
 }
 
index 57881167ccd22c9c16df18e1d93401edef2e1f82..bcc8c2d7c7c9c6e77b37b96ee3fd62e1da7f2270 100644 (file)
@@ -779,7 +779,7 @@ static struct page **etnaviv_gem_userptr_do_get_pages(
        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(struct etnaviv_gem_object *etnaviv_obj)
                }
        }
 
-       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(struct etnaviv_gem_object *etnaviv_obj)
        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);
index 709efe2357eac9948ba71a76e11c02ace9f6ae4c..aa22361bd5a15a47129b42a7bcd90fcf51bbdce9 100644 (file)
@@ -554,7 +554,7 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work)
        }
        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_i915_gem_object *obj)
                __i915_gem_userptr_set_active(obj, true);
 
        if (IS_ERR(pages))
-               release_pages(pvec, pinned, 0);
+               release_pages(pvec, pinned);
        kvfree(pvec);
 
        return pages;
index bf69bf9086bf2acb03509fdc0cf6d52e5442f2fe..1fdfc7a46072aa221419b7c61084e39ee017ff61 100644 (file)
@@ -597,7 +597,7 @@ release_sg:
        kfree(ttm->sg);
 
 release_pages:
-       release_pages(ttm->pages, pinned, 0);
+       release_pages(ttm->pages, pinned);
        return r;
 }
 
index a42d89371748e51140c26a57cc4fa7dd28e4196b..17f0d05bfd4c4b4dc9a877832ac3d7f88f0acbaa 100644 (file)
@@ -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,
index e0f7181118fe75d8bed8d5303e8d49304c1a261a..4c6790bb7afb6ed65b2742249e03f15496adcd14 100644 (file)
@@ -118,7 +118,7 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t 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.
index 454f042bcdd535a8acde067f9997de8ce9a6fa81..c2b8128799c1eff57243d0e3fe9efa468b4e7478 100644 (file)
@@ -510,7 +510,7 @@ static inline struct swap_info_struct *swp_swap_info(swp_entry_t entry)
 #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)
 {
index 88a19b6cdf7ce8c8762a1dcd14b2390ba133e9c6..29cf75f1a860f8a913de870dd255f8c0f35cd82d 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -210,7 +210,7 @@ static void pagevec_lru_move_fn(struct pagevec *pvec,
        }
        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, int nr, bool cold)
                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 *pvec)
                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);
index 374d446f7a0aeb4c1a1423dcb31723a02e44a93a..39ae7cfad90f9de41734f667f35b50c675887c2f 100644 (file)
@@ -319,7 +319,7 @@ void free_pages_and_swap_cache(struct page **pages, int nr)
        lru_add_drain();
        for (i = 0; i < nr; i++)
                free_swap_cache(pagep[i]);
-       release_pages(pagep, nr, false);
+       release_pages(pagep, nr);
 }
 
 /*