All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Feng <puck.chen@hisilicon.com>
To: Laura Abbott <labbott@redhat.com>, <yudongbin@hisilicon.com>,
	<gregkh@linuxfoundation.org>, <arve@android.com>,
	<riandrews@android.com>, <paul.gortmaker@windriver.com>,
	<bmarsh94@gmail.com>, <devel@driverdev.osuosl.org>,
	<linux-kernel@vger.kernel.org>
Cc: <suzhuangluan@hisilicon.com>, <dan.zhao@hisilicon.com>,
	<zhaojunmin@huawei.com>, <xuyiping@hisilicon.com>,
	<puck.chen@foxmail.com>
Subject: Re: [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool
Date: Fri, 6 May 2016 10:48:38 +0800	[thread overview]
Message-ID: <572C0606.3020106@hisilicon.com> (raw)
In-Reply-To: <e7c1e0ea-074f-52a3-b07f-f0c1ea298d95@redhat.com>



On 2016/5/6 1:09, Laura Abbott wrote:
> On 05/04/2016 08:27 PM, Chen Feng wrote:
>> 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.
> 
> 
> The advantage of the uncached pool was that the pages in the pool
> were always clean in the cache. This is lost here with the addition
> of cached pages to the same pool as uncached pages I agree the
> cache path could benefit from pooling but we need to keep the caching
> model consistent.
> 
Yes, the buffer in the pool is non-cached.

I found that the ion don't have a invalid cache ops.
Currently, we use ioctl to keep the cache coherency.
In this way, there is no difference between these.

So, how do you think add a new cached pool in the system heap?
If yes, I can file a new patch to do this.

>>
>> 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);
>>
> 
> 
> .
> 

  reply	other threads:[~2016-05-06  2:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05  3:27 [PATCH] ION: Sys_heap: Makes ion buffer always alloc from page pool Chen Feng
2016-05-05 17:09 ` Laura Abbott
2016-05-06  2:48   ` Chen Feng [this message]
2016-05-06 17:16     ` Laura Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572C0606.3020106@hisilicon.com \
    --to=puck.chen@hisilicon.com \
    --cc=arve@android.com \
    --cc=bmarsh94@gmail.com \
    --cc=dan.zhao@hisilicon.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=puck.chen@foxmail.com \
    --cc=riandrews@android.com \
    --cc=suzhuangluan@hisilicon.com \
    --cc=xuyiping@hisilicon.com \
    --cc=yudongbin@hisilicon.com \
    --cc=zhaojunmin@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.