Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394849

[PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool

From Chen Feng <puck.chen@hisilicon.com>
Newsgroups linux.kernel
Subject [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool
Date 2016-05-05 05:30 +0200
Message-ID <rvi9c-hG-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Makes the ion buffer always alloced from page pool, no matter
it's cached or not. In this way, it can improve the efficiency
of it.

Currently, there is no difference from cached or non-cached buffer
for the page pool.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
---
 drivers/staging/android/ion/ion_system_heap.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index b69dfc7..caf11fc 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -56,24 +56,10 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
 				      struct ion_buffer *buffer,
 				      unsigned long order)
 {
-	bool cached = ion_buffer_cached(buffer);
 	struct ion_page_pool *pool = heap->pools[order_to_index(order)];
 	struct page *page;
 
-	if (!cached) {
-		page = ion_page_pool_alloc(pool);
-	} else {
-		gfp_t gfp_flags = low_order_gfp_flags;
-
-		if (order > 4)
-			gfp_flags = high_order_gfp_flags;
-		page = alloc_pages(gfp_flags | __GFP_COMP, order);
-		if (!page)
-			return NULL;
-		ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
-						DMA_BIDIRECTIONAL);
-	}
-
+	page = ion_page_pool_alloc(pool);
 	return page;
 }
 
@@ -81,9 +67,8 @@ static void free_buffer_page(struct ion_system_heap *heap,
 			     struct ion_buffer *buffer, struct page *page)
 {
 	unsigned int order = compound_order(page);
-	bool cached = ion_buffer_cached(buffer);
 
-	if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) {
+	if (!(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) {
 		struct ion_page_pool *pool = heap->pools[order_to_index(order)];
 
 		ion_page_pool_free(pool, page);
-- 
1.9.1

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool Chen Feng <puck.chen@hisilicon.com> - 2016-05-05 05:30 +0200
  Re: [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page  pool Laura Abbott <labbott@redhat.com> - 2016-05-05 19:10 +0200
    Re: [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page  pool Chen Feng <puck.chen@hisilicon.com> - 2016-05-06 05:00 +0200
      Re: [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page  pool Laura Abbott <labbott@redhat.com> - 2016-05-06 19:20 +0200

csiph-web