aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2017-01-10 19:58:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-10 21:31:55 -0500
commit2976db8018532b624c4123ae662fbc0814877abf (patch)
treeb909c1e2b30acf501415cd9fbcd32684cbde02d7
parent8c2dd3e4a4bae78093c4a5cee6494877651be3c9 (diff)
mm: rename __page_frag functions to __page_frag_cache, drop order from drain
This patch does two things. First it goes through and renames the __page_frag prefixed functions to __page_frag_cache so that we can be clear that we are draining or refilling the cache, not the frags themselves. Second we drop the order parameter from __page_frag_cache_drain since we don't actually need to pass it since all fragments are either order 0 or must be a compound page. Link: http://lkml.kernel.org/r/20170104023954.13451.5678.stgit@localhost.localdomain Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c6
-rw-r--r--include/linux/gfp.h3
-rw-r--r--mm/page_alloc.c13
3 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a761001308dc..1515abaa5ac9 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3962,8 +3962,8 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
3962 PAGE_SIZE, 3962 PAGE_SIZE,
3963 DMA_FROM_DEVICE, 3963 DMA_FROM_DEVICE,
3964 DMA_ATTR_SKIP_CPU_SYNC); 3964 DMA_ATTR_SKIP_CPU_SYNC);
3965 __page_frag_drain(buffer_info->page, 0, 3965 __page_frag_cache_drain(buffer_info->page,
3966 buffer_info->pagecnt_bias); 3966 buffer_info->pagecnt_bias);
3967 3967
3968 buffer_info->page = NULL; 3968 buffer_info->page = NULL;
3969 } 3969 }
@@ -6991,7 +6991,7 @@ static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring,
6991 dma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma, 6991 dma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,
6992 PAGE_SIZE, DMA_FROM_DEVICE, 6992 PAGE_SIZE, DMA_FROM_DEVICE,
6993 DMA_ATTR_SKIP_CPU_SYNC); 6993 DMA_ATTR_SKIP_CPU_SYNC);
6994 __page_frag_drain(page, 0, rx_buffer->pagecnt_bias); 6994 __page_frag_cache_drain(page, rx_buffer->pagecnt_bias);
6995 } 6995 }
6996 6996
6997 /* clear contents of rx_buffer */ 6997 /* clear contents of rx_buffer */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index ed77a86fbbb0..0fe0b6295ab5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -499,8 +499,7 @@ extern void free_hot_cold_page(struct page *page, bool cold);
499extern void free_hot_cold_page_list(struct list_head *list, bool cold); 499extern void free_hot_cold_page_list(struct list_head *list, bool cold);
500 500
501struct page_frag_cache; 501struct page_frag_cache;
502extern void __page_frag_drain(struct page *page, unsigned int order, 502extern void __page_frag_cache_drain(struct page *page, unsigned int count);
503 unsigned int count);
504extern void *page_frag_alloc(struct page_frag_cache *nc, 503extern void *page_frag_alloc(struct page_frag_cache *nc,
505 unsigned int fragsz, gfp_t gfp_mask); 504 unsigned int fragsz, gfp_t gfp_mask);
506extern void page_frag_free(void *addr); 505extern void page_frag_free(void *addr);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 097893ffe194..d604d2596b7b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3896,8 +3896,8 @@ EXPORT_SYMBOL(free_pages);
3896 * drivers to provide a backing region of memory for use as either an 3896 * drivers to provide a backing region of memory for use as either an
3897 * sk_buff->head, or to be used in the "frags" portion of skb_shared_info. 3897 * sk_buff->head, or to be used in the "frags" portion of skb_shared_info.
3898 */ 3898 */
3899static struct page *__page_frag_refill(struct page_frag_cache *nc, 3899static struct page *__page_frag_cache_refill(struct page_frag_cache *nc,
3900 gfp_t gfp_mask) 3900 gfp_t gfp_mask)
3901{ 3901{
3902 struct page *page = NULL; 3902 struct page *page = NULL;
3903 gfp_t gfp = gfp_mask; 3903 gfp_t gfp = gfp_mask;
@@ -3917,19 +3917,20 @@ static struct page *__page_frag_refill(struct page_frag_cache *nc,
3917 return page; 3917 return page;
3918} 3918}
3919 3919
3920void __page_frag_drain(struct page *page, unsigned int order, 3920void __page_frag_cache_drain(struct page *page, unsigned int count)
3921 unsigned int count)
3922{ 3921{
3923 VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); 3922 VM_BUG_ON_PAGE(page_ref_count(page) == 0, page);
3924 3923
3925 if (page_ref_sub_and_test(page, count)) { 3924 if (page_ref_sub_and_test(page, count)) {
3925 unsigned int order = compound_order(page);
3926
3926 if (order == 0) 3927 if (order == 0)
3927 free_hot_cold_page(page, false); 3928 free_hot_cold_page(page, false);
3928 else 3929 else
3929 __free_pages_ok(page, order); 3930 __free_pages_ok(page, order);
3930 } 3931 }
3931} 3932}
3932EXPORT_SYMBOL(__page_frag_drain); 3933EXPORT_SYMBOL(__page_frag_cache_drain);
3933 3934
3934void *page_frag_alloc(struct page_frag_cache *nc, 3935void *page_frag_alloc(struct page_frag_cache *nc,
3935 unsigned int fragsz, gfp_t gfp_mask) 3936 unsigned int fragsz, gfp_t gfp_mask)
@@ -3940,7 +3941,7 @@ void *page_frag_alloc(struct page_frag_cache *nc,
3940 3941
3941 if (unlikely(!nc->va)) { 3942 if (unlikely(!nc->va)) {
3942refill: 3943refill:
3943 page = __page_frag_refill(nc, gfp_mask); 3944 page = __page_frag_cache_refill(nc, gfp_mask);
3944 if (!page) 3945 if (!page)
3945 return NULL; 3946 return NULL;
3946 3947