linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Laura Abbott <labbott@redhat.com>
To: Vlastimil Babka <vbabka@suse.cz>,
	Zhaoyang Huang <huangzhaoyang@gmail.com>,
	Chintan Pandya <cpandya@codeaurora.org>,
	David Rientjes <rientjes@google.com>,
	Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sumit Semwal <sumit.semwal@linaro.org>,
	devel@driverdev.osuosl.org,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] driver : staging : ion: optimization for decreasing memory fragmentaion
Date: Wed, 20 Mar 2019 07:28:33 -0700	[thread overview]
Message-ID: <73eb235f-9515-916e-ff20-0491fe2e107e@redhat.com> (raw)
In-Reply-To: <ca8bb8d0-3252-f9a7-3bf7-98d5a97e40cf@suse.cz>

On 3/20/19 7:23 AM, Vlastimil Babka wrote:
> You should have CC'd the ION maintainers/lists per
> ./scripts/get_maintainer.pl - CCing now.
> 
> On 3/14/19 12:06 PM, Zhaoyang Huang wrote:
>> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>>
>> Two action for this patch:
>> 1. set a batch size for system heap's shrinker, which can have it buffer
>> reasonable page blocks in pool for future allocation.
>> 2. reverse the order sequence when free page blocks, the purpose is also
>> to have system heap keep as more big blocks as it can.
>>
>> By testing on an android system with 2G RAM, the changes with setting
>> batch = 48MB can help reduce the fragmentation obviously and improve
>> big block allocation speed for 15%.
>>
>> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>> ---
>>   drivers/staging/android/ion/ion_heap.c        | 12 +++++++++++-
>>   drivers/staging/android/ion/ion_system_heap.c |  2 +-
>>   2 files changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
>> index 31db510..9e9caf2 100644
>> --- a/drivers/staging/android/ion/ion_heap.c
>> +++ b/drivers/staging/android/ion/ion_heap.c
>> @@ -16,6 +16,8 @@
>>   #include <linux/vmalloc.h>
>>   #include "ion.h"
>>   
>> +unsigned long ion_heap_batch = 0;
>> +
>>   void *ion_heap_map_kernel(struct ion_heap *heap,
>>   			  struct ion_buffer *buffer)
>>   {
>> @@ -303,7 +305,15 @@ int ion_heap_init_shrinker(struct ion_heap *heap)
>>   	heap->shrinker.count_objects = ion_heap_shrink_count;
>>   	heap->shrinker.scan_objects = ion_heap_shrink_scan;
>>   	heap->shrinker.seeks = DEFAULT_SEEKS;
>> -	heap->shrinker.batch = 0;
>> +	heap->shrinker.batch = ion_heap_batch;
>>   
>>   	return register_shrinker(&heap->shrinker);
>>   }
>> +
>> +static int __init ion_system_heap_batch_init(char *arg)
>> +{
>> +	 ion_heap_batch = memparse(arg, NULL);
>> +
>> +	return 0;
>> +}
>> +early_param("ion_batch", ion_system_heap_batch_init);
>> diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
>> index 701eb9f..d249f8d 100644
>> --- a/drivers/staging/android/ion/ion_system_heap.c
>> +++ b/drivers/staging/android/ion/ion_system_heap.c
>> @@ -182,7 +182,7 @@ static int ion_system_heap_shrink(struct ion_heap *heap, gfp_t gfp_mask,
>>   	if (!nr_to_scan)
>>   		only_scan = 1;
>>   
>> -	for (i = 0; i < NUM_ORDERS; i++) {
>> +	for (i = NUM_ORDERS - 1; i >= 0; i--) {
>>   		pool = sys_heap->pools[i];
>>   
>>   		if (only_scan) {
>>
> 

We're in the process of significantly reworking Ion so I
don't think it makes sense to take these as we work to
get things out of staging. You can resubmit this later,
but when you do please split this into two separate
patches since it's actually two independent changes.

Thanks,
Laura


      reply	other threads:[~2019-03-20 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 11:06 Zhaoyang Huang
2019-03-20  1:10 ` David Rientjes
2019-03-20  6:11   ` Zhaoyang Huang
2019-03-20 14:23 ` Vlastimil Babka
2019-03-20 14:28   ` Laura Abbott [this message]

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=73eb235f-9515-916e-ff20-0491fe2e107e@redhat.com \
    --to=labbott@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cpandya@codeaurora.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=sumit.semwal@linaro.org \
    --cc=vbabka@suse.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox